Reputation: 6576
I need to debug a command line application with Xcode... and I need to have the debugger launch my app with 'sudo'. How do I tell Xcode to do that?
thx->adv
Upvotes: 9
Views: 12067
Reputation: 34253
Have you tried starting Xcode with sudo?
The processes it spawns (gdb,...) should also run with superuser privileges:
sudo /Applications/Xcode.app/Contents/MacOS/Xcode
Upvotes: 12
Reputation: 2413
Running XCode as root is a bad idea.
There is an option for this in XCode (6.2):
Upvotes: 21
Reputation: 993333
You could launch XCode itself with sudo
, then it will be running with the privileges of your nominated user, and also your application would run with the same privileges.
This may not be the best way; there may be a way to tell XCode to launch your application in a particular way. But the above method will work in any case.
Upvotes: 1