1.0.2 • Published 3 years ago

pro-android v1.0.2

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

ProAndroid, Interface for Android Phones


NOTE

Work in progress, Use at your own risk.

Made by ProDev76, Use package with caution.


Initializing

This code is in order to initialize the Package

let proAndroid = require("pro-android");
let Android = new proAndroid();

Listing all devices

In order to list all connected devices with USB Debugging enabled

let devices = await Android.getDevices()
[
  {
    serial: 'Serial_num',
    product: 'Product',
    access: true, //Is it unauthorized or allowed for USB Debugging
    model: 'Model', //Phone model
    device: 'a12', //Device name
    transportId: '1' //The transport id
  }
]

Targeting a device

In order to target a single device and run queries on it.

let device = Android.device("Serial_Number");
//Example: let device = Android.device(devices[0].serial);

Getting props from device

Get all props from a device

device.getProps().then(x => {});
//Example: device.getProps().then(x => console.log(x.ro.product.brand + " " + x.ro.product.model));

Reboot a device (Android, Fastboot, Bootloader, Recovery)

Reboot a device to a specific mode

await device.rebootToAndroid() //Reboot to the android system
await device.rebootToBootloader() //Reboot to the bootloader
await device.rebootToRecovery() //Reboot to recovery mode
await device.rebootToFastboot() //Reboot to fastboot

Use ADB In Node

Use ADB Commands in NodeJS

Android.adb("Args").then(x => {});

Work in progress, We will release more functions soon, Please use the package with caution.