How to debug WatchKit and iPhone Parent App on XCode

So you made your Watch app, needing a network call, you put the call in the Parent’s app delegate handleWatchKitExtensionRequest. boom, you’re getting error and cannot seem to debug the parent app. ANd here you are.

At first it looks as if you cannot debug a running Watchkit app and Parent app (both on simulator at the same time using XCode 6.3. But actually you could

Step 1

set a breakpoint on the line where you make the

WKInterfaceController.OpenParentApplication

and run the watchkit app

app-launch

Step 2

As the execution is paused on the specified breakpoint, go to the iPhone simulator and manually launch the parent app.

Step 3

Go back to Xcode, head over to the menu bar and select Debug > Attach to Process > Your parent app . Press resume and you should be hitting the breakpoint on the parent app.

debug

I really hope on XCode 6.4, they would just attach to the parent process automatically.

Ronald Widha is a Digital Strategist and a podcast addict. He loves all things disruptive and a cool hunter. Currently living in NY.

4 thoughts on “How to debug WatchKit and iPhone Parent App on XCode”

  1. tipztv says:

    I’m using this method but I can’t seem to get any println showing up. Breakpoints are working. Am I doing something wrong?

    1. Ronald Widha says:

      have you tried using NSLog?

      1. tipztv says:

        does not work either :-/

        1. Ronald Widha says:

          Are you sure you’re looking at the right debug console for your parent app process? You can toggle from the left bar

Comments are closed.