How to make Mac app archive signed? - macos

I want to publish my Mac app to Mac App Store.
So I've tried to sign my app and archive with Xcode 4.
I got the process to sign the app - build settings.
However, I don't know how to sign archive(package).
In Organizer, when I tried to submit with archive, identity drop box shows that "No valid signing identities found" and others aren't showed.

You need to create installation package certificate here: http://developer.apple.com/certificates/index.action
download newly created certificate and double click it to install
Restart XCode if it was launched
UPDATED: And guys! One more thing! Don't use beta SDK. The itunes connect wouldn't accept such binary.

You need the INSTALLER and the APPLICATION certificate for this. And restarting is important, Remizorrr is right!

Related

XCode is unable to create a distribution signing identity

I am trying to submit my app to iTunes Connect. I have submitted it before(TestFlight) but at some point my certificates have stopped working. I have tried to renew them with 2 different approaches without any success.
Approach 1: In XCode I get the error that says that the developer profile already has a distribution certificate and suggest me resetting it. Resetting results in the same pop up window so this goes into a loop and does not work.
Approach 2: If I create the certificates and profiles manually in developer portal the archiving process only works if I select the correct identities in the build settings, otherwise the build fails and XCode says that it can not find code signing identities. But I cannot submit the archive because the following error occurs:
I have also tried exporting the .ipa from the archive(to upload it with Application loader) but this does not find the signing identities as well with the same error:
So now I am trying to go the suggested route where XCode is supposed to do all the work for me.(https://developer.apple.com/library/ios/qa/qa1814/_index.html) For a clean slate I have deleted all certificates, key-pairs and provisioning profiles from my mac and developer center.
I have removed all relevant keypairs and certificates from keychain. I have deleted all the provisioning profiles from my mac. I have also deleted all certificates and profiles from the developer site. I have also deleted and re-added the developer account in XCode settings.
I set the project's build settings:
I also set the team in general tab.
Now I guess XCode is supposed to fix my signing issues but after I press fix issues below the team option in general tab
I still go to the reset development/distribution certificate loop.
One thing I notice is that XCode does generate a key-pair to the keychain but not the certificate.
How can I upload my app to iTunes Connect with or without these problems?
Im using XCode 7.2 and this is a Unity3D app.
I have removed all relevant keypairs and certificates from keychain
Okay, but that is what Xcode is complaining about (each time it says "but it is not installed locally" in all the messages you have displayed). You need the private/public certificate pairs in your keychain. If you deleted the private half of the certificates, that is a huge mistake, because you can never restore it (Apple does not have it — it is private). You now will probably have to start all over again by throwing away absolutely everything — all certificates, all provisioning — both locally and at the member center, and beginning from scratch.
This can be done, but it is not trivial, because if you launch Xcode while any remnant remains, Xcode will try to install the certificate back into your keychain. To do it, you would need to delete everything from the keychain, mobile provisions folder, and member center, with Xcode not running.
I managed to upload the package by extracting the .ipa from the archive with
xcodebuild -exportArchive -exportFormat ipa -archivePath {path-to-xcarchive} -exportProvisioningProfile {“profile name”} -exportPath ~/Desktop/MyApp.ipa
and then uploading it with Application Loader.

Xcode 6 OS X Submission Error: iOS Apps must have a provisioning profile

I'm having the worst time ever submitting an update to my Mac app. Everything was fine until I updated to Xcode 6. I'm in Mavericks, 10.9.4. I get the following error:
iTunes Store operation failed.
Unable to process application at this time due to the following error: iOS Apps must have a provisioning profile.
I have no idea why it says "iOS." Don't know if that's an Xcode bug or it thinks I'm making an iOS app. I used the same Xcode project file to submit the Mac app in the previous Xcode.
I have tried the following with no results:
• Revoked and deleted all certificates and provisioning profiles and started over.
• I created all certificates, provisioning profiles manually rather than Xcode managing them.
• Set the provisioning profile in "release" in the target and in a different occasion, in the project file.
• Gone into the project info and created a separate configuration.
The only "weird" thing I would say that I could be doing insanely obviously wrong is when I look at the options for code singing identity for release, it says "Mac Developer:yata" but there is no option for "Mac Distribution:(myname)" Should there be? I didn't need that in the past. Also, the only options that I can select are in a section called "identities in keychain." Should there be another section? "Identities in Xcode?"
Thank you for anyone that can help. I'll try pretty much anything at this point.
Solution for my case:
I got error in validation stage.
On organizer we see:
1) Go to Apple download page and download xCode 5.1.1
2) Double click on xcode_5.1.1.dmg
3) Copy xCode.app to Desktop
4) Rename xCode.app -> xCode511.app
5) Move xCode511.app -> Applications
6) Close xCode 6.1
7) Work with validation and upload in xCode511.app
UPDATED
8) Be careful ! ITC.apps.validation.prerelease_build_missing
I don't have Xcode right now, but here are the steps:
Delete your certificate and provisioning, both your mac and iTunes account
Regenerate the certificates and provisioning profile (distribution)
Download double click
Go to the account tab, then view account
All certificates and profiles will be listed refresh the stuff there
Clean and rebuild your app with the right provision and 3 party Mac developer
archive, validate and submit (select the right provison and match the app)
voila!
EDIT
Everything you will ever need to know :
https://developer.apple.com/library/mac/documentation/IDEs/Conceptual/AppDistributionGuide/Introduction/Introduction.html
I was having the same problem... finally I click on Submit and it worked! It seems that the problem is on Validate only.
Okay so our problem was that our company name had an apostrophe in it ---- could have the same issue if you have quotes in your company name as well. I contacted Apple for them to change it and then uploading worked from Xcode 5.1.1.

