如何获取 Apple Watch 唯一 ID 或 UDID?

How to get Apple Watch Unique id or UDID?

我想获取 Apple Watch 的唯一 ID。是否有像 UDID 或开发者唯一标识符这样的东西可用?

你是说你想通过在你的应用程序中编写的代码来访问它?我认为这是不可能的。我知道 iPhone 不可能。并且苹果不接受访问UDID的应用程序。看来你运气不好。

http://www.macworld.com/article/2031573/apple-sets-may-1-deadline-for-udid-iphone-5-app-changes.html

It turns out you also have to add the UDID of the Apple Watch to the Apple Developer Portal, and update your Development provisioning profile to include this UDID.

The UDID can be obtained in Devices window of Xcode. After pairing, the info of the Apple Watch will automatically display below the info of your iPhone.

At the time of writing, this seems to be documented nowhere, and the error message on the Apple Watch wasn't particularly helpful. So I wish this try-and-error lesson would save you some hassle.

打开XCode。

在菜单下 Windows > 设备

select 您的 iPhone(必须是已注册的设备)

在您的设备信息下方,您会看到一个标题 "Paired Device Information"。

提供的数据之一是"Identifier"。复制您在开发者门户中注册的设备中的相关值,您就可以开始了。

Xcode 8 应该有办法...但我找不到。

我目前的解决方案:启动 "Accessibility Inspector",单击 "Start inspection follow point" 按钮(中间那个,有点像十字准线),单击 UDID 顶部的 Xcode值,然后从检查器显示的值中复制 UDID。