ios 如何获取 Apple Watch 唯一 ID 或 UDID?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29275418/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to get Apple Watch Unique id or UDID?
提问by Amrit Trivedi
I want to get Apple Watch unique id. Is there anything available like UDID or unique identifier for developers?
我想获得 Apple Watch 的唯一 ID。开发人员是否有可用的 UDID 或唯一标识符之类的东西?
回答by djromero
There should be a way with Xcode 8...but I can't find it.
Xcode 8 应该有办法......但我找不到它。
My solution for now: launch "Accessibility Inspector", click "Start inspection follow point" button (the one in the middle, kind of cross-hairs), click in Xcode on top of the UDID value and then copy the UDID from the inspector shown values.
我现在的解决方案:启动“辅助功能检查器”,单击“开始检查跟随点”按钮(中间的那个,有点像十字准线),在 Xcode 中单击 UDID 值,然后从检查器中复制 UDID显示值。
回答by David
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.
事实证明,您还必须将 Apple Watch 的 UDID 添加到 Apple Developer Portal,并更新您的开发配置文件以包含此 UDID。
UDID 可以在 Xcode 的 Devices 窗口中获取。配对后,Apple Watch 的信息会自动显示在您 iPhone 的信息下方。
在撰写本文时,这似乎没有任何记录,Apple Watch 上的错误消息也不是特别有用。所以我希望这个试错课可以为你省去一些麻烦。
回答by Nello Castellano
Open XCode.
打开 XCode。
Under the menu Windows > Devices
在菜单 Windows > 设备下
select your iPhone (must a registered device)
选择您的 iPhone(必须是已注册的设备)
Below the info about your device you will notice an headline "Paired Device Information".
在有关您的设备的信息下方,您会看到一个标题“配对设备信息”。
One of the data provided is "Identifier". Copy the related value in your registered devices in the Developer's Portal and you are ready to go.
提供的数据之一是“标识符”。在开发人员门户中复制您注册设备中的相关值,您就可以开始了。
回答by Kex
You mean you want to access it via code written in your app? I don't think this is possible. I know it's not possible for iPhone. And apple do not accept apps that access the UDID. seems you're out of luck.
你的意思是你想通过你的应用程序中编写的代码访问它?我不认为这是可能的。我知道 iPhone 是不可能的。并且苹果不接受访问UDID的应用程序。看来你倒霉了。
http://www.macworld.com/article/2031573/apple-sets-may-1-deadline-for-udid-iphone-5-app-changes.html
http://www.macworld.com/article/2031573/apple-sets-may-1-deadline-for-udid-iphone-5-app-changes.html