Search Unity

Publishing on Mac App Store

Discussion in 'Getting Started' started by feloque1, Feb 19, 2015.

  1. feloque1

    feloque1

    Joined:
    Jan 20, 2015
    Posts:
    11
    Hello,

    When I try to upload my .pkg to the Mac App Store using Application Loader I get the following error:

    ERROR ITMS-90239: "Invalid Signature. Code object is not signed at all. The binary at path [PullSticks.app/Contents/MacOS/PullSticks] contains an invalid signature. Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target. For more information, please consult https://developer.apple.com/library...deSigningGuide/Introduction/Introduction.html"

    Please, any help?

    Thank you.
     
  2. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Did you codesign it with a provisioning profile?
     
  3. feloque1

    feloque1

    Joined:
    Jan 20, 2015
    Posts:
    11
    No, I did codesign with a certificate. Here are the steps:

    chmod -R a+xr "Unity/Space/MacApp/PullSticks.app"

    export CODESIGN_ALLOCATE="/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/codesign_allocate"


    codesign --force -v --sign "3rd Party Mac Developer Application: FBF Sistemas" "Unity/Space/MacApp/PullSticks.app/Contents/entitlements.plist"


    codesign --force -v --sign "3rd Party Mac Developer Application: FBF Sistemas" --entitlements "Unity/Space/MacApp/PullSticks.app/Contents/entitlements.plist" "Unity/Space/MacApp/PullSticks.app/Contents/Frameworks/MonoEmbedRuntime/osx/libmono.0.dylib"


    codesign --force -v --sign "3rd Party Mac Developer Application: FBF Sistemas" --entitlements "Unity/Space/MacApp/PullSticks.app/Contents/entitlements.plist" "Unity/Space/MacApp/PullSticks.app/Contents/Frameworks/MonoEmbedRuntime/osx/libMonoPosixHelper.dylib"


    codesign --force --verify --sign "3rd Party Mac Developer Application: FBF Sistemas" --entitlements "Unity/Space/MacApp/PullSticks.app/Contents/entitlements.plist" "Unity/Space/MacApp/PullSticks.app"


    productbuild --component "Unity/Space/MacApp/PullSticks.app" "/Applications" --sign "3rd Party Mac Developer Installer: FBF Sistemas" "Unity/Space/MacApp/PullSticks.pkg"

    And then I get that error.

    Please, any help?
     
  4. User340

    User340

    Joined:
    Feb 28, 2007
    Posts:
    3,001
    Have you tried the Unity Entitlements Tool?
     
  5. feloque1

    feloque1

    Joined:
    Jan 20, 2015
    Posts:
    11
    Thanks a lot Daniel! It worked!
     
  6. Deleted User

    Deleted User

    Guest

    I did try the Unity Entitlements Tool, but it didn't work for me. If anyone has a bit of time, here's my issue using Apple's Application Loader 3.1:

    Trying to submit my Unity Mac app to the App Store. Application Loader 3.1 confuses my Mac app App ID with my iOS App ID.

    Here’s what I’ve done to solve the problem, so far:

    1. First, credit to Randy Edmonds and the thread contributors at http://forum.unity3d.com/threads/submit-unity-games-to-the-mac-app-store.71340/.
    2. I’ve got separate certificates for iPhone Developer and iPhone Distribution, as well as, 3rd Party Mac Developer Application and 3rd Party Mac Developer Installer. My iTunes Connect iOS app is under review, and my iTunes Connect Mac app is waiting for me to upload my build.
    3. In the Edit Project Settings menu, under “Player,” I check the box for “Mac App Store Validation.”
    4. I “Show Package Contents” of the app, open the “info.plist” file in XCode 6.3.2, and add two fields: an Application type field of “Games: Puzzle”, and a human readable copyright field.
    5. I replace the “UnityPlayerIcon.png” icon in the Contents:Resources folder with my app’s custom icon.
    6. I adjust read permissions on the content using: chmod -R a+xr “/path/to/Gamename.app”.
    7. Then, I codesign, in two parts:
      • codesign -f -v -s "3rd Party Mac Developer Application: DeveloperName” "/Users/username/Desktop/MyApp.app/Contents/Frameworks/MonoEmbedRuntime/osx/libmono.0.dylib"
      • codesign -f -v -s "3rd Party Mac Developer Application: DeveloperName” "/Users/username/Desktop/MyApp.app/Contents/Frameworks/MonoEmbedRuntime/osx/libMonoPosixHelper.dylib"
    8. I then build the package, as follows:
      • productbuild --component /Users/username/Desktop/MyApp.app /Users/username/Desktop --sign "3rd Party Mac Developer Installer: DeveloperName /Users/username/Desktop/myapp.pkg
    9. I delete the source application, i.e., the product of my initial Unity build, and then test the package built in step 8. to confirm that it creates my application, as follows:
      • sudo installer -store -pkg myapp.pkg -target /

    This process works nicely, and does indeed yield a package installer, which successfully installs my application. I also purchased a great product from the Unity Asset Store: Mac App Store Toolset (https://jemast.com/unity/mac-app-store-toolset). It also produces a package that works to install my application.

    However, in both cases, Application Loader 3.1 sees my app as an iOS application. A/L picks up the wrong App ID. e.g., if my iOS app has an App ID of, say, 99999 and my Mac app has an App ID of 99333, the A/L screen to build incorrectly identifies my package/incorrectly points to the wrong cert/incorrectly extracts the wrong App ID.

    Sorry for the long post—please point out the error of my ways, besides verbosity. Thanks.
     
    Last edited by a moderator: May 28, 2015
  7. Deleted User

    Deleted User

    Guest

    As feloque1 notes, I need an entitlements plist. I copied one from Kevin's blog (http://sookocheff.com/posts/2013-04-09-submitting-a-unity3d-game-to-the-mac-app-store/), but I had to call it *after* both codesign statements, so make this the third bullet point in item #7:

    • codesign --force --sign "3rd Party Mac Developer Application: DeveloperName" --entitlements MyApp.entitlements MyApp.app
    I now have a clue as to why Application Loader 3.1 thinks my Mac app is an iOS app--it's my bundle identifier. Somehow, I need to associate my bundle identifier with my app; using the same bundle identifier as my iOS app doesn't work. And, just editing the "info.plist" to have a unique bundle identifier isn't sufficient, either.

    Hmm..​
     
  8. Deleted User

    Deleted User

    Guest

    Uploaded to App Store successfully. I adjusted my info.plist fields for both the bundle identifier *and* the version numbers. i.e., I had to change the versions from Unity's 5.0.2f1 to my version (1.0 in this case).

    Plus, I had to make sure that my bundle identifier for my app was accurately reflected in the plist.

    One other error in my recipe above. In step # 8., I needed to build to the /Applications folder in my 'productbuild' command, not the Desktop. Application Loader 3.1 forces this behavior, or errors out. Thanks for allowing me to share on the forum.
     
    NomadKing likes this.
  9. K1kk0z90_Unity

    K1kk0z90_Unity

    Joined:
    Jun 2, 2013
    Posts:
    90
    Hello,
    Sorry to reply to this old thread, but building for Mac App Store is really harder than I expected.
    Thank you very much for sharing your knowledge @rlharper !

    After creating the .pkg file, following all the steps of @rlharper, I tried to install my app with the generated .pkg. But when I try to launch the installed app, I get a message that says that this app was purchased using App Store on another computer, and to login with the Apple ID used to purchase it if I want to use it. Obviously I haven't published this app yet, and if I try to login with my Apple ID it says "The Apple ID you entered couldn't be found or your password was incorrect.", even if these are correct.
    Anyone has an idea of what could I be doing wrong? Thank you in advance for any help! :)
     
  10. 23894723907

    23894723907

    Joined:
    Feb 18, 2015
    Posts:
    1
    I also have a similar problem but my app says its damaged when I enter a password. Does anyone with mac store experience know if this behaviour is normal if the app isn't installed via the app store or is the app actually damaged? (I can run my app without app store validation).

    As it stands I feel that I shouldn't release my app, because I don't know if it will work (some beta testing functionality would be nice Apple!)
     
  11. SachinGanesh

    SachinGanesh

    Joined:
    Jun 28, 2015
    Posts:
    20