karagoz devices
Lists what adb devices lists and, on macOS, the iOS simulators that are running and the iPhones connected to the Mac.
- Android emulator Done
- Android device Done
- iOS simulator Done
- iOS device Done
karagoz devicesTakes no options.
Before you start
Section titled “Before you start”- On Android: a running emulator (
emulator -avd <name>), or a phone with USB debugging on, in statedevice. - On an iOS simulator: Xcode, opened once, and a booted simulator (on Xcode 27,
xcrun simctl boot <name>; on older ones,open -a Simulator). The Command Line Tools alone have nosimctl. - On an iPhone: Xcode 15 or newer, and the iPhone connected to the Mac. The Command Line Tools alone have no
devicectl.
Examples
Section titled “Examples”List the devices
Section titled “List the devices”karagoz devices{"devices":[{"id":"emulator-5554","platform":"android","kind":"emulator","state":"device","name":"Medium_Phone_API_36.1"}]}exit 0An iOS simulator next to the emulator
Section titled “An iOS simulator next to the emulator”karagoz devices{"devices":[{"id":"emulator-5554","platform":"android","kind":"emulator","state":"device","name":"Medium_Phone_API_36.1"},{"id":"4E70BFCA-5FC6-49B5-92EC-48E265B2D50F", "platform":"ios","kind":"simulator","state":"Booted","name":"iPhone 17 Pro"}]}exit 0Output
Section titled “Output”{ "devices": [ { "id": "emulator-5554", "platform": "android", "kind": "emulator", "state": "device", "name": "Medium_Phone_API_36.1" } ]}No devices is not an error: {"devices":[]}, exit 0. Android devices come first in adb’s order, then simulators in simctl’s order, then iPhones in devicectl’s order.
devicesarray- What
adb deviceslists and, on macOS, the iOS simulators that are running and the iPhones connected to the Mac. devices[].idstring- The adb serial, or the simulator's or iPhone's UDID. Pass it to
--device. devices[].platformstring- One of
android,ios. devices[].kindstring- One of
emulator,physical,simulator:simulatorfor iOS simulators,physicalfor iPhones. See below. devices[].statestring- adb's state, unchanged:
device,offline,unauthorized, ... Onlydevicecan be used. See below. devices[].namestring or null- Emulator: the AVD name. Android phone: the model (
ro.product.model). Simulator: the simulator's name. iPhone: the model (iPhone 14 Pro Max). See below. devices[].runnerstring or null- iPhones only: Karagöz's runner (
install-runner) on the phone.runningwhen it answers,installedornot installedfrom the phone's app list,nullfor an iPhone that is not paired or whose app list could not be read. errorsarray- Only when adb, simctl or devicectl is missing, fails or hangs: one entry per failed listing, two
iosentries when simctl and devicectl both fail. The other listings are still printed and the exit is0. errors[].platformstring- One
{"platform","code","message"}per failed listing. errors[].codestring- One
{"platform","code","message"}per failed listing. errors[].messagestring- One
{"platform","code","message"}per failed listing.
kind is emulator when the id is emulator-<port>, or when the device reports ro.boot.qemu or ro.kernel.qemu as 1, or ro.hardware as ranchu or goldfish (an emulator attached with adb connect). Genymotion, and other ids not in state device, read as physical.
For simulators, state is simctl’s state: Booted, Booting, Shutting Down; only Booted is usable. For iPhones, it is devicectl’s pairing state: paired, unpaired (unlock the phone and tap Trust when it asks), pairingInProgress.
name is null for an unpaired iPhone, and for a paired one devicectl is not connected to: right after pairing, or when the connection went idle. Pick it by UDID then. name is also null when the device does not answer, or when it is not in state device and its id is not emulator-<port>.
When every listing tried fails, Android’s error is printed as the usual envelope and the exit is 1.
On Linux and Windows, simulators and iPhones are not looked for.
Errors
Section titled “Errors”devices can return INVALID_ARGS, ADB_NOT_FOUND, ADB_TIMEOUT and ADB_FAILED.
The simctl and devicectl codes come inside errors only: SIMCTL_NOT_FOUND, SIMCTL_TIMEOUT, SIMCTL_FAILED, DEVICECTL_NOT_FOUND, DEVICECTL_TIMEOUT and DEVICECTL_FAILED.
- Not listed:
- shut-down simulators
- watchOS, tvOS and visionOS simulators
- iPhones on iOS 16 and older
- phones paired before but not connected now
- nearby devices that could be paired
- An iPad is listed the way an iPhone is.
- The first call after login can take several seconds while macOS starts the simulator service (30 s limit).
- A phone is missing from the list when adb cannot see it:
- on Windows without the phone maker’s USB driver
- on a Mac laptop where “Allow accessory to connect” was refused
- in fastboot mode
- A device listed as
(no serial number), or two devices that share one serial, cannot be targeted: adb’s-scannot tell them apart. - Karagöz does not pair or connect over Wi-Fi. Use
adb pairandadb connect; a paired Android 11+ phone reconnects by itself. - If an emulator’s name comes back
null, check thatHOMEpoints to your home directory; the emulator console reads a token from there.
MCP equivalent
Section titled “MCP equivalent”No arguments.
Related commands
Section titled “Related commands”- karagoz install-runner
- Install Karagöz's runner on an iPhone; the runner field shows its state.