Android tools environment variables

Software testing tutorials and automation

A blog on Selenium tutorial, Selenium webdriver tutorial, Selenium IDE tutorial, Appium Tutorial, Selenium Grid Tutorial, Jmeter Tutorial.

Pages

Set ANDROID_HOME and Path Environment Variables For SDK In Windows

Set ANDROID_HOME windows Variable

  • 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.

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.

21 comments:

Thanks for the post its really help full for initial android user

Thank 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.

Please 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.

u have to add JAVA_HOME variable also along with ANDROID_HOME to have proper functionality.

I’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.

You are developing project means you are developer and asking for help regarding deploy from a testing background funny.

I 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!

‘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??

maybe you have spaces in your path, for example if your sdk in Program files folder.
you 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».
use 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

Читайте также:  Бинарный опцион для андроид

thanks for help

By far the most helpful page I have found about setting up all the variables and paths for android 🙂

I 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

The «android» command is depercated
For 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 ?

Источник

Setup Android Environment Variables

This article will provide you with a detailed guide to setup Android Environment variables. This article is a continuation of our previous articles on Android, where you learned how to download and install Android Studio bundle and then how to install additional Android SDK tools.

The main Android environment variables that you would have to set are ANDROID_HOME and Path variables. If you have followed our Appium Tutorial series from the beginning, then you would remember that this article is similar to our previous article where we setup Java environment variables. Let’s now start with the setup process.

Find the folder location where you installed Android SDK

In the first step we will try to find the folder path where we have installed Android SDK –

1. The default folder location where Android SDK is installed is – C:\Users\Anish\AppData\Local\Android\sdk. Please open this folder path and see if you have Android SDK folder in there with contents as shown below

Please note that if you try to open this folder location by going to each folder one by one (i.e. C > Users > YourUserName and so on… ), then you might not see the AppData folder as its a hidden folder. So, you will have to make hidden folders visible first

2. Copy the SDK folder location once you find it. For us, this folder location is – C:\Users\Anish\AppData\Local\Android\sdk

Setup Android Environment Variables – Setup ANDROID_HOME

Follow the steps given below to setup ANDROID_HOME environment variable –

1. Click on Start menu. Then right click on Computer and select Properties option

2. This would open the System Properties window as shown below. Now from the Advanced Tab, click on Environment Variables button

3. From the Environment Variables window, click on New button from System variables section

4. Enter ANDROID_HOME in Variable Name field and SDK folder location (C:\Users\Anish\AppData\Local\Android\sdk) in Variable value field as shown in below image (Please enter the correct folder location that you have in your machine)

5. Click on OK button. ANDROID_HOME variable will now be added to System variables

With this, we have successfully added ANDROID_HOME variable. Let us now see how to add the Path variable.

Folder locations to be added to Path variable

In Android SDK folder, there are three specific folders that you need to add to the Path variable. These folders are –

  • platforms-tools folder which has path – C:\Users\Anish\AppData\Local\Android\sdk\platform-tools
  • tools folder which has path – C:\Users\Anish\AppData\Local\Android\sdk\tools
  • bin folder inside tools folder with path – C:\Users\Anish\AppData\Local\Android\sdk\tools\bin

Since we have already added ANDROID_HOME in System variables and its represented by – C:\Users\Anish\AppData\Local\Android\sdk, hence all these above three folder locations can be written as –

  • %ANDROID_HOME%\platform-tools
  • %ANDROID_HOME%\tools
  • %ANDROID_HOME%\tools\bin

Let us now add all these three folder locations in Path variable.

Setup Path Variable

Follow the steps given below to setup Path variable –

1. In the Environment variables window, check that there is a variable called Path under System variables

2. Select the Path variable and click on Edit button. Path variable window would be opened

3. Move over to the end in the Variable value text field. Put a semicolon (;) at the end and start adding all the 3 folder paths separated by semicolon (Semicolon acts as a delimiter between different folder locations added in the Path variable). You should have added all the 3 folder locations as this – ;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;%ANDROID_HOME%\tools\bin

Читайте также:  Обмен лайков для андроид

4. Click on OK button. All the three variables would now be added to the Path variables.

5. Close the Environment variable window by clicking on Ok button. With this, we have now successfully setup Path variable as well

Verify that Android Environment Variables have been set correctly

To verify that all the Android Environment Variables are correctly setup, open command prompt and run this command: sdkmanager – -list (please note that there should be no space between the 2 hyphens, as shown in the below image). This would list down all the installed and available packages which would look a bit like something as shown below (please wait for 3-5 seconds for the list to be displayed)

You can also run this command: uiautomatorviewer in command prompt. This will open UI Automator Viewer window as displayed below.

You can now close UI Automator Window and the command prompt. Both the above commands verify that the Android Environment Variables have been setup correctly. If you face any issues with any of the steps, or if you get any different output using these commands, then please let us know using the comments section. With this we complete our article series on installing Android and setting up Android environment variables. We will now move over to our next article, which is downloading and installing Appium Desktop client.

Источник

Install Android Development Tools

Before You Begin

