98

I have all my code signing entitlements set correctly. Running the app on my phone is fine, but launching it in instruments gives me an error message:

Error Starting Recording
At least one target failed to launch; aborting run

And then:

Target failed to run. Permisson to debug [app name] was denied. The app must be signed with a development identity (i.e. iOS Developer)

Any ideas how I could stop this from happening? Doesn't happen on my iPad.

9 Answers 9

220

Edit the scheme for your target and under "Profile [App Name]" set the Build Configuration to Debug (it's usually Release by default).

6
  • 6
    +1, thanks, this helped me. I'd add that I had to build the project after setting configuration to Debug or Instruments still wouldn't play ball.
    – Robert
    Oct 21, 2013 at 9:51
  • 4
    Although I know this "change config to Debug" is wrong I don't have a remedy for this problem. Generally speaking it's far less useful / common to profile a debug build.
    – user501138
    Dec 28, 2013 at 20:40
  • 1
    That's because Release is often using Production certificate. Jan 15, 2014 at 9:47
  • I have ensured that the profile scheme is using debug configuration (developer profile) and I am still encountering this issue. This is an enterprise developer certificate, though I would not expect that to be of significance. Any thoughts? Mar 25, 2014 at 16:25
  • 3
    I am running into the same problem. Profiling your app with debug configuration is not a valid performance test as the compiler has not optimized the code like it does for Adhoc. Has anyone figure out the AdHoc issue? May 30, 2014 at 16:56
34

It is saying that you need to sign the app with a developer certificate (not a distribution certificate).

In Xcode 5 just change the "Provisioning Profile" field for your "Release" build in the Build Settings to your developer certificate instead of your distribution certificate. For the duration of the testing anyway. Xcode doesn't allow you to build with a distribution certificate.

Make sure that the project build settings do not override the target build settings or make the change in your project build settings.

Don't forget to set the profile back after you're done with the testing.

I do not recommend harrywynn's method, since it is better to profile the release build because then you are taking into account the compiler optimizations, and having the exact experience your users will.

2
  • 1
    First, it needs a development profile so it means it needs to be in debug mode. Second, unless Apple change it to distribution profile, devs will probably go with development builds. Third, you're profiling, it should be a development(Debug) build. Fourth, why would you use a development profile for a Release scheme?
    – Angelo
    Mar 24, 2014 at 5:32
  • 4
    "First, it needs a development profile so it means it needs to be in debug mode." You can run any configuration with any profile. "Third, you're profiling, it should be a development(Debug) build" You should profile with the release build to take the compiler optimizations into account. You might get different results. "Fourth, why would you use a development profile for a Release scheme?" Because that's easiest the solution to this problem. And you should change the profile back when you are ready testing, as I wrote in my answer. Mar 28, 2014 at 15:19
9

To add to the previous answers.

  • Instruments is complaining about the signing identity.
  • I believe it is preferable to profile in release mode, for the same reasons given by Zolten. (take into account the compiler optimizations, and have the exact experience your users will, etc...)
  • To change your code signing identity for Xcode 6:
    • Click on your Project, Select the Target you are Profiling.
    • Build Settings -> Code Signing -> Code Signing Identity -> Release
    • Select your iOS developer profile.
  • Provisioning Profile: Let Xcode pick the correct Provisioning Profile for you, e.g: switch to Automatic
  • When you are done with the Profile, switch back to your normal settings.

Here's a picture for those who are very visual ;)

enter image description here

1

I was getting the same issue : [INST STDERR] Instruments Trace Error : Target failed to run: Permission to debug was denied. The app must be signed with a development identity (e.g. iOS Developer).

Solution: 1. I archived the the app with Debug Developer Profile in xcode for device. 2. The go to Window -> Organiser -> to see all the list of archieves 3. Now select the archive to wanted to export and open it in finder 4. Right click and show package contents 5. Go to the Products/Applications folder You will see the .app file.

Use this instead of the ipa.

Make sure that the device has been already added to the developer portal and all the certs are installed on it for the above steps to work.

Once this is in place. Also, make sure you get the ios-webkit-debug-proxy from the link below:

https://github.com/appium/appium/blob/master/docs/en/advanced-concepts/ios-webkit-debug-proxy.md

Also, enable developer tools on on the device setting. Also, make sure safari webinspector (safari -> Develop) -> Inspector is on Hope it helps:-)

NOTE: When you want appium to install the app on the device for you, don't provide Bundle ID.

1
  • The app file is under Products -> Applications under the Package contents Jun 25, 2015 at 10:02
0

I achieved to solve this issue on my machine by doing this :

  • Generate a new Developer Provisioning Profile with your device in the list or at least make sure that your machine is in the list of the profile's device.
  • In Project settings -> Code Signing -> Provisioning Profile -> Debug : Set the newly created profile.
  • In Targets settings -> Code Signing -> Provisioning Profile -> Debug AND Release : Set the newly created profile.

Hope that helps.

0

I realised what "At least one target failed to launch" means. It appears that both the development and release schemes (if you have a debug scheme and a release scheme) must have a development identity.

I had the debug scheme selected when running the profiler and the message at the top of XCode said "Running debug". However, it seems that this is not sufficient.

I changed my release scheme code-signing identity to be the same as the debug scheme (and also the provisioning profile), and the problem went away.

0

it worke.. when i changed my profile schema to debug mode and also made sure, build configs has developer certificate in it. Thanks

0

None of the other solutions here fixed my problem, but I did determine that it was only a problem for me on the simulator. The device works fine. Perhaps there's an issue with the simulator.

0

I encountered this problem with Xcode 9.1 for both simulators and devices, and my running scheme was already set as profiling with "Debug". Finally found this Apple forum discussion very helpful and got the problem resolved. In short, the solution that worked for me is ... Restart the Mac.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.