Is the iPhone Simulator UDID unique for each installed instance?

二次信任 提交于 2019-12-04 08:37:13

问题


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".


回答1:


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




回答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.




回答3:


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



回答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.



来源:https://stackoverflow.com/questions/1520189/is-the-iphone-simulator-udid-unique-for-each-installed-instance

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!