How to check device id of iPhone simulator?

2019-03-10 18:59发布

I want to check device id for my iPhone simulator application. But not using codebase. I know the way how to do with codebase, using UIDevice instance.

Is there any way to find device id without using codebase?

7条回答
啃猪蹄的小仙女
2楼-- · 2019-03-10 19:26

You can also retrieve the same UDID, labeled as "Identifier," in the Xcode Organizer by selecting "My Mac" from the list under Devices.

查看更多
干净又极端
3楼-- · 2019-03-10 19:31

As so often, there is a Xcode terminal tool for that (part of the Xcode tools) see xcrun manpage

xcrun simctl list | egrep '(Booted)'

lists only all booted (could be more than one) Simulators (remove | egrep '(Booted)' to see them all).

UIID results like

 iPhone 6 Plus (AAAABD40-9DE6-44B7-A4EA-B34ABCDEFCA6) (Booted)

you can then lookup a folder in ~/Library/Developer/CoreSimulator/Deviceson your Mac and find all the "belongings" of that particular Simulator

查看更多
贼婆χ
4楼-- · 2019-03-10 19:44

Try this

instruments -s devices
查看更多
The star\"
5楼-- · 2019-03-10 19:44

There is another way without using command line, inside this plist file ~/Library/Developer/CoreSimulator/Devices/device_set.plist, it lists down all the devices with UUID.

查看更多
淡お忘
6楼-- · 2019-03-10 19:47

Xcode -> Window -> Devices and Simulators -> Select Device for which you want identifier (Inside details you can see identifier)

查看更多
Summer. ? 凉城
7楼-- · 2019-03-10 19:49

Is the iPhone Simulator UDID unique for each installed instance?

This answer should be what you want. Look at System Profiler on your mac and the id is there. I just tested on my machine and the IDs match.

This is the exact Terminal command you can enter to view it:

system_profiler SPHardwareDataType
查看更多
登录 后发表回答