How to start debugging Cocoa app with url?

I am debugging a Cocoa application that can act as a handler for a custom URL protocol. The application works fine when I click the link after the application starts, but something causes damage to the application if it was not launched when the link was clicked.

Is it possible to run the application in the debugger and β€œtrick” it into thinking that I just clicked the link?

+4
source share
2 answers

You can do

gdb --wait myAppName 

and then click the link to launch the application. This will cause the application to quickly enter the debugger very early before main starts.

+4
source

Could you connect to the process from Xcode after calling the URL handler? You can try putting modal NSAlert in your URL handler code to pause it until you can connect to your process.

0
source

All Articles