Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get UDID in iOS 8 +

I need to get the UDID of my iPhone to use in my iOS app.

Some info about my app:

  • My app is not for the public and will never make it to the store, so I can use any 3rd party libraries. It will only be used by some employees at work.

  • My device will always be plugged into a Mac, while my app is running.

The way I see it, there are only 2 ways this can be accomplished.

  1. Use a third party library to get the UDID inside of my iOS app.
  2. Since the iPhone will always be plugged into a Mac while my app is running, how about getting the UDID via the Mac and transferring it in some way to my app in the iPhone.

Any ideas would be appreciated. Thanks.

Edit: Question is, do you know any 3rd party libraries or a better way to get my app to automatically get the iPhone's UDID while running?

Edit 2: I know this can be done using only my phone because of this web app: http://get.udid.io/

How does this work?

like image 315
donga Avatar asked Mar 25 '15 08:03

donga


People also ask

How do I find my UDID on iOS?

Connect your device to a Mac device using a USB cable and tap on your device name in the sidebar menu. Next, simply click on the tab under the device name. 2. Now, you will see the UDID of your iOS device (it will also display other information like the serial number, etc.).

Where can I find UDID on iPhone 7?

Select your iOS device by clicking the device's image located at the upper-left corner of iTunes's UI. On the next screen, a window should appear listing your phone's Capacity, Phone Number, and Serial Number. By clicking on Serial Number once, the prompt should change to display your UDID.


1 Answers

If you're trying to read the UDID to automate something on the Mac, then you can use something like system_profiler SPUSBDataType to get the UDID, for my phone the entry:

          Product ID: 0x12a8
          Vendor ID: 0x05ac  (Apple Inc.)
          Version: 7.01
          Serial Number: 7bed*********************************33
          Speed: Up to 480 Mb/sec
          Manufacturer: Apple Inc.
          Location ID: 0x1d110000 / 6
          Current Available (mA): 500
          Current Required (mA): 500
          Extra Operating Current (mA): 1600

The line Serial Number is the UDID (I've starred it out as I'm stupidly paranoid).

Note, that without the UDID you could never have got the app onto the phone in the first place.

You could run a small daemon process on the mac, reading this information and creating a bonjour service that provides the information to requestors - it's a SMOP.

like image 165
Petesh Avatar answered Oct 02 '22 10:10

Petesh