Get iOS device info from a Mac app

时间:2018-02-01 02:32:54

标签: ios swift macos

I am creating a macOS application that captures a screen recording of a tethered iOS device. I'm using CoreMediaIO. One thing I am not able to figure out is how to simply get certain device info that I need to display.

Setting an AVCaptureDevice gets me sort of there:

let device:AVCaptureDevice = listdevices[1]

print("Device Name: \(device.localizedName)")
print("model ID: \(device.modelID)")
print("Manufacturer: \(device.manufacturer)")
print("UDID: \(device.uniqueID)")

The above will give me:
- Joe's iPhone
- iOS Device
- Apple, Inc.
- 76e6bc436fdcfd784d6c4e39d11ed2fe9236bb4ec

I still need to know the following:

  • iOS version
  • Modal # or Name (e.g. Silver iPhone X)

I feel that's all CoreMediaIO has for me...is there a better way?

Edit: I want this same information that iTunes has when a device is tethered...

iTunes device info graphic

链接到其他html页面

1 个答案:

答案 0 :(得分:0)

似乎有几种方法可以做到这一点。这些资源拥有我需要的信息。不幸的是,他们不在斯威夫特。

https://www.theiphonewiki.com/wiki/MobileDevice_Library https://github.com/h3adshotzz/DeviceUtilz

我下载并构建了第二个链接。工作得很好,并且有我需要的所有信息......但我不知道客观c。 :(