Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.
/ adbkat Public archive

Encapsulates adbkit's client and device within a common structure, reducing the need for duplicate code.

License

Notifications You must be signed in to change notification settings

RSGInc/adbkat

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

71 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

adbkat

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

Classes

Device

A device that can be communicated with via ADB.

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.

Param Type Description
apk String | Stream The 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.

Param Type Description
command String The 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.

Param Type Description
pkg String The name of the package to uninstall.

About

Encapsulates adbkit's client and device within a common structure, reducing the need for duplicate code.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published