Reputation: 17612
I'm trying to debug an issue in my app. It only occurs when the app is started from the user tapping a push notification banner. Moreover, it only happens during a cold launch (I force-close the app prior to tapping the notification).
I know I can attach the Xcode debugger to a running process. However, by the time the app starts and I attach the debugger, it's too late. I'd like to debug the startup sequence. Is it possible?
Upvotes: 3
Views: 777
Reputation: 131398
If you edit your build scheme and open the run options there are a pair of radio buttons called something like "Launch automatically" or "Wait for launch". You want the "wait for launch" option.
(I'm not at my Mac so I don't have the exact titles of the buttons. Sorry.)
Then when you run your app from the debugger it installs it and then Xcode sits and waits for an external event to launch the app. This facility is built for exactly what you're trying to do.
Upvotes: 7