dwaan / homebridge-adb

Homebridge script to control remote ADB enabled Android device
MIT License
74 stars 14 forks source link

Having problems setting up on Windows 10/Fire TV Stick 4K #28

Closed Duclas closed 3 years ago

Duclas commented 3 years ago

Hello and sorry for my bad english and lack of programming skills, I'm completely new to Homebridge. I use Homebridge on Windows 10 and have installed ADB according to the instructions. Via cmd I can also enter adb commands, even "adb -s 192.168.3.25 shell" input keyevent KEYCODE_HOME "" works (going to the home menu on my Fire TV). image

However, as soon as I try to enter any adb command in node.js (running as administrator), I just get adb version ^^^^^^^

Uncaught SyntaxError: Unexpected identifier image

And on every startup the console just says that no device can be found: Can't connect to "AFTMM", with IP address: 192.168.3.25. Please check you ADB connection, or make sure your device is on and connected to the same network. image

My guess is that I need to somehow get Node.js to access the adb folder \platform-tools. Any suggestions on how to do this? Thank you!

dwaan commented 3 years ago

Hello, you're not supposed to run adb inside node command like that. Try creating a .js file contain this script: let exec = require('child_process').exec; exec('adb -s IP-ADDRESS shell "getprop ro.product.model && getprop ro.product.manufacturer && getprop ro.serialno"', (err, stdout) => { console.log(stdout); });

then run node yourfile.js, let me know how the output.