Follow

AMP for Android Installation Guide - Android Studio

Install Java and Android Studio 

  • Download Java SE Development Kit 7u45 Installer for your operating system
  • Download Android Studio 1.5 and SDK bundle for Windows or the one for Mac
  • Now run the Java SE Development Kit 7u45 Installer and accept all the default values the installer offers 
  • Next run the Android Studio installer and accept all the default values the installer offers
  • To ensure that all the functionality in the JDK and the Android SDK are available to AMP for Mobile Testing we need to make some "system updates"

  • On Windows the "Path" Environment Variable needs to be modified <
    1. Got to the System screen of the Control Panel (Control Panel\System and Security\System)
    2. In the left nav of the ensuing dialog choose: "Advanced system settings"
    3. In the resulting "System Properties" dialog activate the "Environment Variables..." button
    4. In the "System variables" chooser of the scroll down, select the "Path" variable, and press "Edit"
    5. Copy the "Variable value" into your favorite editor
    6. Add the following to the end of the value  making sure to substitute YOUR_USER_NAME with the name you use to login to Windows and BUILD_TOOLS_VERSION should be the latest version installed on your computer
;C:\Program Files\Java\jdk1.7.0_45\bin;C:\Users\[YOUR_USER_NAME]\AppData\Local\Android\sdk\platform-tools;C:\Users\[YOUR_USER_NAME]\AppData\Local\Android\sdk\build-tools\[BUILD_TOOLS_VERSION]


  • On 64-bit Linux, you may need to install the libstdc++-4.4.7-4.e16.i686 and zlib- 1.2.3-29.el6.i686 packages and add a symbolic link (libGL.so) to the Android SDK tool. In the following is the absolute path the the libGL installation adn is the absolute path of the Android SDK installation
ln -s <PATH_TO_libGL> <PATH_TO_ANDROID_SDK>/tools/lib/libGL.so

  • Now just close out of Android Studio once the Installation is complete
  • Occasionally on Windows machines that had a previous version of Android Studio installed the following Error is shown in the console of the installer. When the error is shown the installation will continue but at the end it will say: Failed to install: android-23 and offered a Retry button. If this occurs: 
    1. Deleted the folder: C:\Users\[YOUR_USER_NAME]\AppData\Local\Android\sdk\platforms\android-23
    2. Activated the Retry button and the installation finished successfully
  • DO NOT CANCEL if you see this error. Once the installation is complete you will be prompted to "Retry". Activate "Retry" and the installation will complete successfully.

Install the Android OS Accessibility Test Enabler Bundle 

      • Log into your AMP instance
        • ex. https://[ACME].ssbbartgroup.com
      • Activate the Toolbox tab
      • Scroll down to the AMP for Android OS section
      • Select the Android OS Accessibility Test Enabler Bundle - Android Studio to start the download
      • Once the zip file has been downloaded open Android Studio and on Windows select File -> Settings -> Plugins. On a Mac select Android Studio -> Preferences -> Plugins
      • Select the "Install plugin from disk..." button
      • Navigate to the location where Android OS Accessibility Test Enabler Bundle was downloaded to and select it
      • That's it! You are ready to run Accessibility Testing from Android Studio

Install the SSB Sample App 

      • Download the SSB Android Studio Sample App at the bottom of this page.
      • Extract the SSBAndroidStudioExampleApp.zip
      • Start Android Studio and from the Welcome to Android Studio window choose "Open an existing Android Studio project" 
      • In the Chooser window that opens navigate to where you extracted the SSBAndroidStudioExampleApp.zip and choose the SSBAndroidStudioExampleApp folder
      • In the AS toolbar activate Run -> Run Android Accessibility Test
      • Choose the 'app' module in the Choose Module for Accessibility Test dialog
        • You may see a "No Devices Running" dialog that tells you that there are no compatible devices or emulators. Do not be alarmed and select "OK"
        • This just means for some reason your Android Studio needs you to launch an emulator in advance of running the Accessibility Test. To do this follow these steps:
          1. From the AS toolbar activate Tools -> Android -> AVD Manager
          2. A "Your Virtual Devices" window will open
          3. Launch a Virtual Device by pressing the green arrow in the Actions column
          4. You will see a "Starting AVD" dialog appear with a progress bar
          5. Then you should see a window that has an Android emulators in it
          6. Be patient and wait for the white word "android" to disappear and the home screen to open.
          7. Congratulations! You have launched the emulator that Android Studio needs to be running to perform Accessibility Tests
          8. Once you have the emulator running n the AS toolbar activate Run -> Run Android Accessibility Test and choose the 'app' module as described above
      • You will see the Accessibility Test Enablement pop up with a progress bar. This will run for a minute or two while success alert appear to the right letting you know things are working.
      • Then a "Choose Device" dialog will appear 
      • Select the device/emulator that you just launched and select "OK"
      • The Sample App is being installed and launched on your emulator
      • When you see the table of contents in the sample app a module has already been sent to AMP instance you installed your bundle from

What Could Go Wrong?

Sometimes the configuration of the JDK, the SDK and the Mobile Test Enabler just aren't quite right. Some of the configuration issues that have come up are:

El Capitan - You are unable to create the symlinks

