如何以编程方式获取 Apple Watch 唯一 ID 或 UDID 或序列号? [英] How to get Apple Watch Unique id or UDID or Serial Number Programatically?

查看:27
本文介绍了如何以编程方式获取 Apple Watch 唯一 ID 或 UDID 或序列号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 Apple Watch 中以编程方式读取任何唯一信息,例如 UDID 或序列号.有什么办法可以拿到吗??我想以编程方式而不是通过 xcode 手动获取..

I want to read any unique info like UDID or serial number programmatically in apple watch. Is there any way to get it ?? I want to get programatically not manually via xcode..

推荐答案

类似于使用 identifierForVendor 唯一标识 iOS 设备的方法,watchOS 也有.

Similar to the method that uses identifierForVendor to uniquely identify an iOS device, watchOS also has one.

if let uuid = WKInterfaceDevice.current().identifierForVendor?.uuidString {
    print("UUID:",uuid)
}

这篇关于如何以编程方式获取 Apple Watch 唯一 ID 或 UDID 或序列号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