tags:

views:

262

answers:

3

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

A: 

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.

Greg Hewgill
+1  A: 

Have you tried starting Xcode with sudo?
The processes it spawns (gdb,...) should also run with superuser privileges:

sudo /Developer/Applications/Xcode.app/Contents/MacOS/Xcode
weichsel
A: 

Have u tried adding a new custom executable with sudo as the target and your program as an argument. I haven't tried it but i think it will work. Hope it helps

Samit