02 - Android Studio tools - Windows - Android

 

update 29 aug 2024

 

Android Studio provides several tools needed in Greenspector Studio, as:

 

Installation

Download the last version on Android website:

  • Choose Download Android Studio [Version]

Image1.png
Android Studio - Download page
  • Scroll below and check I have read and agree with the above terms and conditions

Image2.png
Android Studio - Windows download page
  • Click on Download Android Studio [...] for Windows

The downloaded file has the format android-studio-[version_date]-windows.exe.

  • Install Android Studio with default settings and launch it

  • Keep Do not import settings selected and press ok

We will now install only useful components. On the welcome wizard:

  • Click on Next and select Custom setup

  • Confirm and accept all licences agreements

  • Uncheck the following components:

    • Performance (Intel HAXM)

    • Performance (Android Emulator hypervisor driver)

    • Android Virtual Device

  • Continue the installation

You should arrive on the welcome page. New components are now downloaded and installed. We need an extra item for UIAutomatorViewer:

  • Select More actions and SDK Manager

  • Choose SDK Tools and uncheck Hide Obsolete Packages

  • Search for Android SDK Tools (Obsolete) 26.1.1 and confirm installation

 

Environment variables

Android Studio is now installed on computer. However, it’s not known by OS as environment variables: tools are launchable only in their installation folder, which isn’t practical for Greenspector Studio uses.

  • In Start Menu, launch Run (hotkey Windows+R) and type %LocalAppData%

  • Browse in Android and Sdk folder

We will now verify if we have every tools we need:

  • Check for presence of aapt in folder build-tools/35.0.0

  • Check for presence of adb in folder platform-tools

  • Check for presence of uiautomatorviewer in folder tools/bin

Please note build-tools version number for a further step.

These tools are now installed, but they are not yet ready to be executed everywhere in the system. We will add their location to the PATH to indicate to our system where they are.

  • In Start Menu, launch Run again (hotkey Windows+R) and type SystemPropertiesAdvanced

  • Select Environment Variables...

  • In section User variables for [USER], add variables with New...

Please do not edit System variables

Variable name:

Variable value:

Variable name:

Variable value:

ANDROID_HOME

%LocalAppData%\Android\Sdk

JAVA_HOME

C:\Program Files\Android\Android Studio\jbr

  • Still in section User variables for [USER], select line Path and click on Edit...

  • With New, add the following lines, one by one

%ANDROID_HOME%\build-tools\35.0.0 %ANDROID_HOME%\platform-tools %JAVA_HOME%\bin

Please report the version number previously noted for build-tools.

Verification

Once environments variables are set, new tools can be tested from everywhere:

  • Open a new terminal, in Start Menu with command prompt or in Run (Windows+R) with cmd

 

  • Test adb with the following command:

adb --version

You should see the following result:

  • Test aapt with the following command:

aapt v

You should see the following result:

 

UIAutomatorViewer

Check your java version with the following command:

 

Method 1: Launch UIAutomatorViewer without installing Java 1.8

Use the following command to launch UIAutomatorViewer:

 

Method 2: Launch UIAutomatorViewer with Java 1.8

  • Install Java 1.8 by getting it on the Oracle website. You need to create an account.

  • Launch UIAutomatorViewer with the following command:

 

The following program appears: