Skip to content

Commit 3209246

Browse files
committed
sets arm64 emulator for aarch64 macs
1 parent 7bc5bc3 commit 3209246

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

mode/src/processing/mode/android/SysImageDownloader.java

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -386,7 +386,8 @@ public void run() {
386386
// Either there was no image architecture selected, or the default was set.
387387
// In this case, we give the user the option to choose between ARM and x86
388388

389-
final int result;
389+
int result = 0;
390+
boolean arm64 = false;
390391
// PROCESSOR_IDENTIFIER is only defined on Windows. For cross-platform CPU
391392
// info, in the future we could use OSHI: https://github.com/oshi/oshi
392393
String procId = System.getenv("PROCESSOR_IDENTIFIER");
@@ -399,14 +400,22 @@ public void run() {
399400
result = JOptionPane.NO_OPTION;
400401
}
401402
} else if (Platform.isMacOS()) {
402-
// Macs only have Intel CPUs, so we also go for the x86 abi
403-
result = JOptionPane.YES_OPTION;
403+
if (Platform.getNativeArch().equals("aarch64")) {
404+
// Apple Silicon Mac, so we go for the arm64 abi
405+
arm64 = true;
406+
result = JOptionPane.NO_OPTION;
407+
} else {
408+
// Intel Mac, so we go for the x86 abi
409+
result = JOptionPane.YES_OPTION;
410+
}
404411
} else {
405412
result = showSysImageMessage();
406413
}
407414
if (result == JOptionPane.YES_OPTION || result == JOptionPane.CLOSED_OPTION) {
408415
abi = "x86";
409416
installHAXM();
417+
} else if (arm64) {
418+
abi = "arm64-v8a";
410419
} else {
411420
abi = "arm";
412421
}

0 commit comments

Comments
 (0)