adbkit
adbkit copied to clipboard
"Error: getaddrinfo ENOENT" when haven't any connection network?
I use this code to get list android device connected in windows. But when I turn off all my network card or my network down it will catch exeption "getaddrinfo ENOENT". It will work when I have any network card connected even this is network card to virtual machine. How can I get listdevice when my network down?
const adb = require('adbkit');
const client = adb.createClient();
client.listDevices()
.then(function(devices) {
console.log(devices);
//Set link button if detect device
})
.catch(function(err) {
console.error('Something went wrong: ' + err);
});
Maybe if no connection connected, adbkit cannot lookup ip localhost. With options when create client has solve this problem :smile:
const client = adb.createClient({host: "127.0.0.1", port: "5037"});