com.atlassian.ecosystem508fc997-b9e5-4cff-a7b0-92cecde27d7f/0701025f-8cc5-45af-9ba8-51dcdcf20177/static/redirection-by-easy-apps-macrodefaultari:cloud:ecosystem::extension/508fc997-b9e5-4cff-a7b0-92cecde27d7f/0701025f-8cc5-45af-9ba8-51dcdcf20177/static/redirection-by-easy-apps-macroRedirectiontrueRedirectioncom.atlassian.ecosystem508fc997-b9e5-4cff-a7b0-92cecde27d7f/0701025f-8cc5-45af-9ba8-51dcdcf20177/static/redirection-by-easy-apps-macrodefaultari:cloud:ecosystem::extension/508fc997-b9e5-4cff-a7b0-92cecde27d7f/0701025f-8cc5-45af-9ba8-51dcdcf20177/static/redirection-by-easy-apps-macroRedirectiontrueRedirection

You can use an android emulator to help you develop your GDSL tests. It is usefull if you do not have a real device or if you want to test on a device with the same resolution as a device on the Test Bench. Do not use emulator if you want measures, the metrics (energy, data …) are not available.

1. Prerequisite

1.1 Prerequisite to use an android emulator without Greenspector tools

On Windows, turning vulkan off may display a black screen on the emulator.

If it is the case, during the emulator creation, you will have to select “Graphics: Software - GLES 2.0”

1.2. Prerequisite to use an android emulator with Greenspector tools

Useful documentation :

2. Use an android emulator without Greenspector tools

2.1. Create an emulator

If you already have a project open on Android Studio, click on Tools > Device Manager.

Click on “Finish” then on “Next”.

2.2. Emulators tested

Device Name

Screen Size

(inches)

Resolution

RAM

System image

Version Chrome

Computer OS

Samsung Galaxy S9

5,8

1080 x 2220

4 GB

Android 10.0 Google APIs | x86

113

Linux

Samsung Galaxy Tab A7

10,4

2000 x 1200

3 GB

Android 10.0 Google APIs | x86

114

Linux

Samsung Galaxy Tab S7 FE

12,4

2560 x 1600

4 GB

Android 10.0 Google APIs | x86_64

114

Linux

Samsung Galaxy S10

6,1

1080 x 2280

8 GB

Android 11.0 Google APIs | x86

Google Pixel C

10,2

2560 x 1800

3 GB

Android 8.1 Google APIs | x86

  • If your computer is configured in English, you have to write the screen size with a dot (ex: 5.8).

  • Avoid using Android 13.0 system image. It takes for too many resources from your computer.

  • If you want to use a tablet emulator, you can uncheck the portrait mode to use only the landscape mode.

2.3. Add Google Play Store to a custom emulator

In some old versions of Android Studio, you can have a direct download action instead of a warning missing system image. Please download. Then you do not need to do the following actions to download manually the system image.

If you already have a project open on Android Studio, click on Tools > SDK Manager.

2.4. Update Google Play Store and Google Chrome

2.5. Start an emulator from the command line (optional)

# For newer version of Android SDK
export PATH=$HOME/Android/Sdk/emulator:$PATH

# For older version of Android SDK
export PATH=$HOME/Android/Sdk/tools:$PATH
export PATH=$HOME/Library/Android/Sdk/emulator:$PATH

emulator -list-avds
emulator -avd [avd_name]

If an emulator crashes or is too slow, you can try one of the following commands:

emulator -avd [avd_name] -memory 8000

emulator -avd [avd_name] -gpu shiftshader_indirect

To get more logs, you can use the following command:

emulator -avd [avd_name] -logcat-output logcat.txt -debug all -verbose

3. Use an android emulator with Greenspector tools

3.1. Change the job.yml file

job:
  extras:
    config-skipsetupphone: true

To be able to run an application with the applicationStart gdsl function, there are 2 choices :

job:
   url: com.android.chrome

In the second case, it installs the app at the beginning of the test and uninstalls it at the end.

3.2. Change the config.yml file

target:
  connection: usb
  serial: xxxx

The target.serial field corresponds to the emulator id. You can find it by running “adb devices”.

3.3. Run the testrunner

On macOS, you may have the following warning:

"testrunner" cannot be opened because the developer cannot be verified.

To fix that accept the notification by clicking on Allow anyway in the Apple menu / System Settings > Privacy & Security

On macOS with M1 chip, you may need to install Rosetta first:

/usr/sbin/softwareupdate --install-rosetta --agree-to-license