Proper way to debug watchos2 app in XCode7

醉酒当歌 提交于 2019-12-10 13:39:52

问题


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.


回答1:


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




回答2:


I have been dealing with the same issue this last days, I just updated to iOS 9.2, watchOS 2.1 and XCode 7.2, and now everything works.




回答3:


After update XCode to 7.2, iOS9.2 my phone and WatchOS2.1 my Apple Watch the debug process is better. I suggest to update all your devices.



来源:https://stackoverflow.com/questions/32760318/proper-way-to-debug-watchos2-app-in-xcode7

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!