From 0d47f0813d4df6e56472340ff4ea0265bb13bacb Mon Sep 17 00:00:00 2001 From: Brian Dickens Date: Mon, 8 Mar 2021 09:26:48 -0500 Subject: [PATCH 1/9] Avoid Wrapping Script Code In Quotes The exec() command only runs a program with literal argument strings. It does not know how to do things like expanding environment variables, or piping/redirection. Hence the way to get "shell intelligence" is to use exec() to run the `sh` process with the command line string as a parameter. But the method being used to do this was: exec.exec(`sh -c \\"${script}"`) This has problems, because wrapping the script in quotes creates issues when the script itself contains quotes. Escaping the string correctly is a non-trivial problem, which also would create "noise" in the debug output which would add confusion. http://mywiki.wooledge.org/BashFAQ/050 The easiest way to work around this here is to use the array form of exec() to pass exactly two parameters to `sh`. No manipulation of the script string is needed with this approach: exec.exec("sh", ["-c", script]) There are more cases in the project of `sh -c` usage which should also be changed, and likely abstracted (shellExec()?) But this small patch just fixes the most important case for the user-provided script. --- Additionally, this removes the escaped backslash (`\\`) from the start of the executed command. That was presumably to suppress the use of aliases: https://unix.stackexchange.com/questions/524254/why-are-backslashes-included-in-this-shell-script But because this is invoking a non-interactive shell session, aliases would not apply. Hence the extra backslash shouldn't be needed. --- lib/main.js | 6 ++++-- src/main.ts | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/main.js b/lib/main.js index 7f1219a3a..7a7a943de 100644 --- a/lib/main.js +++ b/lib/main.js @@ -123,8 +123,10 @@ function run() { process.chdir(workingDirectory); } for (const script of scripts) { - yield exec.exec(`sh -c \\"${script}"`); - } + // use array form to avoid various quote escaping problems + // caused by exec(`sh -c "${script}"`) + yield exec.exec('sh', ['-c', script]); + } } catch (error) { core.setFailed(error.message); diff --git a/src/main.ts b/src/main.ts index c671dd6cc..de27fecf8 100644 --- a/src/main.ts +++ b/src/main.ts @@ -111,7 +111,9 @@ async function run() { process.chdir(workingDirectory); } for (const script of scripts) { - await exec.exec(`sh -c \\"${script}"`); + // use array form to avoid various quote escaping problems + // caused by exec(`sh -c "${script}"`) + await exec.exec('sh', ['-c', script]); } } catch (error) { core.setFailed(error.message); From 505c899f128af2e3a62738596cb7ccf6c907a387 Mon Sep 17 00:00:00 2001 From: Ayush Shrivastava Date: Wed, 10 Mar 2021 04:39:43 +0530 Subject: [PATCH 2/9] Add kiwix-android to the list of projects Add kiwix-android to the list of projects that use ReactiveCircus-android-emulator-runner --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7273c5a7e..0bcb25a65 100644 --- a/README.md +++ b/README.md @@ -137,6 +137,7 @@ These are some of the open-source projects using (or used) **Android Emulator Ru - [Shopify/android-testify](https://github.com/Shopify/android-testify/blob/master/.github/workflows/sample_build.yml) - [square/leakcanary](https://github.com/square/leakcanary/tree/main/.github/workflows) - [hash-checker/hash-checker](https://github.com/hash-checker/hash-checker/tree/master/.github/workflows) -- [hash-checker/hash-checker-lite](https://github.com/hash-checker/hash-checker-lite/tree/master/.github/workflows) +- [hash-checker/hash-checker-lite](https://github.com/hash-checker/hash-checker-lite/tree/master/.github/workflows)] +- [Kiwix/kiwix-android](https://github.com/kiwix/kiwix-android/blob/develop/.github/workflows) If you are using **Android Emulator Runner** and want your project included in the list, please feel free to create an issue or open a pull request. From f790770d0f208acae164ccd821727275f94eb8e1 Mon Sep 17 00:00:00 2001 From: Dmitry Brant Date: Wed, 17 Mar 2021 21:08:36 -0400 Subject: [PATCH 3/9] Add Wikipedia app to list of projects. --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 0bcb25a65..324b32312 100644 --- a/README.md +++ b/README.md @@ -139,5 +139,6 @@ These are some of the open-source projects using (or used) **Android Emulator Ru - [hash-checker/hash-checker](https://github.com/hash-checker/hash-checker/tree/master/.github/workflows) - [hash-checker/hash-checker-lite](https://github.com/hash-checker/hash-checker-lite/tree/master/.github/workflows)] - [Kiwix/kiwix-android](https://github.com/kiwix/kiwix-android/blob/develop/.github/workflows) +- [wikimedia/apps-android-wikipedia](https://github.com/wikimedia/apps-android-wikipedia/blob/master/.github/workflows) If you are using **Android Emulator Runner** and want your project included in the list, please feel free to create an issue or open a pull request. From cf46dc4c1880558752f643cd2b95c54a88c7d3bd Mon Sep 17 00:00:00 2001 From: Jing Tang Date: Tue, 23 Mar 2021 20:51:43 +0000 Subject: [PATCH 4/9] Add google/android-fhir to the list of projects that use android-emulator-runner (#132) --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 324b32312..7ed114d76 100644 --- a/README.md +++ b/README.md @@ -137,8 +137,10 @@ These are some of the open-source projects using (or used) **Android Emulator Ru - [Shopify/android-testify](https://github.com/Shopify/android-testify/blob/master/.github/workflows/sample_build.yml) - [square/leakcanary](https://github.com/square/leakcanary/tree/main/.github/workflows) - [hash-checker/hash-checker](https://github.com/hash-checker/hash-checker/tree/master/.github/workflows) +- [hash-checker/hash-checker-lite](https://github.com/hash-checker/hash-checker-lite/tree/master/.github/workflows) - [hash-checker/hash-checker-lite](https://github.com/hash-checker/hash-checker-lite/tree/master/.github/workflows)] - [Kiwix/kiwix-android](https://github.com/kiwix/kiwix-android/blob/develop/.github/workflows) - [wikimedia/apps-android-wikipedia](https://github.com/wikimedia/apps-android-wikipedia/blob/master/.github/workflows) +- [google/android-fhir](https://github.com/google/android-fhir/tree/master/.github/workflows) If you are using **Android Emulator Runner** and want your project included in the list, please feel free to create an issue or open a pull request. From 5201a33a9027f6b70dbadbc0e9f57eee3cef6f91 Mon Sep 17 00:00:00 2001 From: Yang Date: Wed, 24 Mar 2021 09:29:59 +1100 Subject: [PATCH 5/9] Update README.md --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 7ed114d76..5147cb830 100644 --- a/README.md +++ b/README.md @@ -138,7 +138,6 @@ These are some of the open-source projects using (or used) **Android Emulator Ru - [square/leakcanary](https://github.com/square/leakcanary/tree/main/.github/workflows) - [hash-checker/hash-checker](https://github.com/hash-checker/hash-checker/tree/master/.github/workflows) - [hash-checker/hash-checker-lite](https://github.com/hash-checker/hash-checker-lite/tree/master/.github/workflows) -- [hash-checker/hash-checker-lite](https://github.com/hash-checker/hash-checker-lite/tree/master/.github/workflows)] - [Kiwix/kiwix-android](https://github.com/kiwix/kiwix-android/blob/develop/.github/workflows) - [wikimedia/apps-android-wikipedia](https://github.com/wikimedia/apps-android-wikipedia/blob/master/.github/workflows) - [google/android-fhir](https://github.com/google/android-fhir/tree/master/.github/workflows) From a732f125bbf012945dde755be9c359a27617ff6a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 31 Mar 2021 05:08:57 +0000 Subject: [PATCH 6/9] Bump y18n from 4.0.0 to 4.0.1 Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/yargs/y18n/releases) - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/yargs/y18n/commits) Signed-off-by: dependabot[bot] --- package-lock.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3c1f63bd4..d2314c4f3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -11309,9 +11309,9 @@ "dev": true }, "y18n": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.1.tgz", + "integrity": "sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ==", "dev": true }, "yallist": { From 84b9418977be0ac08cdb1acad1cfe93eb19842e6 Mon Sep 17 00:00:00 2001 From: Afzal Najam Date: Wed, 24 Feb 2021 12:50:39 -0500 Subject: [PATCH 7/9] Add option to disable spellcheck Add input-validator and tests --- README.md | 1 + __tests__/input-validator.test.ts | 21 +++++++++++++++++++++ action.yml | 3 +++ lib/emulator-manager.js | 5 ++++- lib/input-validator.js | 13 +++++++++++-- lib/main.js | 9 +++++++-- src/emulator-manager.ts | 6 +++++- src/input-validator.ts | 12 +++++++++++- src/main.ts | 10 ++++++++-- 9 files changed, 71 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5147cb830..50f3db78a 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,7 @@ jobs: | `avd-name` | Optional | `test` | Custom AVD name used for creating the Android Virtual Device. | | `emulator-options` | Optional | See below | Command-line options used when launching the emulator (replacing all default options) - e.g. `-no-window -no-snapshot -camera-back emulated`. | | `disable-animations` | Optional | `true` | Whether to disable animations - `true` or `false`. | +| `disable-spellchecker` | Optional | `false` | Whether to disable spellchecker - `true` or `false`. | | `emulator-build` | Optional | N/A | Build number of a specific version of the emulator binary to use e.g. `6061023` for emulator v29.3.0.0. | | `working-directory` | Optional | `./` | A custom working directory - e.g. `./android` if your root Gradle project is under the `./android` sub-directory within your repository. | | `ndk` | Optional | N/A | Version of NDK to install - e.g. `21.0.6113669` | diff --git a/__tests__/input-validator.test.ts b/__tests__/input-validator.test.ts index 8a6e04b97..4da366db5 100644 --- a/__tests__/input-validator.test.ts +++ b/__tests__/input-validator.test.ts @@ -103,6 +103,27 @@ describe('disable-animations validator tests', () => { }); }); +describe('disable-spellchecker validator tests', () => { + it('Throws if disable-spellchecker is not a boolean', () => { + const func = () => { + validator.checkDisableSpellchecker('yes'); + }; + expect(func).toThrowError(`Input for input.disable-spellchecker should be either 'true' or 'false'.`); + }); + + it('Validates successfully if disable-spellchecker is either true or false', () => { + const func1 = () => { + validator.checkDisableSpellchecker('true'); + }; + expect(func1).not.toThrow(); + + const func2 = () => { + validator.checkDisableSpellchecker('false'); + }; + expect(func2).not.toThrow(); + }); +}); + describe('emulator-build validator tests', () => { it('Throws if emulator-build is not a number', () => { const func = () => { diff --git a/action.yml b/action.yml index f67a96d76..c3e3c8929 100644 --- a/action.yml +++ b/action.yml @@ -30,6 +30,9 @@ inputs: disable-animations: description: 'whether to disable animations - true or false' default: 'true' + disable-spellchecker: + description: Whether to disable spellchecker - `true` or `false`. + default: 'false' emulator-build: description: 'build number of a specific version of the emulator binary to use - e.g. `6061023` for emulator v29.3.0.0' working-directory: diff --git a/lib/emulator-manager.js b/lib/emulator-manager.js index 8582df9bb..fe7ee90fd 100644 --- a/lib/emulator-manager.js +++ b/lib/emulator-manager.js @@ -34,7 +34,7 @@ const EMULATOR_BOOT_TIMEOUT_SECONDS = 600; /** * Creates and launches a new AVD instance with the specified configurations. */ -function launchEmulator(apiLevel, target, arch, profile, cores, sdcardPathOrSize, avdName, emulatorOptions, disableAnimations) { +function launchEmulator(apiLevel, target, arch, profile, cores, sdcardPathOrSize, avdName, emulatorOptions, disableAnimations, disableSpellChecker) { return __awaiter(this, void 0, void 0, function* () { // create a new AVD const profileOption = profile.trim() !== '' ? `--device '${profile}'` : ''; @@ -69,6 +69,9 @@ function launchEmulator(apiLevel, target, arch, profile, cores, sdcardPathOrSize yield exec.exec(`adb shell settings put global transition_animation_scale 0.0`); yield exec.exec(`adb shell settings put global animator_duration_scale 0.0`); } + if (disableSpellChecker) { + yield exec.exec(`adb shell settings put secure spell_checker_enabled 0`); + } }); } exports.launchEmulator = launchEmulator; diff --git a/lib/input-validator.js b/lib/input-validator.js index 6622061bf..b4ff8bf3f 100644 --- a/lib/input-validator.js +++ b/lib/input-validator.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.checkEmulatorBuild = exports.checkDisableAnimations = exports.checkArch = exports.checkTarget = exports.checkApiLevel = exports.VALID_ARCHS = exports.VALID_TARGETS = exports.MIN_API_LEVEL = void 0; +exports.checkEmulatorBuild = exports.checkDisableSpellchecker = exports.checkDisableAnimations = exports.checkArch = exports.checkTarget = exports.checkApiLevel = exports.VALID_ARCHS = exports.VALID_TARGETS = exports.MIN_API_LEVEL = void 0; exports.MIN_API_LEVEL = 15; exports.VALID_TARGETS = ['default', 'google_apis', 'google_apis_playstore']; exports.VALID_ARCHS = ['x86', 'x86_64']; @@ -26,14 +26,23 @@ function checkArch(arch) { } exports.checkArch = checkArch; function checkDisableAnimations(disableAnimations) { - if (disableAnimations !== 'true' && disableAnimations !== 'false') { + if (!isValidBoolean(disableAnimations)) { throw new Error(`Input for input.disable-animations should be either 'true' or 'false'.`); } } exports.checkDisableAnimations = checkDisableAnimations; +function checkDisableSpellchecker(disableSpellchecker) { + if (!isValidBoolean(disableSpellchecker)) { + throw new Error(`Input for input.disable-spellchecker should be either 'true' or 'false'.`); + } +} +exports.checkDisableSpellchecker = checkDisableSpellchecker; function checkEmulatorBuild(emulatorBuild) { if (isNaN(Number(emulatorBuild)) || !Number.isInteger(Number(emulatorBuild))) { throw new Error(`Unexpected emulator build: '${emulatorBuild}'.`); } } exports.checkEmulatorBuild = checkEmulatorBuild; +function isValidBoolean(value) { + return value === 'true' || value === 'false'; +} diff --git a/lib/main.js b/lib/main.js index 7a7a943de..6f33a45c0 100644 --- a/lib/main.js +++ b/lib/main.js @@ -80,6 +80,11 @@ function run() { input_validator_1.checkDisableAnimations(disableAnimationsInput); const disableAnimations = disableAnimationsInput === 'true'; console.log(`disable animations: ${disableAnimations}`); + // disable spellchecker + const disableSpellcheckerInput = core.getInput('disable-spellchecker'); + input_validator_1.checkDisableSpellchecker(disableSpellcheckerInput); + const disableSpellchecker = disableSpellcheckerInput === 'true'; + console.log(`disable spellchecker: ${disableSpellchecker}`); // emulator build const emulatorBuildInput = core.getInput('emulator-build'); if (emulatorBuildInput) { @@ -115,7 +120,7 @@ function run() { // install SDK yield sdk_installer_1.installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cmakeVersion); // launch an emulator - yield emulator_manager_1.launchEmulator(apiLevel, target, arch, profile, cores, sdcardPathOrSize, avdName, emulatorOptions, disableAnimations); + yield emulator_manager_1.launchEmulator(apiLevel, target, arch, profile, cores, sdcardPathOrSize, avdName, emulatorOptions, disableAnimations, disableSpellchecker); // execute the custom script try { // move to custom working directory if set @@ -126,7 +131,7 @@ function run() { // use array form to avoid various quote escaping problems // caused by exec(`sh -c "${script}"`) yield exec.exec('sh', ['-c', script]); - } + } } catch (error) { core.setFailed(error.message); diff --git a/src/emulator-manager.ts b/src/emulator-manager.ts index 48c012f7a..c945b9595 100644 --- a/src/emulator-manager.ts +++ b/src/emulator-manager.ts @@ -14,7 +14,8 @@ export async function launchEmulator( sdcardPathOrSize: string, avdName: string, emulatorOptions: string, - disableAnimations: boolean + disableAnimations: boolean, + disableSpellChecker: boolean ): Promise { // create a new AVD const profileOption = profile.trim() !== '' ? `--device '${profile}'` : ''; @@ -57,6 +58,9 @@ export async function launchEmulator( await exec.exec(`adb shell settings put global transition_animation_scale 0.0`); await exec.exec(`adb shell settings put global animator_duration_scale 0.0`); } + if (disableSpellChecker) { + await exec.exec(`adb shell settings put secure spell_checker_enabled 0`); + } } /** diff --git a/src/input-validator.ts b/src/input-validator.ts index e925b0a0a..c419dfed7 100644 --- a/src/input-validator.ts +++ b/src/input-validator.ts @@ -24,13 +24,23 @@ export function checkArch(arch: string): void { } export function checkDisableAnimations(disableAnimations: string): void { - if (disableAnimations !== 'true' && disableAnimations !== 'false') { + if (!isValidBoolean(disableAnimations)) { throw new Error(`Input for input.disable-animations should be either 'true' or 'false'.`); } } +export function checkDisableSpellchecker(disableSpellchecker: string): void { + if (!isValidBoolean(disableSpellchecker)) { + throw new Error(`Input for input.disable-spellchecker should be either 'true' or 'false'.`); + } +} + export function checkEmulatorBuild(emulatorBuild: string): void { if (isNaN(Number(emulatorBuild)) || !Number.isInteger(Number(emulatorBuild))) { throw new Error(`Unexpected emulator build: '${emulatorBuild}'.`); } } + +function isValidBoolean(value: string): boolean { + return value === 'true' || value === 'false'; +} diff --git a/src/main.ts b/src/main.ts index de27fecf8..21e290f94 100644 --- a/src/main.ts +++ b/src/main.ts @@ -1,6 +1,6 @@ import * as core from '@actions/core'; import { installAndroidSdk } from './sdk-installer'; -import { checkApiLevel, checkTarget, checkArch, checkDisableAnimations, checkEmulatorBuild } from './input-validator'; +import { checkApiLevel, checkTarget, checkArch, checkDisableAnimations, checkEmulatorBuild, checkDisableSpellchecker } from './input-validator'; import { launchEmulator, killEmulator } from './emulator-manager'; import * as exec from '@actions/exec'; import { parseScript } from './script-parser'; @@ -61,6 +61,12 @@ async function run() { const disableAnimations = disableAnimationsInput === 'true'; console.log(`disable animations: ${disableAnimations}`); + // disable spellchecker + const disableSpellcheckerInput = core.getInput('disable-spellchecker'); + checkDisableSpellchecker(disableSpellcheckerInput); + const disableSpellchecker = disableSpellcheckerInput === 'true'; + console.log(`disable spellchecker: ${disableSpellchecker}`); + // emulator build const emulatorBuildInput = core.getInput('emulator-build'); if (emulatorBuildInput) { @@ -102,7 +108,7 @@ async function run() { await installAndroidSdk(apiLevel, target, arch, emulatorBuild, ndkVersion, cmakeVersion); // launch an emulator - await launchEmulator(apiLevel, target, arch, profile, cores, sdcardPathOrSize, avdName, emulatorOptions, disableAnimations); + await launchEmulator(apiLevel, target, arch, profile, cores, sdcardPathOrSize, avdName, emulatorOptions, disableAnimations, disableSpellchecker); // execute the custom script try { From bbf0887eb94f24ae23bbc2424618e91a940df70e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cihat=20Gu=CC=88ndu=CC=88z?= Date: Wed, 14 Apr 2021 14:21:02 +0200 Subject: [PATCH 8/9] Add support for arm64-v8a for Apple Silicon Macs Fixes https://github.com/ReactiveCircus/android-emulator-runner/issues/145 --- README.md | 4 ++-- action.yml | 6 +++--- lib/input-validator.js | 2 +- src/input-validator.ts | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 50f3db78a..dcadfa08c 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ A GitHub Action for installing, configuring and running hardware-accelerated And The old ARM-based emulators were slow and are no longer supported by Google. The modern Intel Atom (x86 and x86_64) emulators require hardware acceleration (HAXM on Mac & Windows, QEMU on Linux) from the host to run fast. This presents a challenge on CI as to be able to run hardware accelerated emulators within a docker container, **KVM** must be supported by the host VM which isn't the case for cloud-based CI providers due to infrastructural limits. If you want to learn more about this, here's an article I wrote: [Running Android Instrumented Tests on CI](https://dev.to/ychescale9/running-android-emulators-on-ci-from-bitrise-io-to-github-actions-3j76). -The **macOS** VM provided by **GitHub Actions** has **HAXM** installed so we are able to create a new AVD instance, launch an emulator with hardware acceleration, and run our Android +The **macOS** VM provided by **GitHub Actions** has **HAXM** installed so we are able to create a new AVD instance, launch an emulator with hardware acceleration, and run our Android tests directly on the VM. This action automates the process by doing the following: @@ -90,7 +90,7 @@ jobs: |-|-|-|-| | `api-level` | Required | N/A | API level of the platform system image - e.g. 23 for Android Marshmallow, 29 for Android 10. **Minimum API level supported is 15**. | | `target` | Optional | `default` | Target of the system image - `default`, `google_apis` or `playstore`. | -| `arch` | Optional | `x86` | CPU architecture of the system image - `x86` or `x86_64`. Note that `x86_64` image is only available for API 21+. | +| `arch` | Optional | `x86` | CPU architecture of the system image - `x86`, `x86_64` or `arm64-v8a`. Note that `x86_64` image is only available for API 21+. `arm64-v8a` images require Android 4.2+ and are limited to fewer API levels (e.g. 30). | | `profile` | Optional | N/A | Hardware profile used for creating the AVD - e.g. `Nexus 6`. For a list of all profiles available, run `avdmanager list` and refer to the results under "Available Android Virtual Devices". | | `cores` | Optional | 2 | Number of cores to use for the emulator (`hw.cpu.ncore` in config.ini). | | `sdcard-path-or-size` | Optional | N/A | Path to the SD card image for this AVD or the size of a new SD card image to create for this AVD, in KB or MB, denoted with K or M. - e.g. `path/to/sdcard`, or `1000M`. | diff --git a/action.yml b/action.yml index c3e3c8929..fb8f87b82 100644 --- a/action.yml +++ b/action.yml @@ -2,7 +2,7 @@ name: 'Android Emulator Runner' description: 'Installs, configures and starts an Android Emulator directly on macOS virtual machines.' author: 'Reactive Circus' branding: - icon: 'smartphone' + icon: 'smartphone' color: 'green' inputs: api-level: @@ -12,7 +12,7 @@ inputs: description: 'target of the system image - default, google_apis or playstore' default: 'default' arch: - description: 'CPU architecture of the system image - x86 or x86_64' + description: 'CPU architecture of the system image - x86, x86_64 or arm64-v8a' default: 'x86' profile: description: 'hardware profile used for creating the AVD - e.g. `Nexus 6`' @@ -30,7 +30,7 @@ inputs: disable-animations: description: 'whether to disable animations - true or false' default: 'true' - disable-spellchecker: + disable-spellchecker: description: Whether to disable spellchecker - `true` or `false`. default: 'false' emulator-build: diff --git a/lib/input-validator.js b/lib/input-validator.js index b4ff8bf3f..3c6f9dfd1 100644 --- a/lib/input-validator.js +++ b/lib/input-validator.js @@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true }); exports.checkEmulatorBuild = exports.checkDisableSpellchecker = exports.checkDisableAnimations = exports.checkArch = exports.checkTarget = exports.checkApiLevel = exports.VALID_ARCHS = exports.VALID_TARGETS = exports.MIN_API_LEVEL = void 0; exports.MIN_API_LEVEL = 15; exports.VALID_TARGETS = ['default', 'google_apis', 'google_apis_playstore']; -exports.VALID_ARCHS = ['x86', 'x86_64']; +exports.VALID_ARCHS = ['x86', 'x86_64', 'arm64-v8a']; function checkApiLevel(apiLevel) { if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) { throw new Error(`Unexpected API level: '${apiLevel}'.`); diff --git a/src/input-validator.ts b/src/input-validator.ts index c419dfed7..edf3006c6 100644 --- a/src/input-validator.ts +++ b/src/input-validator.ts @@ -1,6 +1,6 @@ export const MIN_API_LEVEL = 15; export const VALID_TARGETS: Array = ['default', 'google_apis', 'google_apis_playstore']; -export const VALID_ARCHS: Array = ['x86', 'x86_64']; +export const VALID_ARCHS: Array = ['x86', 'x86_64', 'arm64-v8a']; export function checkApiLevel(apiLevel: string): void { if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) { From 751bef68f6a3102e941d62d3785d932f57ca81e7 Mon Sep 17 00:00:00 2001 From: Yang Date: Fri, 7 May 2021 18:31:11 +1000 Subject: [PATCH 9/9] Prepare for release 2.16.0. --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bcc59849e..d62e8c2fc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## v2.16.0 + +* Avoid wrapping script code in quotes - [#134](https://github.com/ReactiveCircus/android-emulator-runner/pull/134) @hostilefork +* Add option to disable spellcheck - [#143](https://github.com/ReactiveCircus/android-emulator-runner/pull/143) @AfzalivE +* Add support for arm64-v8a for Apple Silicon Macs - [#146](https://github.com/ReactiveCircus/android-emulator-runner/pull/146) @Jeehut + ## v2.15.0 * Added support for specifying the number of cores to use for the emulator - [#130](https://github.com/ReactiveCircus/android-emulator-runner/pull/130).