You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by sh...@apache.org on 2019/01/09 06:20:09 UTC

[cordova-ios] branch master updated: cordova run --list --device fails for Virtualhere devices (fixes #458) (#461)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new dc03987  cordova run --list --device fails for Virtualhere devices (fixes #458) (#461)
dc03987 is described below

commit dc0398771feb6b2dbabda6f95f793816db87a1a3
Author: Mario Theodoridis <44...@users.noreply.github.com>
AuthorDate: Wed Jan 9 07:20:04 2019 +0100

    cordova run --list --device fails for Virtualhere devices (fixes #458) (#461)
    
    * fix issue #458
    * fix list-device tests
---
 bin/templates/scripts/cordova/lib/list-devices | 6 +++---
 tests/spec/unit/lib/list-devices.spec.js       | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/bin/templates/scripts/cordova/lib/list-devices b/bin/templates/scripts/cordova/lib/list-devices
index 047d595..528934a 100755
--- a/bin/templates/scripts/cordova/lib/list-devices
+++ b/bin/templates/scripts/cordova/lib/list-devices
@@ -29,9 +29,9 @@ var Q = require('q'),
  */
 function listDevices() {
     var commands = [
-        Q.nfcall(exec, 'system_profiler SPUSBDataType | sed -n -e \'/iPad/,/Serial/p\' | grep "Serial Number:" | awk -F ": " \'{print $2 " iPad"}\''),
-        Q.nfcall(exec, 'system_profiler SPUSBDataType | sed -n -e \'/iPhone/,/Serial/p\' | grep "Serial Number:" | awk -F ": " \'{print $2 " iPhone"}\''),
-        Q.nfcall(exec, 'system_profiler SPUSBDataType | sed -n -e \'/iPod/,/Serial/p\' | grep "Serial Number:" | awk -F ": " \'{print $2 " iPod"}\'')
+        Q.nfcall(exec, "ioreg -p IOUSB -l | sed -n -e '/iPad/,/USB Serial Number/p' | grep 'Serial Number' | awk -F\\\" '{print $4 \" iPad\"}'"),
+        Q.nfcall(exec, "ioreg -p IOUSB -l | sed -n -e '/iPhone/,/USB Serial Number/p' | grep 'Serial Number' | awk -F\\\" '{print $4 \" iPhone\"}'"),
+        Q.nfcall(exec, "ioreg -p IOUSB -l | sed -n -e '/iPod/,/USB Serial Number/p' | grep 'Serial Number' | awk -F\\\" '{print $4 \" iPod\"}'"),
     ];
 
     // wrap al lexec calls into promises and wait until they're fullfilled
diff --git a/tests/spec/unit/lib/list-devices.spec.js b/tests/spec/unit/lib/list-devices.spec.js
index 9b50a6b..6b46ac2 100644
--- a/tests/spec/unit/lib/list-devices.spec.js
+++ b/tests/spec/unit/lib/list-devices.spec.js
@@ -28,9 +28,9 @@ describe('cordova/lib/list-devices', function () {
         });
         it('should invoke proper system calls to retrieve connected devices', function () {
             list_devices.run();
-            expect(Q.nfcall).toHaveBeenCalledWith(jasmine.any(Function), jasmine.stringMatching(/system_profiler.*iPad/g));
-            expect(Q.nfcall).toHaveBeenCalledWith(jasmine.any(Function), jasmine.stringMatching(/system_profiler.*iPod/g));
-            expect(Q.nfcall).toHaveBeenCalledWith(jasmine.any(Function), jasmine.stringMatching(/system_profiler.*iPhone/g));
+            expect(Q.nfcall).toHaveBeenCalledWith(jasmine.any(Function), jasmine.stringMatching(/ioreg.*iPad/g));
+            expect(Q.nfcall).toHaveBeenCalledWith(jasmine.any(Function), jasmine.stringMatching(/ioreg.*iPod/g));
+            expect(Q.nfcall).toHaveBeenCalledWith(jasmine.any(Function), jasmine.stringMatching(/ioreg.*iPhone/g));
         });
         it('should trim and split standard output and return as array', function (done) {
             Q.all.and.returnValue(Q.resolve([['   this is\nmy sweet\nstdout\n    ']]));


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