8

i.e. does this call:

NSString *udid = [UIDevice currentDevice].uniqueIdentifier;

return always the same UDID when it is executed on the iPhone Simulator on any mac computer or not?

Currently the iPhone Simulator on my computer returns "2BA99337-3AE2-5234-93DA-193703B876F8".

4 Answers 4

45

The UDID of the simulator is actually the same as the UDID of your Mac. You can easily verify this by looking at the System Profiler utility (where it is called the Hardware UUID).

On iPhones, iPads and iPod Touches, it is 40 lowercase hex digits, probably a SHA1 hash of some hardware identifier.

2
  • 6
    When I run the simulator under Xcode (developer tools->ios simulator) each virtual device (Hardware->device->manage) I click from the list shows me a different identifier, and none are similar to my mac UUID.
    – ronedg
    Oct 26, 2014 at 17:31
  • They probably changed the Xcode 4 behavior in line with iOS 7 changes for UDID. In iOS 7, the UDID is now "ffffffff" followed by the identifierForVendor stripped of its hyphens. Mar 3, 2015 at 20:41
15

Xcode has this data for you:

  1. Xcode 5: Open Organizer
  2. Click My Mac
  3. Look at the Identifier for the machine there.

    -OR-

  4. Xcode 6: Open Devices (CMD+SHIFT+2 -OR- Window -> Devices)

  5. Click the simulator you're running
  6. Look at the Identifier for the simulator there
2
  • 1
    I can't find "my mac" anywhere. Did you mean step 1 to say "open devices" instead? Nov 6, 2014 at 16:11
  • 1
    @MattParkins I've updated my answer to respect your observation that I only accounted for Xcode 5 at that time. I've now added Xcode 6 as well. Nov 11, 2014 at 5:40
4

My UDID is reporting as 03B41D62-FB69-5B6D-A95E-473842F4DFE3 from the iPhone Simulator, so it looks like you're correct.

4

Open terminal and type in system_profiler SPHardwareDataType - the output under Hardware UUID is the ID used for all instances of iOS simulator running on that specific computer.

1
  • 3
    This is not correct in my case. Hardware UUID: B8EBD816-974E-57F2-BF3C-F60385B3EFE1, Simulator's Identifier in Xcode: 66742464-8B19-4D25-B132-F5DE75CB296C, [[UIDevice currentDevice] identifierForVendor]: CC6E8A6F-40CD-40DA-A7DB-C5BF19527467, macOS: 10.11.6, Xcode: 8.1 (8B62), Simulator: iPad Air (iOS 9.3)
    – jk7
    Dec 29, 2016 at 21:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.