This 15-minute tutorial shows you how to install Android Studio, which includes the Android SDK, and create an Android Virtual Device (AVD) on which you install an Oracle JavaScript Extension Toolkit (Oracle JET) hybrid mobile application during a later tutorial. The time to complete doesn’t include processing time as a result of your activities.

Background

The Oracle JET command-line interface invokes the Android SDK that you install with Android Studio to build an Android application package (APK) file from the source files of your hybrid mobile application. This APK file is installed on an AVD to enable you to test the hybrid mobile application.

What Do You Need?

  • A computer that meets the system requirements to install Android Studio. See System requirements at https://developer.android.com/studio/

Install and Set Up Android Studio

Depending on the operating system of your computer, the Android Studio installation wizard prompts you with dialogs where you choose between standard or custom install types. Choose the options recommended by the Android Studio installation wizard as these options include the components that you require to create and install a hybrid mobile application on an AVD. They also include an Android emulator and an emulator accelerator appropriate for your computer, be that Windows, Mac, or Linux.

  1. Go to the Download page for Android Studio on the Android Developer’s website at https://developer.android.com/studio/ and click DOWNLOAD ANDROID STUDIO.
  2. Review and accept the terms and conditions in the Download Android Studio dialog that appears and click DOWNLOAD ANDROID STUDIO FOR PLATFORM where PLATFORM refers to the operating system of your machine, such as Windows, Mac, or Linux.
  3. Go to the Install Android Studio guide at https://developer.android.com/studio/install and follow the instructions for your operating system to install and start Android Studio.
  4. If you run Android Studio behind a firewall or secure network, an Android Studio First Run dialog appears which displays a button (Setup Proxy) that you click to enter the proxy server settings for your environment. This allows Android Studio to complete the download of the components for a standard install.
  5. In the Welcome to Android Studio dialog, select Start a new Android Studio project, and then, in the Create New Project wizard, accept the default options to progress to the final screen in the wizard and click Finish.

This enables the Android Studio toolbar with the options that you need to create an AVD. It also downloads and configures the Gradle build tool that the Android SDK invokes to build the APK file when you complete the creation of your Oracle JET hybrid mobile application.

If you run Android Studio behind a firewall or secure network, a Proxy Settings dialog appears that enables you to configure proxy settings for the Gradle build tool that Android Studio downloads and configures. Provide the proxy settings for your environment to ensure that the Gradle build tool functions correctly.

Install an Android SDK Platform Package

  1. In the Android Studio toolbar, click the SDK Manager icon () to open the Android SDK page in the Default Settings dialog.
  2. In the SDK Platforms tab, select Android 8.0 (Oreo) with an API Level value of 26, and click Apply. Description of the illustration sdkmgrdialog.png
  3. Click OK in the confirmation dialog that appears and accept the license agreement to proceed with the installation.
  4. Once the installation completes, click Finish and then click OK to close the Default Settings dialog.

Create and Start an Android Virtual Device

  1. In the Android Studio toolbar, click the AVD Manager icon ( ) and click Create Virtual Device in the Android Virtual Device Manager dialog that opens.
  2. In the Phone category of the Choose a device definition page of the Virtual Device Configuration dialog, select Nexus 5X and click Next.
  3. In the Recommended tab of the Select a system image page, click Download for the Oreo entry with an API Level of 26. Description of the illustration downloadoreo.png The SDK Quickfix Installation wizard opens.
  4. Accept the license agreement to proceed with the download of the system image for Android 8.0 with API Level 26. Once the installation completes, click Finish and then click Next in the Select a system page.
  5. In the Verify Configuration page, review and accept the default settings such as the AVD Name value of Nexus 5X API 26, then click Finish.
  6. In the Android Virtual Device Manager dialog, click the Launch this AVD in the emulator icon () under the Actions column for the newly-created Nexus 5X API 26 AVD.

The Android emulator starts and loads the Nexus 5X API 26 AVD. A toolbar appears to the right of the AVD that provides UI controls to interact with the AVD.

Description of the illustration sdkmgrdialog.png

Install the Java SE Development Kit 8

  1. Go to the Java SE Development Kit 8 Downloads page at http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html, accept the license agreement, and download the Java SE Development Kit installation file for your platform.
  2. Follow the JDK installation instructions for your platform at https://docs.oracle.com/javase/8/docs/technotes/guides/install/toc.html.

Create Environment Variables

To function correctly, the Apache Cordova command-line interface that the Oracle JET command-line interface communicates with requires that you configure environment variables. These environment variables reference the installation location of the Android SDK that is installed by Android Studio and the Java SE Development Kit 8.

  1. For Windows.
    • Open the Environment Variables dialog from the System Properties dialog by navigating Control Panel >System and Security >System >Advanced System Settings >Environment Variables.
    • Click New in the Environment Variables dialog and set the values of the variables to the location of the JDK and Android SDK locations, as shown in the following image. You can obtain the Android SDK location from the Android SDK page of the Default Settings dialog that you access in Android Studio by clicking Tools >SDK Manager. Description of the illustration envvar.png
  2. For Mac and Linux-type systems, the settings depend upon your default shell. For example, on a Mac system using the Bash shell, add the following lines in

Источник

Читайте также:  Samsung galaxy s10e русификация андроид 11
Оцените статью