Can't get my Mac App signed for testing receipt validation

I have my "Mac Developer: ..." certificate installed and it is valid.
I have the Apple Worldwide Developer Relations intermediate ceritficate as well.
I also have a "3rd Party Mac Developer Application" distribution certificate.
In my build settings I have chosen my "Mac Developer: ..." identity for code-signing.
When I built the first time, codesign asked for permission to sign my app and I clicked Always Allow.
Then I did a "Show in Finder.." to see the Product of the build. I found my .app and double clicked it. However, this is what is shown in the system Console:
10/13/11 8:40:44.531 PM storeagent: Unsigned app (/Users/kenny/Library/Developer/Xcode/DerivedData/MyAppName-gabpxiaypxtnikelsyzjwkperixq/Build/Products/Debug/MyAppName.app).
I'm not running the app from Xcode, I just opened the Console app and then double-clicked the app in my build directory.
Why is my app still unsigned? What am I missing?
What works for me everytime is killing the storeagent (thanks fubo). For me it only works with exact that command:
killall -KILL storeagent
It took me a long time to figure out what was causing this when I had the same issue myself a while back. I finally figured it out. You must set the Code Signing Identity (in your app's target & project settings) to 3rd Party mac Developer Application. Then, when exporting your app you must select the 3rd Party Mac Developer Installer certificate in the export wizard.
That's the only way that worked for me. Please correct me if I'm wrong.

Before signing a mac app and uploading it to the app store

I've been dealing with an issue for a while. The issue is that when I submit my mac app to the app store I'm always getting invalid binary and they are saying it's because of an invalid signature. And that I should make sure it's signed with the installer certificate which it is.
Here is the complete message from them:
Dear Developer,
We have discovered one or more issues with your recent binary
submission for "Mini Week". The following issues will need to be
corrected in order for your application to proceed to review:
Invalid Signature - This error occurs when you have signed your app's
installer incorrectly. There are two certs required for this process:
the "3rd Party Mac Developer Application" cert and the "3rd Party Mac
Developer Installer" cert. When signing your package, you need to
ensure that you are using the Installer cert to sign your package.
Ensure that you are specifying this cert when submitting your app via
the Xcode Organizer or when running productbuild from the command
line.
Once you have corrected these issues, go to the app's version details
page (found in the Manage Your Applications module of iTunes Connect)
and click Ready to Submit Binary. Proceed through the submission
process until the app's status is Waiting for Upload. You can then use
Application Loader to upload the corrected binary.
Regards,
The iTunes Store Team
I've revoked and reinstalled my certificates and development providing profile but that doesn't seem to help so I'm assuming that's not the issue.
Is there something else that could cause this? Maybe I need to make sure something is correct in my build settings or something like that? But if so what? :)
Thank you in advance!
Actually, the signing process does not happen when you submit the app from Code Organizer. Conversely, it may happen when you build your app for deployment, but only if you selected the appropriate cert on the "Code Signing Identity" in the target build settings.
Note that you could also manually sign an existing app via command line:
codesign -s "<name of your signing cert>" -fv "<path/to/your/app/bundle>" -o kill,hard
where <name of your signing cert> is the canonical name of your 3rd Party Mac Developer Installer cert. The optional -o kill,hard enforces the code signature for the OS to allow user to launch the application: if you omit this option, an user could open the app bundle, delete the code sign folder, and copy the app on a different machine. With this option, your app bundle will only launch on the authorized machine, and will not run when the signature folder is not present.

