android

0.0.8 • Public • Published

android

a node module for adb & android

Examples:

var adb = require("android");

Get attached device id

adb.firstDevice(function(deviceId){
    if(deviceId) {
        //there's a device attached, do cool stuff
    } else {
        //no device attached
    }
});

Checking to see if a package is installed (wildcards allowed)

adb.isInstalled("com.example.*", function(isInstalled) {
    if(isInstalled) {
        //do cool stuff
    }
});

Installing an APK

adb.install("/path/to/my.apk", function() {
    //do cool stuff
});

Pushing a file

adb.push("/path/to/src", "/path/to/target", function (err) {
    if(!err) {
        //do cool stuff
    }
});

Sending a broadcast

var options = {action:"com.example.ACTION_JACKSON", extras:{key:"lime", pie: "good"};
 
adb.sendBroadcast(options, function(response){
    console.log("response data: " + response.data);
    console.log("response message: " + response.message);
});

Readme

Keywords

Package Sidebar

Install

npm i android

Weekly Downloads

2,158

Version

0.0.8

License

BSD

Last publish

Collaborators

  • benmonro