ANDROID_HOME : You must need to set android_home environment variable in order to run appium test. In previous post, We learnt about how to download and install android SDK software and its different packages in windows. In order to use android environment to run appium software automation tests, You must need to set ANDROID_HOME and path environment variables for describing path of android SDK folders to your operating system. Bellow given steps will explain you how to set ANDROID_HOME and Path Environment Variables in windows for android SDK software.
PREREQUISITES : FIRST 3 STEPS of appium automation software tutorial should be completed.
Set ANDROID_HOME windows Variable
After installation of different packages, You need to set android_home environment variable and path environment variables. Follow the steps given bellow to set it.
- Open "Environment Variables" dialog from win start menu -> Right click on My Computer -> Select properties -> Advanced system settings -> Environment Variables button from Advanced tab. You can view detailed steps to open Environment Variables dialog in THIS POST.
- Click on New button under User Variable table. It will open New User Variable dialog.
- Set Variable Name = ANDROID_HOME and Variable value = E:\SDK (Path of SDK folder). Path can be different for you as per your SDK folder location as described in previous post.
- Click on OK button to close New User Variable dialog as shown in bellow image.
Set Path Variables
- Open SDK Folder from E: drive.
- You will find "tools" and "platform-tools" folders inside SDK folder.
- Copy path of both these folders. e.g. E:\SDK\tools and E:\SDK\platform-tools\
- Open "Environment Variables" dialog as described above.
- Locate Path variable line under System Variables table.
- Edit Path variable by clicking on Edit button. It will open Edit System Variables dialog.
- Append "tools" and "platform-tools" folder's full path at the end of line as shown in bellow image. e.g. ;E:\SDK\tools;E:\SDK\platform-tools\;
- Now close all dialog by clicking on OK buttons of all opened dialog as shown in above image.
Verify Android Is Installed And Configured Properly
To check if android is configured properly or not,
That means android is configured properly in your system.
Now android_home environment variable windows and Path Environment Variables are set for android SDK in windows environment. So android environment is configured and ready to use with appium to execute software automation tests. Next post will describe you how to integrate SDK with eclipse using Eclipse ADT Plugin to use android SDK with eclipse.
To check if android is configured properly or not,
- Open command prompt.
- Type command android as shown in bellow image.
- It will open Android SDK Manager dialog as shown in bellow image.
That means android is configured properly in your system.
Now android_home environment variable windows and Path Environment Variables are set for android SDK in windows environment. So android environment is configured and ready to use with appium to execute software automation tests. Next post will describe you how to integrate SDK with eclipse using Eclipse ADT Plugin to use android SDK with eclipse.
Thanks for the post its really help full for initial android user
ReplyDeleteThank you for your help but i have an issue that is i do not find the sdk path in my computer. I want this setup for an ionic app create android platform and generate apk file. I also installed in my computer android studio.
ReplyDeletePlease help me to find the sdk path. I'm getting the error ANDROID_HOME veriable not setup, setup it manually.
u have to add JAVA_HOME variable also along with ANDROID_HOME to have proper functionality.
Deleteu have to add JAVA_HOME variable also along with ANDROID_HOME to have proper functionality.
DeleteI'm getting ANDROID_HOME variable not setup setup it manually to generate a apk from a ionic framework project. i did not find the sdk path in my computer but i also installed android studio in my computer. Please help me.
ReplyDeleteYou are developing project means you are developer and asking for help regarding deploy from a testing background funny.
DeleteI am answering late but hope someone will find it useful :
If you have already installed android studio then you will find your sdk in user appdata hidden folder.
thanks for the help!
ReplyDelete'android' is not recognised as internal or external command,operable program or batch file- message is displayed in command prompt. I had set the path correctly, But don't know what is the problem can you please help me with it??
ReplyDeletemaybe you have spaces in your path, for example if your sdk in Program files folder...
Deleteyou should set the correct path, use such scheme:
Progra~1 = 'Program Files'
Progra~2 = 'Program Files(x86)'
it is for windows x64
maybe you have some spaces in your path, for example your sdk is located in "Program files"...
Deleteuse such scheme:
Progra~1 = 'Program Files'
Progra~2 = 'Program Files(x86)'
it's for windows x64
I have also faced the same error. But once after providing 'SDK path' in the System variables 'Path'. The error is cleared
Deletethanks for help
ReplyDeleteBy far the most helpful page I have found about setting up all the variables and paths for android :)
ReplyDeleteThanks Bro...
ReplyDeleteI run the command prompt I got the sdk manager, but I also got "this system cannot find the specified path", let me know what I have to do solve this issue
ReplyDeleteThank you
ReplyDeleteThe "android" command is depercated
ReplyDeleteFor manual sdk, avd, and project management, please use android studio.
For command-line tools, use tools\bin\sdk manager.bat
And tools\bin\avdmanager.bat
Same issue, What is the solution for this ?
DeleteaquĆ esta la respuesta al problema https://stackoverflow.com/questions/42638589/android-studio-sdk-manager
DeleteIn the latest version of the Android SDK, running "SDK Manager.exe" and/or "AVD Manager.exe" will not open anymore. Even the "Launch Standalone SDK Manager" link in Android Studio, which can be previously found in Android SDK Settings, is now gone.
ReplyDeleteIt is now recommended to perform manual SDK and AVD management inside Android Studio. But for those who do not have an Android Studio or for those who do not like to open Android Studio just to perform SDK management, you can still manage the SDK using the command line tools, "tools/bin/sdkmanager.bat" and "tools/bin/avdmanager.bat".
This information is available when running "tools/android.bat". I think this is true for those who currently have Android SDK tooks v25.3.1 and above.
https://stackoverflow.com/questions/5199811/android-sdk-manager-wont-open
Thank you, I was having difficulty getting ADB interface to work in PowerShell, but your excellent tutorial fixed that for me!
ReplyDelete