0

For my automation scripts, I am trying to programmatically launch Appium and then run the automation codes in the Emulator (already open).

For launching Appium, I am using below code: AppiumDriverLocalService service = AppiumDriverLocalService.buildService(new AppiumServiceBuilder().usingDriverExecutable(new File(nodePath)).withAppiumJS(new File(appiumPath)).withIPAddress("127.0.0.1") .usingPort(4723)); service.start();

Once the Appium is successfully launched with 200 response and the capabilities are loaded, I am facing the error as "Error: Neither ANDROID_HOME nor ANDROID_SDK_ROOT environment variable was exported.

Please help.

preetam
  • 1
  • 3
  • This question is already answered [here](https://stackoverflow.com/questions/65439683/neither-android-home-nor-android-sdk-root-environment-variable-was-exported-wi). You can refer to this solution – Sachin Kumar Jun 07 '22 at 11:36

1 Answers1

0

You need to add following in your IDE's environment variables:

ANDROID_HOME=/Users/"your_user_name"/Library/Android/sdk

Please tailor the above to your own path if it's different.

Bilal
  • 558
  • 8
  • 18