xcrun simctl list devices booted in Terminal — the value in parentheses is the simulator’s UDID. You can also copy it from Xcode’s Window → Devices and Simulators → Simulators tab, where it appears as the Identifier field.Why this happens
The iPhone simulator is not a device in the hardware sense. There is no serial number, no IMEI, nothing burned into silicon. When CoreSimulator creates a simulator instance, it assigns it a UUID and stores that identifier on disk. Everything that needs to tell one simulator apart — Xcode, simctl, the build system, the app container paths — uses that UUID. It is the simulator’s UDID.
That is also why you cannot read it from UIDevice. UIDevice.current.identifierForVendor returns an identifier scoped to your app’s vendor, not to the simulator. It is regenerated when the last app from your vendor is removed, and it is not the value Xcode or simctl uses to name the device.
A lot of older answers point at system_profiler SPHardwareDataType. That prints your Mac’s hardware UUID. It was offered back when the simulator was a single fixed instance tied to the host machine, and it does not identify a CoreSimulator device today. Ignore it.
One more detail worth knowing: simulators created by older Xcode versions used 40-character hex UDIDs, while current ones use the standard hyphenated UUID form (8-4-4-4-12). Both are still valid identifiers — the format just tells you roughly when the simulator was created.
How to fix it
1. Ask simctl in Terminal (fastest)
xcrun simctl list prints every runtime and simulator CoreSimulator knows about, with the UDID in parentheses:
$ xcrun simctl list devices
-- iOS 18.0 --
iPhone 16 (1A2B3C4D-5E6F-7A8B-9C0D-1E2F3A4B5C6D) (Shutdown)
iPhone 16 Pro (7F8E9D0C-1B2A-4C3D-8E9F-0A1B2C3D4E5F) (Booted)
To see only the simulators that are currently running, pass booted as a search term:
xcrun simctl list devices booted
The older recipe pipes the output through egrep '(Booted)'. That still works, but the search term is cleaner and does not depend on the exact wording of the state column. If more than one simulator is booted, the output lists all of them — check the device name before you copy.
2. Copy it from Xcode
Open Window → Devices and Simulators and select the Simulators tab. Pick the simulator in the sidebar; the Identifier field on the right is the UDID. The text is selectable, so you can copy it straight out.
This is the same value simctl prints. Use whichever is closer to hand.
3. Read it off the CoreSimulator folder
Every simulator has a directory named after its UDID:
ls ~/Library/Developer/CoreSimulator/Devices
Each entry is a UDID. To find out which simulator a folder belongs to, read its device.plist:
plutil -p ~/Library/Developer/CoreSimulator/Devices/1A2B3C4D-5E6F-7A8B-9C0D-1E2F3A4B5C6D/device.plist
The plist contains the device name, its runtime, its current state and the UDID itself. Inside the folder, data/Containers/Data/Application holds the installed apps’ sandbox directories — useful when you need to inspect files an app wrote during a test run.
4. Get it as JSON for scripts
simctl list accepts -j (or --json), which is what you want when a script or CI job needs the value rather than a human:
xcrun simctl list -j devices | jq -r '
.devices | to_entries[] | .value[]
| select(.state == "Booted")
| "\(.name)\t\(.udid)"'
Drop the select line to list every simulator. Without jq, plutil -convert json or a few lines of Python will do the same job.
5. Use the UDID once you have it
Most simctl subcommands accept either a UDID or the literal booted:
xcrun simctl boot 1A2B3C4D-5E6F-7A8B-9C0D-1E2F3A4B5C6D
xcrun simctl get_app_container booted com.example.MyApp data
xcrun simctl uninstall booted com.example.MyApp
get_app_container prints the on-disk path of the app’s container, which saves a lot of manual digging through ~/Library/Developer/CoreSimulator.
A note on instruments -s devices
Older answers recommend instruments -s devices. instruments was deprecated and is no longer part of recent Xcode command line tool installs, so the command fails on current machines. xcrun simctl list replaced it and covers the same ground.
How to prevent it
- Prefer
bootedover a hard-coded UDID in scripts; the UDID changes whenever the simulator is deleted and recreated. - Never commit a simulator UDID to a repo or a build setting — it is local to one Mac and meaningless on a teammate’s machine.
- Do not try to register a simulator UDID in the developer portal; provisioning profiles only accept real device UDIDs.
- Keep the
xcrun simctl list devices bootedone-liner in your notes instead of hunting through Xcode menus each time. - If you need the identifier inside the app for logging, read
ProcessInfo.processInfo.environment["SIMULATOR_UDID"]rather thanidentifierForVendor, which is a different value entirely.
FAQ
Is the simulator UDID the same as the UDID used for provisioning?
No. A provisioning profile is tied to physical device UDIDs registered on your developer account. Simulator UDIDs are local UUIDs generated by CoreSimulator and cannot be added to the portal.
Does the UDID change?
It stays the same for the life of the simulator instance. Delete the simulator and create a new one and it gets a fresh UDID, so anything that stored the old value stops matching. Erasing content keeps the same identifier.
Why does UIDevice give me a different value?
identifierForVendor is scoped to your app vendor and is generated per install, not per simulator. It is not the UDID and cannot be used to look up the simulator’s folder under ~/Library/Developer/CoreSimulator/Devices.
Parts of this guide are adapted from content licensed under CC BY-SA 3.0; this article is shared under the same license.