Neither ANDROID_HOME nor ANDROID_SDK_ROOT environment variable was exported
The Appium server process can't find the Android SDK, so it can't run adb or any other Android tool it needs to start a session.
Published
Why this happens
The SDK path is set in your shell profile, but Appium was started from an IDE, a service, or a CI step that doesn't load that profile
The variable points at the wrong folder, or at an SDK install missing `platform-tools`
Appium Desktop or Appium Inspector was launched from the macOS Dock, which doesn't inherit shell environment variables
How to fix it
Export `ANDROID_HOME` in the same environment that starts the Appium server, then restart the server
Check the folder contains `platform-tools/adb`, and add `platform-tools` to `PATH` as well
In CI, set the variable at the job level (or use an action like `android-actions/setup-android`) so every step sees it
Run `appium driver doctor uiautomator2` to confirm the full Android setup
Example
# ~/.zshrc or the CI job's environment
export ANDROID_HOME="$HOME/Library/Android/sdk"
export PATH="$ANDROID_HOME/platform-tools:$ANDROID_HOME/emulator:$PATH"
appium driver doctor uiautomator2