node-simctl
Advanced tools
Comparing version 3.5.1 to 3.5.2
@@ -5,2 +5,4 @@ 'use strict'; | ||
var _slicedToArray = require('babel-runtime/helpers/sliced-to-array')['default']; | ||
var _regeneratorRuntime = require('babel-runtime/regenerator')['default']; | ||
@@ -271,2 +273,5 @@ | ||
var logErrors = arguments.length <= 2 || arguments[2] === undefined ? true : arguments[2]; | ||
var _ref, stdout; | ||
return _regeneratorRuntime.async(function getAppContainer$(context$1$0) { | ||
@@ -276,8 +281,10 @@ while (1) switch (context$1$0.prev = context$1$0.next) { | ||
context$1$0.next = 2; | ||
return _regeneratorRuntime.awrap(simExec('get_app_container', 0, [udid, bundleId], {}, logErrors).stdout.trim()); | ||
return _regeneratorRuntime.awrap(simExec('get_app_container', 0, [udid, bundleId], {}, logErrors)); | ||
case 2: | ||
return context$1$0.abrupt('return', context$1$0.sent); | ||
_ref = context$1$0.sent; | ||
stdout = _ref.stdout; | ||
return context$1$0.abrupt('return', (stdout || '').trim()); | ||
case 3: | ||
case 5: | ||
case 'end': | ||
@@ -531,10 +538,8 @@ return context$1$0.stop(); | ||
function getDevices() { | ||
var forSdk = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; | ||
var _ref, | ||
function getDevicesByParsing() { | ||
var _ref2, | ||
// get the list of devices | ||
stdout, deviceSectionRe, matches, match, devices, _iteratorNormalCompletion3, _didIteratorError3, _iteratorError3, _iterator3, _step3, sdk, _iteratorNormalCompletion4, _didIteratorError4, _iteratorError4, _iterator4, _step4, line, lineRe, lineMatch; | ||
return _regeneratorRuntime.async(function getDevices$(context$1$0) { | ||
return _regeneratorRuntime.async(function getDevicesByParsing$(context$1$0) { | ||
while (1) switch (context$1$0.prev = context$1$0.next) { | ||
@@ -546,4 +551,4 @@ case 0: | ||
case 2: | ||
_ref = context$1$0.sent; | ||
stdout = _ref.stdout; | ||
_ref2 = context$1$0.sent; | ||
stdout = _ref2.stdout; | ||
deviceSectionRe = /-- iOS (.+) --(\n .+)*/mg; | ||
@@ -693,4 +698,132 @@ matches = []; | ||
case 65: | ||
return context$1$0.abrupt('return', devices); | ||
case 66: | ||
case 'end': | ||
return context$1$0.stop(); | ||
} | ||
}, null, this, [[13, 53, 57, 65], [22, 36, 40, 48], [41,, 43, 47], [58,, 60, 64]]); | ||
} | ||
function getDevices() { | ||
var forSdk = arguments.length <= 0 || arguments[0] === undefined ? null : arguments[0]; | ||
var devices, _ref3, stdout, _iteratorNormalCompletion5, _didIteratorError5, _iteratorError5, _iterator5, _step5, _step5$value, sdkName, entries, sdk; | ||
return _regeneratorRuntime.async(function getDevices$(context$1$0) { | ||
while (1) switch (context$1$0.prev = context$1$0.next) { | ||
case 0: | ||
devices = undefined; | ||
context$1$0.prev = 1; | ||
context$1$0.next = 4; | ||
return _regeneratorRuntime.awrap(simExec('list', 0, ['devices', '-j'])); | ||
case 4: | ||
_ref3 = context$1$0.sent; | ||
stdout = _ref3.stdout; | ||
/* JSON should be | ||
* { | ||
* "devices" : { | ||
* "iOS <sdk>" : [ | ||
* { | ||
* "state" : "Booted", | ||
* "availability" : "(available)", | ||
* "name" : "iPhone 6", | ||
* "udid" : "75E34140-18E8-4D1A-9F45-AAC735DF75DF" | ||
* } | ||
* ] | ||
* } | ||
* } | ||
*/ | ||
devices = {}; | ||
_iteratorNormalCompletion5 = true; | ||
_didIteratorError5 = false; | ||
_iteratorError5 = undefined; | ||
context$1$0.prev = 10; | ||
_iterator5 = _getIterator(_lodash2['default'].toPairs(JSON.parse(stdout).devices)); | ||
case 12: | ||
if (_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done) { | ||
context$1$0.next = 23; | ||
break; | ||
} | ||
_step5$value = _slicedToArray(_step5.value, 2); | ||
sdkName = _step5$value[0]; | ||
entries = _step5$value[1]; | ||
if (!(sdkName.indexOf('iOS') !== 0)) { | ||
context$1$0.next = 18; | ||
break; | ||
} | ||
return context$1$0.abrupt('continue', 20); | ||
case 18: | ||
sdk = sdkName.replace('iOS ', ''); | ||
devices[sdk] = entries.map(function (el) { | ||
delete el.availability; | ||
return el; | ||
}); | ||
case 20: | ||
_iteratorNormalCompletion5 = true; | ||
context$1$0.next = 12; | ||
break; | ||
case 23: | ||
context$1$0.next = 29; | ||
break; | ||
case 25: | ||
context$1$0.prev = 25; | ||
context$1$0.t0 = context$1$0['catch'](10); | ||
_didIteratorError5 = true; | ||
_iteratorError5 = context$1$0.t0; | ||
case 29: | ||
context$1$0.prev = 29; | ||
context$1$0.prev = 30; | ||
if (!_iteratorNormalCompletion5 && _iterator5['return']) { | ||
_iterator5['return'](); | ||
} | ||
case 32: | ||
context$1$0.prev = 32; | ||
if (!_didIteratorError5) { | ||
context$1$0.next = 35; | ||
break; | ||
} | ||
throw _iteratorError5; | ||
case 35: | ||
return context$1$0.finish(32); | ||
case 36: | ||
return context$1$0.finish(29); | ||
case 37: | ||
context$1$0.next = 46; | ||
break; | ||
case 39: | ||
context$1$0.prev = 39; | ||
context$1$0.t1 = context$1$0['catch'](1); | ||
console.log(context$1$0.t1); | ||
log.debug('Unable to get JSON device list. Falling back to manually parsing'); | ||
context$1$0.next = 45; | ||
return _regeneratorRuntime.awrap(getDevicesByParsing()); | ||
case 45: | ||
devices = context$1$0.sent; | ||
case 46: | ||
if (!forSdk) { | ||
context$1$0.next = 69; | ||
context$1$0.next = 50; | ||
break; | ||
@@ -700,3 +833,3 @@ } | ||
if (devices[forSdk]) { | ||
context$1$0.next = 68; | ||
context$1$0.next = 49; | ||
break; | ||
@@ -707,13 +840,13 @@ } | ||
case 68: | ||
case 49: | ||
return context$1$0.abrupt('return', devices[forSdk]); | ||
case 69: | ||
case 50: | ||
return context$1$0.abrupt('return', devices); | ||
case 70: | ||
case 51: | ||
case 'end': | ||
return context$1$0.stop(); | ||
} | ||
}, null, this, [[13, 53, 57, 65], [22, 36, 40, 48], [41,, 43, 47], [58,, 60, 64]]); | ||
}, null, this, [[1, 39], [10, 25, 29, 37], [30,, 32, 36]]); | ||
} | ||
@@ -766,3 +899,3 @@ | ||
// otherwise return all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WzFdLFxuICAgICAgICB1ZGlkOiBsaW5lTWF0Y2hbMl0sXG4gICAgICAgIHN0YXRlOiBsaW5lTWF0Y2hbM10sXG4gICAgICAgIHNkayxcbiAgICAgIH0pO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiBkZXZpY2VzO1xufVxuXG5hc3luYyBmdW5jdGlvbiBnZXREZXZpY2VzIChmb3JTZGs6c3RyaW5nID0gbnVsbCk6T2JqZWN0IHtcbiAgbGV0IGRldmljZXM6T2JqZWN0O1xuICB0cnkge1xuICAgIGxldCB7c3Rkb3V0fSA9IGF3YWl0IHNpbUV4ZWMoJ2xpc3QnLCAwLCBbJ2RldmljZXMnLCAnLWonXSk7XG4gICAgLyogSlNPTiBzaG91bGQgYmVcbiAgICAgKiB7XG4gICAgICogICBcImRldmljZXNcIiA6IHtcbiAgICAgKiAgICAgXCJpT1MgPHNkaz5cIiA6IFtcbiAgICAgKiAgICAgICB7XG4gICAgICogICAgICAgICBcInN0YXRlXCIgOiBcIkJvb3RlZFwiLFxuICAgICAqICAgICAgICAgXCJhdmFpbGFiaWxpdHlcIiA6IFwiKGF2YWlsYWJsZSlcIixcbiAgICAgKiAgICAgICAgIFwibmFtZVwiIDogXCJpUGhvbmUgNlwiLFxuICAgICAqICAgICAgICAgXCJ1ZGlkXCIgOiBcIjc1RTM0MTQwLTE4RTgtNEQxQS05RjQ1LUFBQzczNURGNzVERlwiXG4gICAgICogICAgICAgfVxuICAgICAqICAgICBdXG4gICAgICogICB9XG4gICAgICogfVxuICAgICAqL1xuICAgIGRldmljZXMgPSB7fTtcbiAgICBmb3IgKGxldCBbc2RrTmFtZSwgZW50cmllc10gIG9mIF8udG9QYWlycyhKU09OLnBhcnNlKHN0ZG91dCkuZGV2aWNlcykpIHtcbiAgICAgIGlmIChzZGtOYW1lLmluZGV4T2YoJ2lPUycpICE9PSAwKSB7XG4gICAgICAgIGNvbnRpbnVlO1xuICAgICAgfVxuICAgICAgbGV0IHNkayA9IHNka05hbWUucmVw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ess } from 'teen_process'; | ||
async function getAppContainer (udid:string, bundleId:string, logErrors = true) { | ||
return await simExec('get_app_container', 0, [udid, bundleId], {}, logErrors).stdout.trim(); | ||
let {stdout} = await simExec('get_app_container', 0, [udid, bundleId], {}, logErrors); | ||
return (stdout || '').trim(); | ||
} | ||
@@ -134,3 +135,3 @@ | ||
async function getDevices (forSdk:string = null):Object { | ||
async function getDevicesByParsing ():Object { | ||
// get the list of devices | ||
@@ -190,2 +191,40 @@ let {stdout} = await simExec('list', 0, ['devices']); | ||
return devices; | ||
} | ||
async function getDevices (forSdk:string = null):Object { | ||
let devices:Object; | ||
try { | ||
let {stdout} = await simExec('list', 0, ['devices', '-j']); | ||
/* JSON should be | ||
* { | ||
* "devices" : { | ||
* "iOS <sdk>" : [ | ||
* { | ||
* "state" : "Booted", | ||
* "availability" : "(available)", | ||
* "name" : "iPhone 6", | ||
* "udid" : "75E34140-18E8-4D1A-9F45-AAC735DF75DF" | ||
* } | ||
* ] | ||
* } | ||
* } | ||
*/ | ||
devices = {}; | ||
for (let [sdkName, entries] of _.toPairs(JSON.parse(stdout).devices)) { | ||
if (sdkName.indexOf('iOS') !== 0) { | ||
continue; | ||
} | ||
let sdk = sdkName.replace('iOS ', ''); | ||
devices[sdk] = entries.map((el) => { | ||
delete el.availability; | ||
return el; | ||
}); | ||
} | ||
} catch (err) { | ||
console.log(err); | ||
log.debug('Unable to get JSON device list. Falling back to manually parsing'); | ||
devices = await getDevicesByParsing(); | ||
} | ||
// if a `forSdk` was passed in, return only the corresponding list | ||
@@ -199,3 +238,3 @@ if (forSdk) { | ||
// otherwise return all the sdk -> device mappings. | ||
// otherwise return everything | ||
return devices; | ||
@@ -202,0 +241,0 @@ } |
@@ -9,3 +9,3 @@ { | ||
], | ||
"version": "3.5.1", | ||
"version": "3.5.2", | ||
"author": "https://github.com/appium", | ||
@@ -12,0 +12,0 @@ "license": "Apache-2.0", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
78519
1323