In Xcode I have edited the scheme for the iOS device, and changed the build configuration to release (under run app).
Now when I connect my iPhone and try to press the run the Xcode project on to my iPhone directly, I get the following error:
(null): Application failed codesign verification. The signature was invalid, contains disallowed entitlements, or it was not signed with an iPhone Distribution Certificate. (-19011)
Note – When I change the build configuration back to debug mode, it seems to work on the device.
I want to test the app in release mode before I submit to the app store.
Confusion
I am not sure if the way I attempting is correct way or if I should use archive to test it in release mode.
Questions:
- What should I do to resolve this error ?
- Is it possible to run the app in the release mode on the device from Xcode ?
- For release mode testing should I be using the archive (.ipa) and syncing it ?
You cannot debug or run your application on the device when it has been built with an app store provisioning profile. The entitlements disallow debugging through the
get-task-allowvalue, and the provisioning profile does not include any allowed device IDs.If you are archiving your app using the standard Xcode “Archive” command, you can resign the archive with your developer identitiy and provisioning profile for testing on the device. Select the archive in the Organizer and choose “Distribute”. Choose the second option and select your developer identity/profile:
The generated IPA should then run on the device for testing. When you want to submit to the store, you can choose the same archive for submission.
If you are not using Xcode’s Archive functionality (e.g. building on the command line), you will need to either resign the app store IPA yourself for testing (difficult but possible on the command line), or simply build both an app store and test version at the same time from the same code base. You can then be fairly sure the two IPAs are based on the same version of your source code.