Monitoring Android USB Devices in Node
#Install
npm install -g android-device-monitor
#Usage
$ android-device-monitor
API
import monitor from 'android-device-monitor'
monitor({
"onConnection": (device) => {
// do something when a device is connected
},
"onDisconnection": (device) => {
// do something when a device is disconnected
// send an alert to wake up somebody
}
})
#Requirements
- ADB
- libs required by node-usb-detection module
#Related
- Receive notifications on Slack on (dis)connection events https://github.com/Urucas/android-device-monitor-slack-integration