Skip to content

Commit bbf0887

Browse files
Jeehutychescale9
authored andcommitted
Add support for arm64-v8a for Apple Silicon Macs
Fixes #145
1 parent 84b9418 commit bbf0887

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ A GitHub Action for installing, configuring and running hardware-accelerated And
88

99
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).
1010

11-
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
11+
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
1212
tests directly on the VM.
1313

1414
This action automates the process by doing the following:
@@ -90,7 +90,7 @@ jobs:
9090
|-|-|-|-|
9191
| `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**. |
9292
| `target` | Optional | `default` | Target of the system image - `default`, `google_apis` or `playstore`. |
93-
| `arch` | Optional | `x86` | CPU architecture of the system image - `x86` or `x86_64`. Note that `x86_64` image is only available for API 21+. |
93+
| `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). |
9494
| `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". |
9595
| `cores` | Optional | 2 | Number of cores to use for the emulator (`hw.cpu.ncore` in config.ini). |
9696
| `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`. |

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'Android Emulator Runner'
22
description: 'Installs, configures and starts an Android Emulator directly on macOS virtual machines.'
33
author: 'Reactive Circus'
44
branding:
5-
icon: 'smartphone'
5+
icon: 'smartphone'
66
color: 'green'
77
inputs:
88
api-level:
@@ -12,7 +12,7 @@ inputs:
1212
description: 'target of the system image - default, google_apis or playstore'
1313
default: 'default'
1414
arch:
15-
description: 'CPU architecture of the system image - x86 or x86_64'
15+
description: 'CPU architecture of the system image - x86, x86_64 or arm64-v8a'
1616
default: 'x86'
1717
profile:
1818
description: 'hardware profile used for creating the AVD - e.g. `Nexus 6`'
@@ -30,7 +30,7 @@ inputs:
3030
disable-animations:
3131
description: 'whether to disable animations - true or false'
3232
default: 'true'
33-
disable-spellchecker:
33+
disable-spellchecker:
3434
description: Whether to disable spellchecker - `true` or `false`.
3535
default: 'false'
3636
emulator-build:

lib/input-validator.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
33
exports.checkEmulatorBuild = exports.checkDisableSpellchecker = exports.checkDisableAnimations = exports.checkArch = exports.checkTarget = exports.checkApiLevel = exports.VALID_ARCHS = exports.VALID_TARGETS = exports.MIN_API_LEVEL = void 0;
44
exports.MIN_API_LEVEL = 15;
55
exports.VALID_TARGETS = ['default', 'google_apis', 'google_apis_playstore'];
6-
exports.VALID_ARCHS = ['x86', 'x86_64'];
6+
exports.VALID_ARCHS = ['x86', 'x86_64', 'arm64-v8a'];
77
function checkApiLevel(apiLevel) {
88
if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) {
99
throw new Error(`Unexpected API level: '${apiLevel}'.`);

src/input-validator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
export const MIN_API_LEVEL = 15;
22
export const VALID_TARGETS: Array<string> = ['default', 'google_apis', 'google_apis_playstore'];
3-
export const VALID_ARCHS: Array<string> = ['x86', 'x86_64'];
3+
export const VALID_ARCHS: Array<string> = ['x86', 'x86_64', 'arm64-v8a'];
44

55
export function checkApiLevel(apiLevel: string): void {
66
if (isNaN(Number(apiLevel)) || !Number.isInteger(Number(apiLevel))) {

0 commit comments

Comments
 (0)