Android sdk java environment variable

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

Источник

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.
  • Источник

    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 ?

    Источник

    Читайте также:  Car wash для андроид
    Оцените статью