12

I'm building a native Apple Watch app and on the simulator it will print to the console just fine, however when I run on device it never does this. Is this expected behaviour?

William Robinson
  • 1,038
  • 17
  • 32
  • Apple hasn't announced anything with regard to truly native, standalone apps. You can do a bit more with watchOS 2 though, such as access the microphone, speaker, digital crown, heart rate sensor, and taptic engine programmatically. **What do you mean by "Building a native app"?** –  Jun 29 '15 at 05:26
  • A watch app that has code / the extension running on the watch device using watchOS 2. – William Robinson Jun 29 '15 at 09:15

3 Answers3

5

If all these answers don't work:

  • Restart Watch
  • Restart iPhone
  • Restart Xcode

This did the trick for me ;)

Appyx
  • 1,145
  • 1
  • 12
  • 21
2

Make sure you're selecting the watch target.

Command-R should run the app directly on the watch with the debugger attached.

Once the above works, you should be able to see the logs by going to Xcode > Window > Devices and then clicking on your phone.

Open up the console area at the bottom. Once it's opened up, you can click near the top of the area to switch between your phone and your watch.

funroll
  • 35,925
  • 7
  • 54
  • 59
0

You simply need to attach to the WatchKit extension process:

Solution:

  • Run your extension in the simulator.

  • Xcode menu Debug -> Attach to Process -> Choose "MyExtension(your extension's name)" in System section in the menu.

Woodstock
  • 22,184
  • 15
  • 80
  • 118