xcode - 以编程方式获取Macbook/设备的颜色

标签 xcode swift macos

我想检测用户设备的颜色,以将其与实际设备的图像相关联(例如:Macbook SpaceGray或Gold)。

我发现可以使用iOS设备使用私有(private)API,但是有没有办法(如果可能的话)使用OSX?

任何帮助是极大的赞赏。

最佳答案

如果您的Mac应用使用互联网连接,那么second answer on this page可能会有用:

http://standards.ieee.org/regauth/oui/index.shtml

Download the OUI list from this page. However this will only supply manufacturers portion of the OUI (the first 3 octets). You will need to go to each manufacturer to obtain a copy of the address portion, usually the 4th octet which will identify the device type. the 6th octet is usually used for the unique device ID.



A mac address is a 48 bit hexadecimal number. The first 24 bits are the OUI which can be used to identify the manufacturer.



困难的部分是确定Apple分配给每台计算机的mac代码

关于xcode - 以编程方式获取Macbook/设备的颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35949932/

相关文章:

macos - 为什么当 system() 在相​​同命令上成功时 pclose() 返回 32512(退出代码 127)?

objective-c - NSScrollView 在 Cocoa 中不滚动且 contentView 大小不正确

ios - 添加构建变体并在 iOS 8 上运行它

ios - Swiftui Firebase AddSnapShotListener

swift - 为什么这个 Swift 代码不进行类型检查?

Swift:将类的 ObjectID 用于可哈希协议(protocol)会导致 set.contains 方法中的随机行为。代码有什么问题吗?

ios - 应用程序中的非公共(public)选择器?

ios - 滑动手势给出 NSException

swift 。 UIKit 中委托(delegate)模式的协议(protocol)。 NSObject协议(protocol)

macos - 如何禁用 MacOS 终端的选项卡自动完成 "camera flash"?