[Solved] Appium Install Error: Original error: Neither ANDROID_HOME nor ANDROID_SDK_ROOT environment variab

Operating environment.
Appium-windows-1.21.0,手机vivo s7/Android 10
appium startup error: An unknown server-side error occurred while processing the command. Original error: Neither ANDROID_HOME nor ANDROID_SDK_ROOT environment variable was exported. Read https://developer.android.com/studio/command-line/variables for more details
The general idea is that the SDK environment variables are not configured correctly and cannot be read, so you can use manual configuration.

Solution, manually select the android SDK


I thought this would be solved, I did not expect that there are new mishaps
An unknown server-side error occurred while processing the command. Original error: Error executing adbExec. Original error: ‘Command ‘D:\Android\platform-tools\adb.exe -P 5037 -s 2591584f install -g ‘C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk’’ exited with code 1’; Stderr: ‘adb: failed to install C:\Program Files\Appium\resources\app\node_modules\appium\node_modules\io.appium.settings\apks\settings_apk-debug.apk: Failure [INSTALL_FAILED_ABORTED: User rejected permissions]’; Code: ‘1’

Solution: Because the Vivo phone I used did not give permission to open the developer mode to connect to debug after a one-time installation of several appium-related apk, just keep agreeing, you can enter.

Read More: