Is the iPhone Simulator UDID unique for each installed instance?
Solution 1
My UDID is reporting as 03B41D62-FB69-5B6D-A95E-473842F4DFE3 from the iPhone Simulator, so it looks like you're correct.
Solution 2
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.
Solution 3
Xcode has this data for you:
- Xcode 5: Open Organizer
- Click My Mac
Look at the Identifier for the machine there.
-OR-
Xcode 6: Open Devices (CMD+SHIFT+2 -OR- Window -> Devices)
- Click the simulator you're running
- Look at the Identifier for the simulator there
Solution 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.
Related videos on Youtube
Chirayu Ball
Updated on December 30, 2020Comments
-
Chirayu Ball over 3 years
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".
-
ronedg over 9 yearsWhen 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.
-
Matt Parkins over 9 yearsI can't find "my mac" anywhere. Did you mean step 1 to say "open devices" instead?
-
cynistersix over 9 years@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.
-
Fazal Majid about 9 yearsThey 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.
-
jk7 over 7 yearsThis 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)