adb-toolkit
Advanced tools
Comparing version 0.4.6 to 0.4.7
{ | ||
"name": "adb-toolkit", | ||
"version": "0.4.6", | ||
"version": "0.4.7", | ||
"description": "ADB toolkit", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
const shell = require('shelljs'); | ||
const adb = 'adb'; | ||
const options = {silent: true}; | ||
var options = {silent: true}; | ||
function getDevices() { | ||
function getDevices(opt) { | ||
if (typeof opt !== 'undefined') { | ||
options = opt; | ||
} | ||
var adbDevices = shell.exec(`${adb} devices -l`, options).stdout.trim().split('\n'); | ||
@@ -129,3 +133,3 @@ adbDevices.shift(); | ||
}, | ||
launchUrl: function(url, selectedBrowser, addOptions) { | ||
launchUrl: function(url, selectedBrowser) { | ||
var browser = typeof selectedBrowser === 'undefined' ? this.getBrowsers()[0] : this.getBrowsers(selectedBrowser)[0]; | ||
@@ -136,5 +140,9 @@ if (!browser) { | ||
} | ||
var cmd = browser.launchCmd.replace('{URL}', url.replace(/&/gi, '\\&')); | ||
var opt = typeof addOptions !== 'undefined' ? addOptions : options; | ||
const output = shell.exec(cmd, opt); | ||
url = url.replace(/\(/gi, '%28'); | ||
url = url.replace(/\)/gi, '%29'); | ||
url = encodeURIComponent(url); | ||
var cmd = browser.launchCmd.replace('{URL}', url); | ||
const output = shell.exec(cmd, options); | ||
}, | ||
@@ -141,0 +149,0 @@ forceStop: function(package, callback) { |
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
7434
152