Project test suites can load the wrong Appium driver when every install goes into the default user extension directory. APPIUM_HOME points Appium at a separate driver and plugin directory, so a project or CI job can install the extensions it needs without changing another suite.
Appium stores managed drivers and plugins outside the server package. If APPIUM_HOME is unset, Appium uses ~/.appium; when it is set, the extension CLI and Appium server read extension metadata and packages from that directory instead.
Use the same APPIUM_HOME value when installing extensions, listing extensions, and starting the server. Keep project-local homes out of source control because they contain installed npm packages and cache metadata, and recreate or cache them as part of the local or CI setup.
Related: How to install Appium
Related: How to install the Appium Android driver
Related: How to install and enable an Appium plugin
$ mkdir -p .appium-home/android
$ APPIUM_HOME="$PWD/.appium-home/android" appium driver install uiautomator2 - Checking if 'appium-uiautomator2-driver' is compatible - Installing 'uiautomator2' - Validating 'uiautomator2' Driver uiautomator2@7.6.1 successfully installed - automationName: UiAutomator2 - platformNames: ["Android"]
Use the driver or plugin name required by the project. The selected APPIUM_HOME receives the npm package and Appium extension metadata for this install.
$ APPIUM_HOME="$PWD/.appium-home/android" appium driver list --installed - Listing installed drivers (rerun with --verbose for more info) - uiautomator2@7.6.1 [installed (npm)]
$ APPIUM_HOME="$PWD/.appium-home/web" appium driver list --installed - Listing installed drivers (rerun with --verbose for more info)
No driver row below the listing line means Appium is reading a separate home with no installed drivers yet.
$ APPIUM_HOME="$PWD/.appium-home/android" appium --address 0.0.0.0 --port 4723
Starting Appium without this environment variable makes the server fall back to the default ~/.appium directory and can hide drivers installed only in the project home.
Related: How to start the Appium server
.appium-home/