diff --git a/bin/templates/cordova/lib/emulator.js b/bin/templates/cordova/lib/emulator.js index c73e134c..928ad44d 100644 --- a/bin/templates/cordova/lib/emulator.js +++ b/bin/templates/cordova/lib/emulator.js @@ -352,8 +352,8 @@ module.exports.wait_for_emulator = function (port) { */ module.exports.wait_for_boot = function (emulator_id, time_remaining) { var self = this; - return Adb.shell(emulator_id, 'ps').then(function (output) { - if (output.match(/android\.process\.acore/)) { + return Adb.shell(emulator_id, 'getprop sys.boot_completed').then(function (output) { + if (output.match(/1/)) { return true; } else if (time_remaining === 0) { return false; diff --git a/spec/unit/emulator.spec.js b/spec/unit/emulator.spec.js index 86cb3ed6..239e93de 100644 --- a/spec/unit/emulator.spec.js +++ b/spec/unit/emulator.spec.js @@ -452,7 +452,7 @@ describe('emulator', () => { it('should resolve with true if the system has booted', () => { AdbSpy.shell.and.callFake((emuId, shellArgs) => { expect(emuId).toBe(emulatorId); - expect(shellArgs).toContain('ps'); + expect(shellArgs).toContain('getprop sys.boot_completed'); return Promise.resolve(psOutput); });