openstf / adbkit

A pure Node.js client for the Android Debug Bridge.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

client .trackDevices() is not working

slugger941 opened this issue · comments

I connect android device with host pc(ubuntu) and run adbkit code like example.
(running adb star-server)

var adb = require('adbkit')
var client = adb.createClient()

client.trackDevices()
.then(function(tracker) {
tracker.on('add', function(device) {
console.log('Device %s was plugged in', device.id)
})
tracker.on('remove', function(device) {
console.log('Device %s was unplugged', device.id)
})
tracker.on('end', function() {
console.log('Tracking stopped')
})
})
.catch(function(err) {
console.error('Something went wrong:', err.stack)
})

so, I expect "console.log('Device %s was plugged in', device.id)" because android device is connected already
, but it is not printed and not working anything.
I think this is related with 'lookup' event of socket(Net.connect) but not know exactly.
Let me know how to resolve or debug this issue.

close

I hava a same problem, so what so i do?