1.0.1 • Published 8 years ago

adbkat v1.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

adbkat

adbkat reduces the amount of code needed to use adbkit by exposing a Device object that interacts with a specific device over a specific client connection.

Dependencies

Installation

npm install adbkat

Code

  • Uses ESLint for quality and style
  • Uses Jasmine for unit testing
  • Uses JSDoc for documentation

Contributing

Before submitting a pull request, make sure that you...

  1. Write/edit documentation for all new/modified members that are exposed by a module.
  2. If any documentation was written/edited, run npm run jsdoc to update the documentation in this README.md.
  3. Write unit tests for all new sufficiently significant functions. If a function has a name or is exposed by a module, then it is significant enough that it should be tested.
  4. Run all unit tests with npm test and correct all failures.
  5. Run ESLint with npm run lint and correct all warnings and errors.

API

Modules

Classes

adbkat

Encapsulates adbkit's client and device within a common structure.

Author: RSG, Inc.

adbkat.getDevices() ⇒ Promise.<Array.<Device>>

Retrieves the Devices that represent the devices that are connected to the computer via ADB.

Kind: static method of adbkat
Returns: Promise.<Array.<Device>> - A promise that resolves with the devices that are connected to the computer via ADB.

Device

A device that can be communicated with via ADB.

Kind: global class

device.getPhoneNumber() ⇒ Promise.<String>

Retrieves the phone number of the device.

This function uses dumpstate, which may not be a reliable method of retrieving the phone number, depending on your device model. For that reason this function should be considered experimental, and should only be used if you know that dumpstate can be used to retrieve your device's phone number.

Note that the promise will take a few minutes to resolve, due to the size of dumpstate's output.

Kind: instance method of Device
Returns: Promise.<String> - A promise that resolves with the device's phone number.

device.install(apk) ⇒ Promise.<Boolean>

Installs the specified apk file onto the device.

Kind: instance method of Device
Returns: Promise.<Boolean> - A promise that resolves with true when the app is successfully installed.

ParamTypeDescription
apkString | StreamThe apk file to install. See adbkit.Client.install.

device.shell(command) ⇒ Promise.<String>

Runs the specified shell command on the device. See the official ADB shell documentation for valid commands.

Kind: instance method of Device
Returns: Promise.<String> - A promise that resolves with the string output of the command when the command finishes.

ParamTypeDescription
commandStringThe command to run.

device.uninstall(pkg) ⇒ Promise.<Boolean>

Uninstalls the specified package from the device.

Kind: instance method of Device
Returns: Promise.<Boolean> - A promise that resolves with true when the package is finished uninstalling.

ParamTypeDescription
pkgStringThe name of the package to uninstall.
1.0.1

8 years ago

1.0.0

8 years ago