Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "xadb", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"main": "./index", | ||
"dependencies": { | ||
"adbkit-logcat": "^1.1.0", | ||
"adbkit-monkey": "~1.0.1", | ||
"bluebird": "~2.9.24", | ||
@@ -9,0 +7,0 @@ "commander": "^2.3.0", |
@@ -8,3 +8,2 @@ /* eslint-disable | ||
const Monkey = require('adbkit-monkey') | ||
const Logcat = require('adbkit-logcat') | ||
const Promise = require('bluebird') | ||
@@ -331,45 +330,3 @@ const debug = require('debug')('adb:client') | ||
openMonkey(serial, port = 1080, callback) { | ||
if (typeof port === 'function') { | ||
callback = port | ||
port = 1080 | ||
} | ||
var tryConnect = times => { | ||
return this.openTcp(serial, port) | ||
.then(stream => Monkey.connectStream(stream)).catch(function(err) { | ||
if (times -= 1) { | ||
debug(`Monkey can't be reached, trying ${times} more times`) | ||
return Promise.delay(100) | ||
.then(() => tryConnect(times)) | ||
} else { | ||
throw err | ||
} | ||
}) | ||
} | ||
return tryConnect(1) | ||
.catch(err => { | ||
return this.transport(serial) | ||
.then(transport => | ||
new MonkeyCommand(transport) | ||
.execute(port)).then(out => | ||
tryConnect(20) | ||
.then(monkey => | ||
monkey.once('end', () => out.end()) | ||
) | ||
) | ||
}).nodeify(callback) | ||
} | ||
openLogcat(serial, options, callback) { | ||
if (typeof options === 'function') { | ||
callback = options | ||
options = {} | ||
} | ||
return this.transport(serial) | ||
.then(transport => | ||
new LogcatCommand(transport) | ||
.execute(options)).then(stream => | ||
Logcat.readStream(stream, | ||
{fixLineFeeds: false})).nodeify(callback) | ||
} | ||
@@ -376,0 +333,0 @@ openProcStat(serial, callback) { |
Sorry, the diff of this file is not supported yet
5
148085
4044
- Removedadbkit-logcat@^1.1.0
- Removedadbkit-monkey@~1.0.1
- Removedadbkit-logcat@1.1.0(transitive)
- Removedadbkit-monkey@1.0.1(transitive)
- Removedasync@0.2.10(transitive)