Path variables android studio

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 ?

Источник

How To Set Android SDK Path In Windows And Mac

After you installed android studio, you still need to configure some android SDK environment variables then you can use it easily. This article will tell you how to correctly configure Android SDK environment variables such as ANDROID_HOME, PATH on Windows and macOS.

1. Configure Android SDK Variable In Windows.

1.1 Get Android SDK Install Directory Path.

Before you can configure it, you should first get the android SDK install directory follow below steps.

  1. Open android studio, click File —> Settings menu item in the top men bar.
  2. Expand Appearance & Behavior —>System Settings —>Android SDK menu item on the left side of the popup window. Then you can find the Android SDK Location directory path on the right side ( in this example, the Android SDK location path is C:\Users\Jerry\AppData\Local\Android\Sdk ), remember it.

1.2 Set %ANDROID_HOME% and %Path% System Environment Variable.

  1. Right-click the computer icon in Windows file explorer left side, click Properties menu item in the popup menu list. This will open the windows system configuration window.
  2. Click the Advanced system settings link on left panel, it will popup the System Properties window, click the Environment Variables button to open Environment Variables window.
  3. Click the New… button to add a new system variable, input ANDROID_HOME as the variable name, and input the Android SDK location directory path ( such as C:\Users\Administrator\AppData\Local\Android\Sdk ) as the variable value.
  4. Select variable Path and click Edit button and add ;%ANDROID_HOME%\tools;%ANDROID_HOME%\tools\bin;%ANDROID_HOME%\platform-tools at the end of its value. Please note the ; must be English character otherwise it will not take effect .
  5. Click OK to close the system environment variables settings window, open a dos window, type command adb in it. If you see output like below that means the android SDK path variable has been configured successfully.

2. Configure Android SDK Variable In macOS.

  1. Open Android Studio on macOS, then click Android Studio —> Preferences menu item at the left top toolbar.
  2. Input search keyword sdk in the search box of the popup Preferences dialog window left side.
  3. It will focus on the Android SDK menu item on the left side, and you can get the Android SDK Location directory path value on the right side Android SDK Location text box.
  4. Generally, the Android SDK is installed in the /Users/user-name/Library/Android/sdk folder on macOS.
  5. If you can not find the above folder in macOS finder or terminal, this is because the Library folder is a hidden folder by default, you should make the hidden folder visible by executing the command $ defaults write com. apple . finder AppleShowAllFiles TRUE in a macOS terminal window ( please read article How To Show Hidden Files In Mac OS Finder And Select Hidden Files In Html Upload File Form ).
  6. You can also see the hidden Library folder by opening a macOS Finder window, then click Go —> Go to Folder… menu item, and input

/Library in the popup dialog input text box, then click Go button.

  • This is also another method to show the hidden Library folder, open a macOS Finder window, click Go —> Home menu item. Right-click the home folder, then click the Show View Options menu item in the popup menu list. Check the Show Library Folder checkbox.
  • Use nano to create or edit user bash profile in user home directory.
  • Add ANDROID_HOME and PATH environment variable in user bash profile.
  • Make the added system environment take effect.
  • Now open a terminal and run adb, you should also see something output like in windows.
  • Источник

    How to Set Path Environmental Variable for SDK in Windows?

    In order to run appium automation tests, it is required to set path environmental variables to describe the path of android SDK folders. In addition, you also need to set ANDROID_HOME.

    Set ANDROID_HOME and Path Variables

    Prerequisite: Install different packages as required.

    Step 1. Right-click on ‘My Computer’ and select Properties. Go to Advanced system settings and select ‘Environmental Variables’ option.

    Step 2. Under the User Variable table, click New to open New User Variable dialog.

    Step 3. Put ANDROID_HOME as Variable name and provide the path of the SDK folder next to Variable value.

    Step 4. Click OK to close the dialog box.

    Step 5. Go to the folder where SDK has been installed.

    Step 6. Inside the SDK folder look for ‘tools’ and ‘platform-tools’ folder.

    Step 7. Copy the path for both tools and platform-tools.

    Step 8. Open ‘Environmental Variables’ dialog box.

    Step 9. Go to System Variables table and locate the Path variable.

    Step 10. Edit the path variable from ‘Edit system Variables’ dialog box.

    Step 11. Add the ‘tools’ and platform-tools’ folder’s full path, as shown below.

    Step 12. Close the entire opened dialog box.

    Step 13. This configures the Android. However, to check open the command prompt.

    Step 14. Type the command ‘android’. This will open the Android SDK Manager dialog box, as shown below.

    Step 15. This ensures that the android is configured properly.

    Источник

    How to Set Java SDK Path in Android Studio?

    The Java SDK for Android is a sophisticated suite of tools for managing, monitoring, profiling, and debugging Java code written in Android Studio. But sometimes as software is unpredictable you might be caught in an error that Android Studio stopped compiling projects and says that it can’t locate the 1.7.0_21 folder. Well, this is exactly what is referred to as a missing Java SDK Path.

    How to Fix the Java SDK Path?

    There are several methods that can help you resolve this issue, the ones which have the highest score in fixing this problem are mentioned below:

    Method #1: For Android Studio Version 4.2 and Above

    Navigate to File > Project Structure > SDK Location. Upon navigating there you will find that a tab named “JDK Location”, select that and then you can set the JDK path for the current project on which you’re working.

    Image I. Setting Project SDK location in 4.2 & +

    Method #2: For Android Studio Version Below 4.2

    Chances are that you might be rocking an older version of Android Studio, if yes then

    Navigate to File > Project Structure > [Platform Settings] > SDKs

    You’ll then need to either update your current SDK setup to make use of the new directory or create a new directory and then adjust the settings in your project to make use of the new directory. This will make it applicable to the present project.

    Method #3: Adding a new SDK to Your Android Studio

    Sometimes only updating your SDKs won’t allow you to compile projects just because the SDK has lived its life and requires an update to itself. In that scenario, you’ll need to recreate the configurations from 0.

    1. Navigate to Project Structure > Platform Settings > SDKs and click the “+” button.
    2. Go to your Android SDK folder and select “Choose” on the pop-up.
    3. A new pop-up window will open, asking which SDK and JDK you’d want to use. Select any Android SDK and the JDK 1.7.

    Note: Change your Project SDK to the one you just established under Project Structure > Project Settings > Project. The name of the SDK should now include the new Java version that you installed.

    Method #4: For the Command Line Enthusiasts

    If you want to be a Geek and the above methods are just too much GUI for you, you might want to handle the SDK path using the terminal. In order to achieve that using the command line, follow the below commands in the Android Studio’s Terminal

    and just like that, you’ve achieved the desired result

    Note: the ‘oldjre‘ here refers to your old JRE path

    Method #5: Using the Embedded SDK

    If you are on Android Version 3.2 or older then you’ll be having the option of using the embedded JDK & SDK for your project and that is one of the optimal ways you can fix this issue as Android Studio will handle the management of the services in the Backend!

    Navigate to File > Project Structure > JDK Location and Checkmark the box saying “Use embedded JDK (recommended)”.

    Image II. Checking the Recommended JDK Location

    Method #6: Setting and Viewing SDK using the Studio Project Structure

    If all the above-mentioned ways didn’t work out for you, the best you can do is to get the SDK path of another Android Studio Project and then providing that path to your particular project (as in Method #1)

    Press Ctrl (Command on Mac) + Alt + Shift + S

    Then in the SDK Location tab, you will find your SDK Location, just copy it and paste it in the SDK Location as mentioned in Method #1.

    Источник

    Читайте также:  Гугл спам звонки установить для андроид
    Оцените статью