Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Proper way to debug watchos2 app in XCode7

I'm rewriting my watch app to work in watchos2 but have problems debugging on the actual watch (XCode7). What is the correct way how to do this?

1) Obvious (but naive) approach - connect your phone with paired watch, in XCode select Extension scheme to run on Phone + Watch. Click play and it should work, right? This seems to work only just after fresh pairing and breaks very quickly (after few debug runs). See issues and behaviour below

2) Run phone app first then add run of extension - this approach worked for me longer but eventually broke as well.

3) Unpair and pair again - more than painful experience, time consuming and not practical at all. Will help for a while though.

Main problems:

  • phone app not communicating - I've seen not reachable or messages just time out
  • watch app stops running - XCode is saying it's running but it's not - won't even attach. If I run it manually on watch most of the times it will attach but then the phone app is not reachable
  • watch app won't even install - I suspect when the XCode is saying it's running it in fact it doesn't because when I remove the app from watch and then run XCode goes through the whole install process and "running" but the icon doesn't even appear on the main screen
  • phone stops reacting when I use option 2) and try to run something else while app is attached
  • phone seems to be blocked, selecting other apps (even going back to my app) won't work until I kill the session

Setup: The phone and watch is paired correctly, phone can see watch, watch can see phone, other apps are working. Watch "trusts" the computer as well, app is "shown on apple watch". Phone is 5s 9.0.1.

I've tried various restart combinations (phone|watch|xcode|mac), shuffled cables, disconnect, reconnect, etc. but that didn't help either.

Did anybody find a usable way how to debug watchos2 app from XCode? Nobody else seems to be complaining about this with released XCode7 though I've seen lots of similar issues in beta builds.

like image 520
Tom Avatar asked Sep 24 '15 11:09

Tom


1 Answers

Use Apple watch recharging cable, connect your watch to developing Mac that runs Xcode. It provides much more successful and fast debugging.

like image 71
jeeeyul Avatar answered Sep 30 '22 00:09

jeeeyul