mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 12:03:28 +08:00
CB-11163 Android Builds are failing in CI
CB-11133 Handle android emulator start failure (reverted from commit abcaee24f9
)
This commit is contained in:
parent
8b96081579
commit
914e2fa35f
23
bin/templates/cordova/lib/emulator.js
vendored
23
bin/templates/cordova/lib/emulator.js
vendored
@ -182,26 +182,9 @@ module.exports.start = function(emulator_ID, boot_timeout) {
|
|||||||
var uuidProp = 'emu.uuid=' + uuid;
|
var uuidProp = 'emu.uuid=' + uuid;
|
||||||
var args = ['-avd', emulatorId, '-prop', uuidProp];
|
var args = ['-avd', emulatorId, '-prop', uuidProp];
|
||||||
// Don't wait for it to finish, since the emulator will probably keep running for a long time.
|
// Don't wait for it to finish, since the emulator will probably keep running for a long time.
|
||||||
var emulatorProcess = child_process
|
child_process
|
||||||
.spawn('emulator', args, { detached: true });
|
.spawn('emulator', args, { stdio: 'inherit', detached: true })
|
||||||
|
.unref();
|
||||||
emulatorProcess.stderr.on('data', function (data) {
|
|
||||||
throw new CordovaError(data);
|
|
||||||
});
|
|
||||||
|
|
||||||
emulatorProcess.stdout.on('data', function (data) {
|
|
||||||
if (/ERROR/.test(data)) {
|
|
||||||
throw new CordovaError(data);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
emulatorProcess.on('exit', function(code) {
|
|
||||||
if (code !== 0) {
|
|
||||||
throw new CordovaError('Emulator process exited with code: ' + code);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
emulatorProcess.unref();
|
|
||||||
|
|
||||||
// wait for emulator to start
|
// wait for emulator to start
|
||||||
events.emit('log', 'Waiting for emulator...');
|
events.emit('log', 'Waiting for emulator...');
|
||||||
|
Loading…
Reference in New Issue
Block a user