Changes

Jump to: navigation, search

Mobile/Fennec/Android/Testing

103 bytes added, 21:40, 27 July 2018
Running tests on the Android emulator
== Running tests on the Android emulator ==
The "Android 4.3 API15API16+ opt" and "Android 4.3 API15API16+ debug" tests on treeherder run in an Android ARM emulator. "Android 4.2 x86 opt" tests run in an Android x86 emulator. For best results reproducing test failures, try server is recommended: '''Running the same tests on the same emulator on different host hardware may produce different results'''.
Still, if you want to run the emulator locally, using the same Android image used for tests on treeherder, it is now quite simple:
./mach android-emulator--version 4.3
By default, the That 'android-emulator' command will download the Android 4.3 API15API16+ Android image from tooltool, install it, and launch the Android emulator using all the same parameters used for tests on treeherder. (The Android SDK must be installed locally. mach will try to find the emulator binary in your $PATH environment variable, via the $ANDROID_SDK_ROOT environment variable, through your Android build configuration, and finally in the default location used by 'mach bootstrap'.)
To use the Android 4.2 x86 image:
./mach android-emulator --version x86
 
(On Linux, the x86 emulator requires that kvm is installed. The resulting emulator is much faster than the arm emulator.)
The first time you run an emulator with any particular version, it may take several minutes to download and install the image; subsequent runs will be '''much''' faster.
# From the Android Virtual Device (AVD) Manager, click 'Create....'
# Choose a Nexus phone or tablet device configuration. (Nexus 9 for tablets, Nexus 5 for phones is recommended).
# Choose a system image with API level 15 16 or 18. (If you're not sure if you want arm or x86 then you probably want arm). If no suitable image is available, one can be installed with the Android SDK Manager.
# Next, check 'Use Host GPU' if possible. See [http://developer.android.com/tools/devices/emulator.html#acceleration Using Hardware Acceleration].
# Hit Finish and that should be it. If you have setup Firefox for Android to [[Mobile/Fennec/Android/IDEs|run on your IDE]], you should be able to launch the emulator straight from there as well.
To make Robocop (for example) run on ''emulator-5556'':
$ export ANDROID_SERIALmach robocop --deviceSerial=emulator-5556 $ mach robocop # Runs your tests as normal
== Device Managers ==
Confirm
1,753
edits

Navigation menu