0

I have a cocoa application. I need to retrieve the UDID of the iPhone connected to machine using cable. Is there any way to programatically discover iOS devices connected to Mac OS X machine in cocoa application?

ZameerMoh
  • 1,149
  • 1
  • 17
  • 26
  • this may be help you: https://stackoverflow.com/questions/6567565/programmatically-retrieve-an-os-x-disk-partition-uuid – Rocky Dec 20 '17 at 06:39

4 Answers4

2

MacOS 10.15.x:

xcrun xctrace list devices

Outputs:

== Devices ==
MACOS device itself (xxxxxxxxx-xxxxxx-xxxx-xxxxx-xxxxxxxxx)
iPhone (16.2) (yyyyy-xxxxxxxxxxxxxxxxxxx)
Adriaan
  • 17,741
  • 7
  • 42
  • 75
0

It isn't possible to get UDID programatically. Since iOS 5 Apple has removed access to UDID. Kindly refer to the following where this has already been discussed. Get UDID of IOS device programmatically?

UIDevice uniqueIdentifier Deprecated - What To Do Now?

Vakas
  • 6,291
  • 3
  • 35
  • 47
0

Connect your device to Mac and open iTunes. Then click on the symbol of the device. It will show the UDID of the device.

And if you want to get UDID programmatically please refer this link. How to get a unique device ID in Swift?

swapnil patel
  • 384
  • 2
  • 17
0

In case you want it without programmatically,

Connect the iPhone to the Mac, open the iTunes, click this button marked with red enter image description here

After that in the screen you're getting, click on the serial number in the area marked with red here, you'll get the UDID enter image description here

ZameerMoh
  • 1,149
  • 1
  • 17
  • 26
  • I need to get UDID programatically in cocoa app –  Dec 20 '17 at 05:42
  • UDID is no longer available in iOS 6+ due to security / privacy reasons. Instead, use identifierForVendor or advertisingIdentifier. try this: https://stackoverflow.com/questions/25925481/how-to-get-a-unique-device-id-in-swift – ZameerMoh Dec 20 '17 at 05:47
  • UIDevice is only available in iOS application. I need code in OSX application –  Dec 20 '17 at 05:51
  • 1
    implemeted using terminal command "instruments -s devices | grep -v \"Simulator\"" and split the details –  Dec 20 '17 at 07:08