From 646f98b007ed800dc08fe9622135acf7ba7ff3d5 Mon Sep 17 00:00:00 2001 From: m1ga Date: Fri, 13 Oct 2023 13:56:33 +0200 Subject: [PATCH 1/2] fix: arm mac emulator fix --- lib/emulators/avd.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/lib/emulators/avd.js b/lib/emulators/avd.js index 1876cc2..faf6f19 100644 --- a/lib/emulators/avd.js +++ b/lib/emulators/avd.js @@ -18,6 +18,7 @@ const appc = require('node-appc'), async = require('async'), android = require('../android'), net = require('net'), + os = require('os'), spawn = require('child_process').spawn, EmulatorManager = require('../emulator'); @@ -227,13 +228,17 @@ exports.start = function start(config, emu, opts, callback) { '-port', port, // TCP port that will be used for the console ]; - if (opts.partitionSize !== undefined) { - args.push('-partition-size', opts.partitionSize); // system/data partition size in MBs - } + const cpuCore = os.cpus(); + const isM1 = cpuCore[0].model.includes('Apple'); + if (!isM1) { + if (opts.partitionSize !== undefined) { + args.push('-partition-size', opts.partitionSize); // system/data partition size in MBs + } - var sdcard = opts.sdcard || emu.sdcard; - if (sdcard !== undefined) { - args.push('-sdcard', sdcard); // SD card image (default /sdcard.img + var sdcard = opts.sdcard || emu.sdcard; + if (sdcard !== undefined) { + args.push('-sdcard', sdcard); // SD card image (default /sdcard.img + } } // add any other args From 053701d51616bb296d4db11a381c9bb3cb870d01 Mon Sep 17 00:00:00 2001 From: m1ga Date: Mon, 8 Apr 2024 14:50:50 +0200 Subject: [PATCH 2/2] revert os check --- lib/emulators/avd.js | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/lib/emulators/avd.js b/lib/emulators/avd.js index faf6f19..f37b1cd 100644 --- a/lib/emulators/avd.js +++ b/lib/emulators/avd.js @@ -18,7 +18,6 @@ const appc = require('node-appc'), async = require('async'), android = require('../android'), net = require('net'), - os = require('os'), spawn = require('child_process').spawn, EmulatorManager = require('../emulator'); @@ -228,17 +227,12 @@ exports.start = function start(config, emu, opts, callback) { '-port', port, // TCP port that will be used for the console ]; - const cpuCore = os.cpus(); - const isM1 = cpuCore[0].model.includes('Apple'); - if (!isM1) { - if (opts.partitionSize !== undefined) { - args.push('-partition-size', opts.partitionSize); // system/data partition size in MBs - } + if (opts.partitionSize !== undefined) { + args.push('-partition-size', opts.partitionSize); // system/data partition size in MBs + } - var sdcard = opts.sdcard || emu.sdcard; - if (sdcard !== undefined) { - args.push('-sdcard', sdcard); // SD card image (default /sdcard.img - } + if (opts.sdcard) { + args.push('-sdcard', opts.sdcard); // SD card image (default /sdcard.img) } // add any other args