Comparing version 2.0.4 to 2.0.5
(function() { | ||
var ClearCommand, Client, Connection, ForwardCommand, FrameBufferCommand, GetDevicePathCommand, GetFeaturesCommand, GetPackagesCommand, GetPropertiesCommand, GetSerialNoCommand, GetStateCommand, HostDevicesCommand, HostDevicesWithPathsCommand, HostKillCommand, HostTrackDevicesCommand, HostTransportCommand, HostVersionCommand, InstallCommand, IsInstalledCommand, ListForwardsCommand, LogCommand, Logcat, LogcatCommand, Monkey, MonkeyCommand, ProcStat, Promise, RemountCommand, ScreencapCommand, ShellCommand, StartActivityCommand, Sync, SyncCommand, TcpCommand, UninstallCommand, WaitBootCompleteCommand, debug; | ||
var ClearCommand, Client, Connection, ForwardCommand, FrameBufferCommand, GetDevicePathCommand, GetFeaturesCommand, GetPackagesCommand, GetPropertiesCommand, GetSerialNoCommand, GetStateCommand, HostDevicesCommand, HostDevicesWithPathsCommand, HostKillCommand, HostTrackDevicesCommand, HostTransportCommand, HostVersionCommand, InstallCommand, IsInstalledCommand, ListForwardsCommand, LogCommand, Logcat, LogcatCommand, Monkey, MonkeyCommand, Parser, ProcStat, Promise, RemountCommand, ScreencapCommand, ShellCommand, StartActivityCommand, Sync, SyncCommand, TcpCommand, UninstallCommand, WaitBootCompleteCommand, debug; | ||
@@ -16,2 +16,4 @@ Monkey = require('adbkit-monkey'); | ||
Parser = require('./parser'); | ||
ProcStat = require('./proc/stat'); | ||
@@ -306,11 +308,3 @@ | ||
transfer.on('end', endListener = function() { | ||
var cmd; | ||
cmd = _this.transport(serial).then(function(transport) { | ||
return new InstallCommand(transport).execute(temp).then(function() { | ||
return _this.shell(serial, ['rm', '-f', temp]); | ||
}).then(function(out) { | ||
return true; | ||
}); | ||
}); | ||
return resolver.resolve(cmd); | ||
return resolver.resolve(_this.installRemote(serial, temp)); | ||
}); | ||
@@ -325,2 +319,16 @@ return resolver.promise["finally"](function() { | ||
Client.prototype.installRemote = function(serial, apk, callback) { | ||
return this.transport(serial).then((function(_this) { | ||
return function(transport) { | ||
return new InstallCommand(transport).execute(apk).then(function() { | ||
return _this.shell(serial, ['rm', '-f', apk]); | ||
}).then(function(stream) { | ||
return new Parser(stream).readAll(); | ||
}).then(function(out) { | ||
return true; | ||
}); | ||
}; | ||
})(this)).nodeify(callback); | ||
}; | ||
Client.prototype.uninstall = function(serial, pkg, callback) { | ||
@@ -327,0 +335,0 @@ return this.transport(serial).then(function(transport) { |
{ | ||
"name": "adbkit", | ||
"version": "2.0.4", | ||
"version": "2.0.5", | ||
"description": "A pure Node.js client for the Android Debug Bridge.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -375,2 +375,15 @@ # adbkit | ||
#### client.installRemote(serial, apk[, callback]) | ||
Installs an APK file which must already be located on the device file system, and replaces any previously installed version. Useful if you've previously pushed the file to the device for some reason (perhaps to have direct access to `client.push()`'s transfer stats). This is roughly analogous to `adb shell pm install -r <apk>` followed by `adb shell rm -f <apk>`. | ||
Note that if the call seems to stall, you may have to accept a dialog on the phone first. | ||
* **serial** The serial number of the device. Corresponds to the device ID in `client.listDevices()`. | ||
* **apk** The path to the APK file on the device. The file will be removed when the command completes. | ||
* **callback(err)** Optional. Use this or the returned `Promise`. | ||
- **err** `null` when successful, `Error` otherwise. | ||
* Returns: `Promise` | ||
* Resolves with: `true` | ||
#### client.isInstalled(serial, pkg[, callback]) | ||
@@ -377,0 +390,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
158347
2927
847