## TL;DR

The test runner asks adb for a device and gets an empty list. Start an emulator (or plug in a phone with USB debugging on), confirm `adb devices` lists it, then make the device name in your test config match the running device.

## Error

```text
Could not find a connected Android device
```

## Steps

1. Run `adb devices`. Expected: the output lists at least one device or emulator; an empty list confirms the problem.
2. If no emulator is running, start one: `emulator -avd [YOUR_AVD_NAME] -no-snapshot` (list your AVDs with `emulator -list-avds`). Expected: the emulator boots to the home screen.
3. Rerun `adb devices`. Expected: the output shows `emulator-5554 device` (status "device", not "offline").
4. If the status is "unauthorized", accept the RSA prompt on the device screen, or revoke USB authorizations and replug. Expected: the status flips to "device".
5. Match your Detox config's device name to the running AVD, then rerun the test. Expected: the runner finds the device and starts installing the app.

## When to use

- Detox or Appium fails immediately with no device found.
- `adb devices` prints an empty list.
- A CI job has no emulator boot step before the test step.

## When not to use

- A device is listed but the app fails to install; that is a build or signing issue.
- iOS tests fail; that is a different toolchain.
- The device is listed as "offline"; restart adb (see edge cases).

## Tool compatibility

- Detox 19 and 20, Appium 2.x.
- Android SDK platform-tools (adb), Android emulator 32 and newer.

## Variant phrasings

### No connected devices

The short adb-side wording for an empty device list. Same fix: boot an emulator or connect hardware.

### device 'emulator-5554' not found

The config names an emulator that isnt running. Boot that AVD or update the config to the running one.

## Why it happens

Android tooling talks to devices only through the adb server. If no emulator or USB device has registered with it, there is simply nothing to install the app on, and the runner fails before launch.

## Edge cases

- `adb kill-server` followed by `adb start-server` clears stale "offline" entries.
- Two adb versions on PATH (Android Studio's versus the SDK's) fight each other; keep one.
- Headless CI needs the emulator started with `-no-window -no-audio` plus a wait for boot (`adb wait-for-device`) before tests start.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_QYT_vwtNi02nB_1pyrzNfA
