Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: arm mac emulator fix #652

Merged
merged 2 commits into from
Apr 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
17 changes: 11 additions & 6 deletions lib/emulators/avd.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');

Expand Down Expand Up @@ -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) {
m1ga marked this conversation as resolved.
Show resolved Hide resolved
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 <system>/sdcard.img
var sdcard = opts.sdcard || emu.sdcard;
if (sdcard !== undefined) {
args.push('-sdcard', sdcard); // SD card image (default <system>/sdcard.img
}
}

// add any other args
Expand Down