Appium-desktop: Set ANDROID_HOME from inside app

Created on 1 Apr 2018  路  11Comments  路  Source: appium/appium-desktop

Appium

I have setup the Android_Home Path that can be seen in bashrc file but still it is saying Android_home path is not set

Environment

  • I am running Appium version _<1.7.2>_.

appium-server-logs.txt
##Problem
org.openqa.selenium.SessionNotCreatedException: Unable to create new remote session. desired capabilities = Capabilities [{app=src/main/resources/AndroidAPK/HO-debug-nonprod.apk, appactivity=com.bidgely.mobile.energyfit.hydroottawa.MainActivity, apppackage=com.bidgely.mobile.energyfit.hydroottawa, platformName=Android, udid=330055ad1f81426b, deviceName=330055ad1f81426b}], required capabilities = Capabilities [{}]
Build info: version: '3.0.1', revision: '1969d75', time: '2016-10-18 09:49:13 -0700'
System info: host: 'bidgely-Latitude-E5540', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.10.0-42-generic', java.version: '1.8.0_162'
Driver info: driver.version: AndroidDriver

  • I am on Linux
P1 enhancement

All 11 comments

@stuartbrussell-intuit please help

Multiple people have had issues with this. I'm going to make a new variable that lets you set ANDROID_HOME from within Appium Desktop.

We currently use this library to pick up the environment variables used in the shell so that we can use it in the electron app: https://www.npmjs.com/package/shell-env

@Nikhil1212 Hello, I'm sorry I can't help on this one. I just work on https://github.com/appium/appium-for-mac.

@Nikhil1212 Does ANDROID_HOME show up in your terminal?

echo $ANDROID_HOME
> /path/to/android/sdk

Have you restarted the shell in which the Appium server was running after having set the env variables?
I was facing the same issue when I realized that I simply hadn't restarted the server shell after having set the variables in ~/.bashrc file. I had restarted the shell in which I was running the test script, but forgot the one in which the server was running

Added to latest release 1.6.3... added 'Edit Configurations' button on home screen which opens a UI where you can set ANDROID_HOME

@dpgraham Thanks for your effort to add the new variable ANDROID_HOME and could you tell how to add it in code like capabilities.SetCapability("",""), please?
Currently, I am using 1.72 but I can not find the 'Edit Configurations' button...
Many thanks

It can't be done via caps. You'll need to upgrade desktop versions.

@dpgraham Thank you! Will try soon

After troubleshooting the same issue for a few hours here is what worked for me and should work for you too:

  1. Check if you have already set environment variables ANDROID_HOME and JAVA_HOME i.e. in ~/.bash_profile for Mac
  2. If environment variables are already set in your machine then set ANDROID_HOME and JAVA_HOME from Appium Desktop by clicking on Edit Configurations from Appium Home screen.

I hope it works for you as well. Have fun

@arifkhanaj

  1. If environment variables are already set in your machine then set ANDROID_HOME and JAVA_HOME from Appium Desktop by clicking on Edit Configurations from Appium Home screen.
    I hope it works for you as well. Have fun

-- Thanks a lot! It works for me!

Was this page helpful?
0 / 5 - 0 ratings