Can't profile iOS app: permission to debug was denied

Viewed 5194

I am unable to profile my app using the simulator, I always get this error:

Target failed to run. Permission to debug [x] was denied.

Screenshot:

screenshot of Instruments with error

When I profile the app using an actual device, it works fine (iPhone running 11.1). Running the app on the simulator also works fine by the way. Please note that it's not mentioning provisioning profile or certificate problems, which is what similar questions on SO are about.

The build configuration in the scheme for the Profile action is correctly set to Debug.

I am using Xcode 9.1, but it was also a problem in 9.0.1. Can't remember about 9.0.0 but it definitely used to work in Xcode 8.

1 Answers

Found something in the Apple Developer Forum:

First, make sure your command line tools are setup correctly: Open the Terminal and type Xcode-select --install to install them to the correct location. Verify the correct use in Xcode Preferences Components.

Second, restart your Mac. It sounds a bit PC stylish, but try it.

Hope this helps. Happy coding.

Related