The 'El Capitan' version of Mac OS uses a System Integrity Protection feature. If you don't have 'write' privileges in the directories where the symlinks are created, you can resolve the issue by following the steps found in the 'Turning Off Rootless System Integrity Protection in OS X El Capitan 10.11 +' section here:

http://osxdaily.com/2015/10/05/disable-rootless-system-integrity-protection-mac-os-x/

Once this is carried out, you can re-enable the system integration protection by following the same steps to navigate to 'Utilities'>'Terminal' when rebooting and type the following in the terminal:

csrutil enable; reboot



This will re-enable the protection, you no longer needing it disabled because the symlinks have been created.

The Android SDK build-tools zipalign command is not found.

This error looks like:

Screen shot of error message that reads: Android Accessibility! Exception in aligning apk. Could not exec: [zipalign, 4

If you are on a Mac this means that <PATH_TO_ANDROID_SDK>/build-tools/<VERSION>/zipalign symlink that was created in /usr/bin/ is not pointing to a file. Check the full path <PATH_TO_ANDROID_SDK>/build-tools/<VERSION>/zipalign and make any necessary corrections to ensure you are symlinking to the zipalign file.

If you are on Windows then this means when you set the following value: 

C:\Users\[YOUR_USER_NAME]\AppData\Local\Android\sdk\build-tools\[BUILD_TOOLS_VERSION]

on your Path environment variable in the "Install Java and Android Studio" section of this doc that it is not pointing to a valid build tools version. This sometimes happen if you have reinstalled the Android Studio or SDK. When you reinstall Windows adds the new SDK at

C:\Users\[YOUR_USER_NAME]\AppData\Local\Android\sdk1

Notice the numeral 1 at the end of sdk. There are now multiple sdk folders in the AppData\Local\Android folder. Navigate to that folder to verify. If you navigate into the sdk1 folder you should see that zipalign is in there. You will have to update the values on your Path environment variable to point to sdk1 or whichever folder in AppData\Local\Android that has the build-tools folder. For example if you have an idk folder that has no build tools and an sdk1 folder that does the Path should be updated to include:

C:\Users\[YOUR_USER_NAME]\AppData\Local\Android\sdk1\platform-tools;C:\Users\[YOUR_USER_NAME]\AppData\Local\Android\sdk1\build-tools\[BUILD_TOOLS_VERSION]

The Java JDK jarsigner command is not found.

This error looks like:

Screen shot of error message that reads: Android Accessiblity! Exception: brut.common.BrutException: could not exec: [jarsigner, -keystore,

This has only come up on windows and has to do with the value on the Path environment variable that points to the JDK's bin folder:

C:\Program Files\Java\jdk[YOUR_JAVA_VERSION_NUMBER]\bin;

Ensure that there are no spaces between the previous or next value. This is incorrect:

C\Some Folder\AnotherFolder; C:\Program Files\Java\jdk[YOUR_JAVA_VERSION_NUMBER]\bin;

This is correct:

C\Some Folder\AnotherFolder;C:\Program Files\Java\jdk[YOUR_JAVA_VERSION_NUMBER]\bin;

Notice that there is NO space between the ; and the C:\ in the correct version!

 

 

Intel VT-x is Not Enabled

You could run into the error "Cannot launch AVD in emulator.
Output:
emulator: ERROR: x86 emulation currently requires hardware acceleration!
Please ensure Intel HAXM is properly installed and usable.
CPU acceleration status: HAX kernel module is not installed!"

This means that you need to do one or both of:

a. Download Intel HAXM

b. Enable Intel VT-x on your Computer

 

Below are instructions for Installing Intel HAXM on Windows:

  1. Go to http://software.intel.com/en-us/android.
  2. Choose the Intel HAXM installer package for your platform.
  3. Extract the installer and follow installation instructions for your platform.

Downloading through Android* SDK Manager

  1. Start the Android* SDK Manager.
  2. Under Extras, check the box next to "Intel x86 Emulator Accelerator (HAXM)."
    Android SDK Manager
  3. Select the "Install package…" button.
  4. Review the Intel Corporation license agreement. If you accept the terms, select Accept and select 'Install'.
  5. The SDK Manager will download the installer to the "extras" directory, under the main SDK directory. Even though the SDK manager says "Installed" it actually means that the Intel HAXM executable was downloaded. You will still need to run the installer from the "extras" directory to get it installed.
  6. Run the installer inside the <sdk folder>/sdk/extras/intel/Hardware_Accelerated_Execution_Manager/ directory and follow the installation instructions for your platform.

Instructions for Enabling Intel VT-x on Windows can be found here:

  1. Power on the machine and open the BIOS (as per Step 1).
  2. Open the Processor submenu The processor settings menu may be hidden in the Chipset, Advanced CPU Configuration or Northbridge.
  3. Enable Intel Virtualization Technology (also known as Intel VT) or AMD-V depending on the brand of the processor. The virtualization extensions may be labeled Virtualization Extensions, Vanderpool or various other names depending on the OEM and system BIOS.
  4. Enable Intel VTd or AMD IOMMU, if the options are available.
  5. Select 'Save & Exit'.

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Level Access Support
www.levelaccess.com | 800.889.9659
© 2005 - 2018 - Level Access All rights reserved.
Privacy | Security | Credits | License