I'm writing an iPhone app that can be started via a custom URL. So, I override - (BOOL)application:(UIApplication *)application handleOpenURL:(NSURL *)url
To test my changes, I have to run the app in the simulator, then quit out and launch Safari. I then type in my custom URL in the address bar to launch the app.
But every time I launch, the app crashes. I'm trying to figure out why, but when I set a breakpoint and launch the app from the home screen (instead of in XCode) it doesn't seem to attach.
I even tried putting NSLog statements in the handleOpenURL message, but they don't get printed to the console.
I suppose I could create UIAlertViews but... yeah, yikes. Any other way to connect to a debug session in the Simulator?
In Xcode 4, you can edit your target's scheme and in the "Run" section, "Info" tab, you can choose the "Wait for MyApp.app to launch" option:
This will cause the debugger to wait until the next time your app starts, and then attach to that process rather than creating a new process for you. This will let you launch your app manually from Safari and use the debugger.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With