Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to test the release build on device with Xcode 4.2?

I've just finished writing an update for my app, and now I want to submit it to the app store.

I've thoroughly tested it in debug mode on multiple devices, but I want to test it with the release build just to make sure nothing screws up.

In Xcode 4.0.2, when I wanted to test the release build (i.e. not distribute), I would just do the following

  1. In the project settings, make sure that the release code signing is set to "iPhone Developer" not "iPhone Distribution"
  2. Go to Edit scheme..., and change the Run scheme to Release instead of Debug.
  3. Make sure my distribution provisioning profile is installed in Xcode
  4. Run it on the device, make sure everything works.

If it all works, I would then distribute with the following:

  1. Change the code signing to "iPhone Distribution"
  2. Make sure the Archive scheme is set to Release
  3. Archive
  4. Submit

Now the problem is, with Xcode 4.2, I can't test the release build on my device. - When I build it with release to my iPod, I get an alert:

A valid provisioning profile for this executable was not found.

So, I checked my provisioning profiles under the main "Library" section of the Devices pane (all provisioning profiles), and I found my distribution profile there.

The problem is, the provisioning profile says "This profile cannot be installed on deivces".

So, if I can't use the distribution profile with a device - how am I supposed to test the release build?

I would appreciate any advice with this issue - sorry if there's something obvious I'm missing!

like image 742
Alex Coplan Avatar asked Jan 15 '12 13:01

Alex Coplan


People also ask

What is build for testing in Xcode?

build-for-testing is not for distribution of your app to testers but instead to run unit tests using it. This build has special compile options that make it testable. Basically, it shouldn't be used for anything else except for running unit tests on it.

How do I check if a build is Debug or Release Swift?

Check your project's build settings under 'Apple LLVM - Preprocessing', 'Preprocessor Macros' for debug to ensure that DEBUG is being set - do this by selecting the project and clicking on the build settings tab. Search for DEBUG and look to see if indeed DEBUG is being set.


1 Answers

Ref: https://developer.apple.com/legacy/library/technotes/tn2250/_index.html#//apple_ref/doc/uid/DTS40009933

How do I confirm my Provisioning Profile is for App Store distribution?

You can confirm whether your provisioning profile is an App Store Distribution profile within the Xcode Organizer > Devices tab > Provisioning Profiles section under "Library"; single-click to select the particular provisioning profile and in the Header Pane, the "Devices" text will read "This profile cannot be installed on devices" if it is an App Store Provisioning Profile.

That means you would need to create another distribution profile for testing.

like image 154
Sailesh Avatar answered Sep 26 '22 04:09

Sailesh