karagoz doctor
Reports which adb Karagöz uses, its version, every other adb it could use, and how to install platform-tools when adb is missing or too old.
- Android emulator Done
- Android device Done
- iOS simulator Done
- iOS device Done
karagoz doctorOn macOS it also reports:
- the Xcode the simulator commands use: its folder and version,
simctl,swiftc,devicectland the helper cache, and what to fix - the Apple teams Karagöz’s runner can be signed with, and the runner builds this Mac has
- the
xcodebuild, usbmuxd socket,tarandlogthe iPhone commands need
It changes nothing. No options.
Examples
Section titled “Examples”karagoz doctor{"adb":{"status":"ok","source":"PATH","path":"/opt/homebrew/bin/adb","version":"37.0.0-14910828","candidates":[{"source":"ANDROID_HOME","status":"unset"},{"source":"ANDROID_SDK_ROOT", "status":"unset"},{"source":"PATH", "status":"ok","path":"/opt/homebrew/bin/adb","version":"37.0.0-14910828"},{"source":"default", "status":"ok","path":"/Users/me/Library/Android/sdk/platform-tools/adb","version":"36.0.2-14143358"}]}}exit 0Output
Section titled “Output”{ "adb": { "status": "ok", "source": "PATH", "path": "/opt/homebrew/bin/adb", "version": "37.0.0-14910828", "candidates": [ { "source": "ANDROID_HOME", "status": "unset" }, { "source": "ANDROID_SDK_ROOT", "status": "unset" }, { "source": "PATH", "status": "ok", "path": "/opt/homebrew/bin/adb", "version": "37.0.0-14910828" }, { "source": "default", "status": "ok", "path": "/Users/me/Library/Android/sdk/platform-tools/adb", "version": "36.0.2-14143358" } ] }}The exit code is 0 whenever the report is printed, with adb or Xcode missing or broken as well.
On macOS the line also carries xcode.
adbobject- Which adb Karagöz uses, its version, every other adb it could use, and how to install platform-tools when adb is missing or too old.
adb.statusstringok,outdatedorfailed(see the Status table below): the status of the candidate Karagöz uses.missing: no candidate can be used.adb.sourcestring- Copied from the candidate Karagöz uses, when it has one.
adb.pathstring- Copied from the candidate Karagöz uses, when it has one.
adb.versionstring- Copied from the candidate Karagöz uses, when it has one.
adb.candidatesarray- The four places Karagöz looks, in lookup order (see Requirements).
adb.candidates[].sourcestring- One of
ANDROID_HOME,ANDROID_SDK_ROOT,PATH, ordefaultfor Android Studio's default SDK. adb.candidates[].statusstring- One of
ok,outdated,failed,missingorunset: see the Status table below. adb.candidates[].pathstring- When known: the file Karagöz would run. For
PATH, the path adb prints for itself inadb version, so it is absent when adb printed none. See below. adb.candidates[].versionstring- With
okandoutdated: theVersionline ofadb version, as printed. See below. adb.messagestring- Copied from the candidate Karagöz uses, when it has one.
adb.installstring- Only when
statusis notok: how to install platform-tools on this OS, the same textADB_NOT_FOUNDprints. adb.candidates[].messagestring- With
failedandoutdated: why, cut at 300 characters. xcodeobject- macOS only: the Xcode the iOS commands use, and what the iPhone commands need from this Mac.
xcode.statusstring- One of
ok,outdated,failedormissing: see thexcode.statustable below. xcode.sourcestring- Which rule picked the developer folder, in the commands' order:
DEVELOPER_DIR,xcode-select(/var/db/xcode_select_link), ordefault(/Applications/Xcode.app/Contents/Developer). Absent when none is there. xcode.pathstring- With
source: the developer folder. xcode.versionstring- From that Xcode's
version.plist, when it has one:27.0. xcode.buildstring- From that Xcode's
version.plist, when it has one:27A266a. xcode.messagestring- When
statusis notok: the first entry's message in the ordersimctl,swiftc,devicectl,helper, or foroutdated, which commands need a newer Xcode. xcode.simctlobject- An entry:
status,pathwhen known, andmessagewhen notok. xcode.simctl.statusstring- See the Entry status table below.
xcode.simctl.pathstring- When known: the
simctlfile. xcode.simctl.messagestring- When
statusis notok: why. Withmissing, the text the command itself would fail with. xcode.simctl.versionstring- Unless
simctlismissing: this Mac's CoreSimulator version. xcode.swiftcobject- An entry:
status,pathwhen known, andmessagewhen notok. xcode.swiftc.statusstring- See the Entry status table below.
xcode.swiftc.pathstring- When known: the
swiftcfile. xcode.swiftc.messagestring- When
statusis notok: why. Withmissing, the text the command itself would fail with. xcode.devicectlobject- An entry:
status,pathwhen known, andmessagewhen notok. xcode.devicectl.statusstring- See the Entry status table below.
xcode.devicectl.pathstring- When known: the
devicectlfile. xcode.devicectl.messagestring- When
statusis notok: why. xcode.helperobject- An entry:
status,pathwhen known, andmessagewhen notok. xcode.helper.statusstring- See the Entry status table below.
xcode.helper.pathstring- When known: the helper file.
xcode.helper.messagestring- When
statusis notok: why. xcode.signingobject- The teams
install-runnercan sign with. xcode.signing.statusstringokwithteams,missingwith amessage, orfailedwhen Xcode's preferences could not be read.xcode.signing.teamsarray- With
ok: an array of{id, name, free}(freefor a Personal Team). xcode.signing.teams[].idstring- With
ok: an array of{id, name, free}(freefor a Personal Team). xcode.signing.teams[].namestring- With
ok: an array of{id, name, free}(freefor a Personal Team). xcode.signing.teams[].freeboolean- With
ok: an array of{id, name, free}(freefor a Personal Team). xcode.signing.messagestring- With
missing: no Apple account in Xcode, or an account whose teams Xcode has not saved yet (open a project's Signing & Capabilities tab once, or pass--team). xcode.iosRunnerobject- The runner builds for this Karagöz and Xcode.
xcode.iosRunner.statusstringokwithpathandteams,not built, orfailedwith amessage.xcode.iosRunner.pathstring- With
ok, and withnot builtwhen an Xcode is selected. xcode.iosRunner.teamsarray- With
ok: one build per team. xcode.iosRunner.messagestring- With
failed: the cache folder is not yours, or Karagöz's runner sources are missing. xcode.xcodebuildobject- The
xcodebuildin the developer folder, which builds the runner (install-runner) and starts it (ui-treeand input on an iPhone). An entry likeswiftc. xcode.xcodebuild.statusstring- See the Entry status table below.
xcode.xcodebuild.pathstring- When known: the
xcodebuildfile. xcode.xcodebuild.messagestring- When
statusis notok: why. Withmissing,install-runner's own text. xcode.usbmuxdobject- The socket the runner and iPhone
logsconnect to. Read without connecting. xcode.usbmuxd.statusstring- See the Entry status table below.
xcode.usbmuxd.pathstring- The socket:
/var/run/usbmuxd, orUSBMUXD_SOCKET_ADDRESSin itsUNIX:<path>form. xcode.usbmuxd.messagestring- The commands' text:
cannot reach usbmuxd at <path> (<code>). xcode.tarobject- The
tariPhonelogsruns, found onPATHas the command finds it (noPATH:/usr/bin:/bin). xcode.tar.statusstring- See the Entry status table below.
xcode.tar.pathstring- Not with
missing: thetarfound onPATH. xcode.tar.messagestring- When
statusis notok: why. Withmissing, the command's text:tar not found on PATH. xcode.logobject- The
logiPhonelogsruns, found onPATHas the command finds it (noPATH:/usr/bin:/bin). xcode.log.statusstring- See the Entry status table below.
xcode.log.pathstring- Not with
missing: thelogfound onPATH. xcode.log.messagestring- When
statusis notok: why. Withmissing, the command's text.
| Status | Means |
|---|---|
ok |
adb version exited 0 and reported platform-tools 30.0.0 or newer. |
outdated |
adb version exited 0 and reported a version below 30.0.0. install fails; the other commands still work. Debian 12 ships 29.0.6. |
failed |
Something is there but cannot be used: it did not start, exited non-zero, did not answer within 10 s, or printed no Version line. The message says which. |
missing |
Nothing at that location. For PATH: no adb on PATH, or on macOS and Linux only ones that fail to start with ENOENT (see Notes). |
unset |
No location to check: the variable is unset or empty. For default: Windows without LOCALAPPDATA. |
xcode.status |
Means |
|---|---|
ok |
simctl, swiftc and devicectl are ok, and the helper is ok or not built. signing, iosRunner, xcodebuild, usbmuxd, tar and log do not count: a Mac without iPhones needs none of them. Check their own status. |
outdated |
As ok, with an Xcode below 27. tap, swipe and key return NOT_SUPPORTED on a simulator; the other commands work. |
failed |
simctl, swiftc or devicectl is not ok, or the helper is failed. |
missing |
simctl and swiftc are both missing: no Xcode Karagöz can use, such as the Command Line Tools alone. |
| Entry status | Means |
|---|---|
ok |
simctl, swiftc, devicectl, xcodebuild, tar, log: a file Karagöz can run. usbmuxd: a socket Karagöz can read and write. helper: built, and a file you own. |
missing |
Nothing at path. With no developer folder, swiftc and xcodebuild have no path and say no Xcode is selected. tar and log have no path. |
failed |
There but not runnable: cannot run <path> (EACCES). For tar and log, the first such file on PATH when none after it runs. |
failed |
usbmuxd: not a socket (ENOTSOCK) or not yours to use (EACCES). |
failed |
simctl and devicectl: also when Xcode’s first launch has not finished. The message: the selected Xcode expects CoreSimulator <version>, this Mac has <version>: open Xcode once to finish installing its components (CoreDevice for devicectl). |
failed |
simctl and devicectl with DEVELOPER_DIR set: also when a newer Xcode installed a newer framework, so that Xcode’s own simctl or devicectl would run xcodebuild -runFirstLaunch on every call. The message: the Xcode in DEVELOPER_DIR expects CoreSimulator <version> but this Mac has <version> from a newer Xcode, so its simctl runs xcodebuild -runFirstLaunch on every call: point DEVELOPER_DIR at the newest Xcode, or unset it. |
failed |
helper: the cache folder or binary is not yours or not the right type. Delete ~/Library/Caches/karagoz. |
not built |
helper only: the next ui-tree, tap, swipe, text or key compiles it. |
For PATH, adb.candidates[].path is the symlink as invoked on macOS (/opt/homebrew/bin/adb) and the resolved file on Linux. On Windows it is the adb.exe found on PATH.
adb.candidates[].version, and the adb.version copied from it, keep the builder’s suffix: digits from Google, -debian, -android-tools. Debian’s 8.1.0 package prints its package version, 1:8.1.0+r23-8, and is outdated. 1.0.41 in Android Debug Bridge version 1.0.41 is adb’s protocol number and is not shown.
Errors
Section titled “Errors”doctor fails with INVALID_ARGS for any argument or option ('doctor' does not take the option '--device'), and with INTERNAL.
- What doctor does not show:
- adb server trouble: only
adb versionruns, on every candidate at once, and it never connects to the server. The other commands report it asADB_TIMEOUT. - a stuck simulator service: for Xcode, doctor reads files, and cannot start the simulator service or Xcode’s first launch. A stuck service shows in the
errorsofdevices. - a usbmuxd socket that is there but answers nobody: doctor never runs
xcodebuildand never connects to usbmuxd; only the iPhone commands show it. - paired iPhones:
deviceslists them.
- adb server trouble: only
- A candidate that is there but fails to start with
ENOENT(a script whose interpreter is missing, a broken link) is shownfailed. Karagöz moves on to the next one, as every command does; any other failure stops the lookup at that candidate. - On macOS and Linux, a
PATHcandidate that fails withENOENTis shownmissinginstead:adbruns by name there, and the error does not say which file failed. - An invalid
ANDROID_ADB_SERVER_PORTmakesadb versionitself fail, so everyadbfound isfailedwith adb’s message:adb: $ANDROID_ADB_SERVER_PORT must be a positive number less than 65535: got "abc". - Windows and Linux were not run.
MCP equivalent
Section titled “MCP equivalent”No arguments.
Related commands
Section titled “Related commands”- karagoz install-runner
- Signs the runner with one of the teams that xcode.signing lists.