Debugging App When Launched by Push Notification

In Xcode < 4.0 (for Xcode >= 4, see answer by delirus below), you can now configure Xcode to attach the debugger to the app after you launch it, instead of launching the app through the debugger. This lets you debug things that vary based on the launch state of your application, such as URL schemes, pasteboards, and push notifications.

  1. In Xcode look in the Source bar, and below Targets there will be Executables.
  2. Bring up the inspector for your app in executables.
  3. Click on the Debugging tab tab in the inspector.
  4. Uncheck “Start executable after starting debugger”
  5. Check the “Wait for next launch/push notification”

Now when you click debug from Xcode instead of launching the app a window will display telling it is waiting for the app to launch. You then launch the app normally on the phone and Xcode attaches to it

Leave a Comment