This is an automated email from the ASF dual-hosted git repository.

normanbreau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-android.git


The following commit(s) were added to refs/heads/master by this push:
     new a830145  fix: wait_for_boot waiting forever (#978)
a830145 is described below

commit a830145f36c8bba2ecdf7910f3699116d4c2f018
Author: Norman Breau <nor...@normanbreau.com>
AuthorDate: Fri May 22 15:07:18 2020 -0300

    fix: wait_for_boot waiting forever (#978)
---
 bin/templates/cordova/lib/emulator.js | 4 ++--
 spec/unit/emulator.spec.js            | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/templates/cordova/lib/emulator.js 
b/bin/templates/cordova/lib/emulator.js
index c73e134..928ad44 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 86cb3ed..239e93d 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);
             });


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cordova.apache.org
For additional commands, e-mail: commits-h...@cordova.apache.org

Reply via email to