苹果手表连不上Xcode怎么办

本文最后更新于 2024年12月16日 上午

中文步骤

(English is follows.)

记录一下解决苹果手表连不上Xcode的玄学问题。通过以下几步有较高概率可以解决这个问题。语言从中文切换成英语也能增大成功的概率。(我也不知道为什么)

  1. 先检查手机和Mac是不是在同一个wifi网络下,如果不在,切换完成后检查一下手表和Xcode的链接状态,好了就不用进行下面的步骤了。
  2. 注意这个时候你的手机已经设置好了开发者模式。
  3. 将手表和手机解除配对。从手表上操作或者从手机上操作无所谓。
  4. 重启iPhone和Apple watch。(有概率你的Apple watch取消配对了之后会无法关机,进入了关机界面后点不动关机按钮。这种情况就不要管手表了)这个时候手机应该没有和电脑用数据线连着。
  5. 重新将手表和手机配对。选择设置为新的手表。
  6. 将手机用数据线和Mac连接。
  7. 在Apple Watch上选择“信任电脑”
  8. 把手机从电脑上拔下来再插上。
  9. 关掉Xcode,再启动Xcode
  10. 打开有手表target的项目等一小会。
  11. 即使手表没有设置成开发者模式,也能被Xcode匹配到。只是在用户试图在手表上运行自己的App的时候,Xcode会提示需要在手表上也开启开发者模式,依照说明去做就好。
  12. 如果操作了以上全部步骤依然有问题的话,请试着将手机和手表的系统语言都换成英文后再从头操作以下。

English steps

How to solve the problem that Apple Watch cannot connect to Xcode?

  1. First check whether the phone and Mac are on the same Wi-Fi network. If not, check the connection status between the watch and Xcode after the switch is completed. If it is OK, you don’t need to proceed to the following steps.
  2. Note that your iPhone has already been set up in developer mode at this time.
  3. Unpair the watch and phone. It doesn’t matter if you do it from your watch or from your phone.
  4. Reboot iPhone and Apple watch. (It is possible that your Apple watch will not be able to shut down after being unpaired, the shutdown button doesn’t work after entering the shutdown interface. In this case, leave the watch alone.) At this time, the phone should not be connected to the computer with a data cable.
  5. Pair your watch and phone again. Select setup my watch as a new one.
  6. Plug iPhone to Mac.
  7. Select “Trust” the computer on Apple Watch when it asks.
  8. Unplug and plug again.
  9. Restart Xcode.
  10. Open the project with watch target and wait for a while.
  11. Even if the watch is not set to developer mode, it can still be matched by Xcode. Just when the user tries to run his or her app on the watch, Xcode will prompt that the developer mode needs to be turned on on the watch as well. Just follow the prompts from Xcode.
  12. If you still have problems after following all the above steps, please try changing the system language of both the phone and watch to English and then proceed from the beginning.

相关问题

“如何开启开发者模式?”
“Apple watch的开发者模式如何开启?”
“苹果手表里的开发者模式不见了。”

当无法连接apple watch到Xcode的时候,一开始可能会认为问题出在手表没有开启开发者模式(developer mode)。然后,我当时就研究这个了半天,其实当Xcode试图在手表上运行项目时,开发者模式的选项才会出现。

以上步骤10已经提到过。

“‘相信这台电脑’怎么都跳不出来怎么办?”
“我不小心在手表上/手机上点了‘not trust’怎么办?”

在手机的 Setting > General > (拉到最下面)Transfer or Reset iPhone > Reset > Reset Location & Privacy

可以解决上述问题 “我不小心在手表上/手机上点了‘not trust’怎么办?”。对于第一个问题,这样做类似于遇事不决就重启的感觉。

对于第二个问题,还可以在手表上 Setting > (拉到最下面)Developer > Clear Trusted Computer


Reference:

[1]: https://developer.apple.com/documentation/xcode/enabling-developer-mode-on-a-device

[2]: https://stackoverflow.com/questions/30792520/in-xcode-i-see-no-paired-apple-watch-even-though-the-watch-is-paired-and-the-w


苹果手表连不上Xcode怎么办
作者
Nitch
发布于
2024年5月7日
许可协议