adb-devices-emitter
v0.1.9
Published
a tool to track devices
Downloads
5,218
Readme
adb-devices-emitter
Track insertion device status
Examples
add event listener deviceAdded
deviceRemoved
const devicesEmitter = require('adb-devices-emitter')
devicesEmitter.on('deviceAdded', ({ sn }) => {
console.log('deviceAdded sn:', sn)
})
devicesEmitter.on('deviceRemoved', ({ sn }) => {
console.log('deviceRemoved sn:', sn)
})
devicesEmitter.start()
stop
const devicesEmitter = require('adb-devices-emitter')
devicesEmitter.on('deviceAdded', ({ sn }) => {
console.log('deviceAdded sn:', sn)
})
devicesEmitter.on('deviceRemoved', ({ sn }) => {
console.log('deviceRemoved sn:', sn)
})
devicesEmitter.start()
setTimeout(() => {
console.log('stop')
devicesEmitter.stop()
}, 100000)