Requirements
What each target needs, and where Karagöz looks for adb and Xcode.
All targets
Section titled “All targets”- Node 22 or newer.
- Every command runs on all four targets, except
install-runneranduninstall-runner, which run only on iPhones. - Windows and Linux have not been run.
Android emulator and phone
Section titled “Android emulator and phone”adbfrom Android platform-tools. Karagöz does not bundle it; Lookup and files lists where it looks.- For
install: platform-tools 30.0.0 or newer. - A running emulator (
emulator -avd <name>), or a phone with USB debugging on, in statedevice. - For
ui-treeandtap --text/--id: the screen on, and no other UiAutomation client connected (Appium, Maestro,uiautomator events). - For input to reach apps: the screen unlocked.
iOS simulator (macOS)
Section titled “iOS simulator (macOS)”- Xcode, opened once. The Command Line Tools alone have no
simctl, and noswiftcfor the helper. - A booted simulator (on Xcode 27,
xcrun simctl boot <name>; on older ones,open -a Simulator). - For
tap,swipeandkey: Xcode 27 or newer. Older ones returnNOT_SUPPORTED. - For
text: with Xcode 27 or newer, a simulator on iOS 27 or newer; an older one returnsNOT_SUPPORTED. No UI test running on the same simulator.
iPhone (macOS)
Section titled “iPhone (macOS)”- An iPhone connected to the Mac, and Xcode 15 or newer. The Command Line Tools alone have no
devicectl. - For
screenshot: Xcode 27 or newer, opened once. - For
screenshot,install,launch,terminateanduninstall: paired with the Mac, and Developer Mode on (Settings > Privacy & Security > Developer Mode). - For
logs: paired, and connected by USB cable. - For
ui-tree,tap,swipe,textandkey: paired, Developer Mode on, connected by USB cable, Settings > Developer > Enable UI Automation on, and Karagöz’s runner installed withinstall-runner. - For
install-runner: an Apple ID signed in to Xcode > Settings > Accounts whose team Xcode has saved, or--team. Its Before you start covers saving the team and free accounts.
Check your setup
Section titled “Check your setup”karagoz doctor shows which adb Karagöz uses and why. On macOS it also shows the Xcode the simulator commands use, and what to fix.
Lookup and files
Section titled “Lookup and files”Karagöz looks for adb on every run, in this order:
$ANDROID_HOME/platform-tools/adb$ANDROID_SDK_ROOT/platform-tools/adbadbonPATH- Android Studio’s default SDK:
~/Library/Android/sdkon macOS,~/Android/Sdkon Linux,%LOCALAPPDATA%\Android\Sdkon Windows
- An empty variable is skipped.
- The first
adbthat starts is used for the rest of the run, so a brokenadbunderANDROID_HOMEdoes not fall back toPATH. - An
adbthat fails to start withENOENT(a missing interpreter or a broken link) counts as not there, and the next one is tried.
When none is found:
{ "error": { "code": "ADB_NOT_FOUND", "message": "adb not found (tried ..., PATH). Install platform-tools (brew install --cask android-platform-tools, or download https://developer.android.com/tools/releases/platform-tools and add it to PATH) or set ANDROID_HOME to your Android SDK." }}simctl and devicectl
Section titled “simctl and devicectl”Karagöz runs CoreSimulator’s own simctl (/Library/Developer/PrivateFrameworks/CoreSimulator.framework/Versions/A/Resources/bin/simctl) and CoreDevice’s own devicectl (/Library/Developer/PrivateFrameworks/CoreDevice.framework/Versions/A/Resources/bin/devicectl). When DEVELOPER_DIR is set, it runs $DEVELOPER_DIR/usr/bin/simctl and $DEVELOPER_DIR/usr/bin/devicectl instead.
Cache folder
Section titled “Cache folder”The first ui-tree, tap, swipe, text or key on a simulator compiles a small helper into ~/Library/Caches/karagoz/. It uses the selected Xcode’s swiftc: DEVELOPER_DIR, else the xcode-select one, else /Applications/Xcode.app. That takes a few seconds and happens again after an Xcode update. The helper’s folder is safe to delete.
The runner/ folder next to it holds Karagöz’s iPhone runner. After deleting it, run install-runner again.