Appium error

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

How to fix it

  1. Export `ANDROID_HOME` in the same environment that starts the Appium server, then restart the server
  2. Check the folder contains `platform-tools/adb`, and add `platform-tools` to `PATH` as well
  3. In CI, set the variable at the job level (or use an action like `android-actions/setup-android`) so every step sees it
  4. 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