Can't submit Mac app via xcode4 - Invalid Signature

I keep getting this error:
Invalid Signature - This error occurs when you have signed your app's installer incorrectly. There are two certs required for this process: the "3rd Party Mac Developer Application" cert and the "3rd Party Mac Developer Installer" cert. When signing your package, you need to ensure that you are using the Installer cert to sign your package. Ensure that you are specifying this cert when submitting your app via the Xcode Organizer or when running productbuild from the command line.
I've googled, and have followed instructions but to no avail.
I have:
Projects > targets > build > code signing > 3rd Party Mac Developer Application:
Then when I go to archive and it opens up Organizer I go to submit I select the '3rd Party Mac Installer' key. But it still fails :(
Do I need to do anything else? Like clean and then build first? (Build for what? Or just select build? - Although I've tried pretty much all of them first, and then archive).
If it's of relevance I am using MacRuby, and had to do this first to set it up for xcode deployment: http://redwoodapp.posterous.com/macruby-and-xcode-4-build-a-self-contained-ma
Any help appreciated - I'm tearing my hair out here :(
I had the same problem lately. And this is a perfect chance to write down and share my own notes. :)
I am assuming you are using Xcode and Organizer (not application uploader)
Step 1: Check Keychain Access.app.
You have to have two certificates (That you download from mac dev center). Each of these has to be linked with a private key.
In the picture, I have only one certificate "nacho4..." linked with a private key "nac...". So I should go to the mac dev center and download my certificates in order to continue. Download them and drag them into the "login".
Step 2: Make sure you can build your app with the right configuration.
In my case, I setup three configurations.
Debug: can debug + no signing (for development)
Release: cannot debug + no signing (mainly for internal betas, etc)
Distribution: cannot debug + signing (for app store distribution)
Go to project "build info">"build signing">
Make sure that you are signing you code with the correct sign identity. Something like: "3rd Party Mac Developer Application. My Company Inc."
*If you can't see this then it means something wrong is with your certificates in Keychain Access.app. Check your certificate is linked with a private key
Step 3 Make sure you are building the right configuration.
(Yeah, kind of obvious but it happened to me the last time. This is the reason you could be getting "Invalid signature") In the "Edit Scheme" panel , make sure you have the right configuration in the "Archive" section. In my case is "Distribution" (The default is "Release ")
Note that if you don't do this correctly you will get be able to submit your binary to Apple but minutes later you will get an "Invalid Signature". Because the certificates are fine but the app is not signed.
Step 4: Build you app and submit it
Xcode>Product>Archive
The organizer will appear. Now just submit it.
I have found that validating the archive is useless because sometimes even the validation fails I am able to submit my app without errors. I read this from other threads too so not only me. So if you are sure this is the version you want to submit to Apple. just press the submit button.
You are asked your username and password.
Then, you get another menu to select the application (With has only one option, at least in my case) and then select the signing identity I think.
This is important! Make sure "3rd Party Mac Developer Installer" is selected and everything should work.
If you can't see "3rd Party Mac Developer Installer" option in the last menu then it means something is missing in your keychain. (The Installer certificate from the mac dev center)
Note that if you don't do this correctly you will be able to submit your binary but minutes later you will get an "Invalid signature" mail from iTunes Connect because the app probably could be well signed but the certificates Apple will se are incorrect.
I hope it helps.
The other two answers are good checklists, but it didn't work for me.
My problem was that I had installed Xcode 3.2.6 on Lion (it doesn't work anyway, but that's another story). This corrupted the productutil app.
To fix it: install the BSD.pkg in the Packages folder of your Lion Installer.
Thanks to Jacob Gorban to share his solution on Apple Devs Forums.
Think this is finally sorted - thanks to Daniel from the MacRuby mailing list. I actually ended up creating a ticket with Apple, but hopefully they won't charge me for it now it's been fixed without them.
You can view the solution here: http://astonj.com/uncategorized/invalid-signature-error-on-submitting-app-to-the-mac-app-store/

Resources