Confirmed users
1,759
edits
Line 286: | Line 286: | ||
== Running tests on the Android emulator == | == Running tests on the Android emulator == | ||
The "Android 4.3 API16+ opt" and "Android 4.3 API16+ debug" tests on treeherder run in an Android ARM emulator. "Android | The "Android 4.3 API16+ opt" and "Android 4.3 API16+ debug" tests on treeherder run in an Android ARM emulator. "Android 7.0 x86_64 opt/debug" 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 simple: | Still, if you want to run the emulator locally, using the same Android image used for tests on treeherder, it is simple: | ||
Line 294: | Line 294: | ||
That 'android-emulator' command will download the Android 4.3 API16+ 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'.) | That 'android-emulator' command will download the Android 4.3 API16+ 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 | To use the Android 7.0 x86_64 image: | ||
./mach android-emulator --version x86 | ./mach android-emulator --version x86-7.0 | ||
(On Linux, the x86 emulator requires that kvm is installed. The resulting emulator is much faster than the arm emulator.) | (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. | 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. | ||
Line 312: | Line 312: | ||
./mach android-emulator && ./mach install && ./mach mochitest | ./mach android-emulator && ./mach install && ./mach mochitest | ||
For | For your convenience, most mach test commands check that an Android device is connected; if not, they suggest running an emulator. Similarly, if tests are requested on a device that doesn't have Firefox installed, mach will offer to install it. So if you just run "mach mochitest" without a phone connected and without an emulator running, you might get: | ||
$ ./mach mochitest testing/mochitest/tests/Harness_sanity | $ ./mach mochitest testing/mochitest/tests/Harness_sanity | ||
Line 330: | Line 330: | ||
0:01.82 TEST_START: MainThread testing/mochitest/tests/Harness_sanity/test_SpecialPowersPushPermissions.html | 0:01.82 TEST_START: MainThread testing/mochitest/tests/Harness_sanity/test_SpecialPowersPushPermissions.html | ||
... | ... | ||
=== Multiple emulators/devices === | === Multiple emulators/devices === | ||
It | It is possible to test with multiple emulators or devices using the --deviceSerial argument: | ||
$ adb devices | $ adb devices | ||
List of devices attached | List of devices attached |