adbkit icon indicating copy to clipboard operation
adbkit copied to clipboard

waitForDevice not working

Open valentincognito opened this issue 6 years ago • 11 comments

It seems like the waitForDevice method is not working anymore. It throws an error like so: Unhandled rejection FailError: Failure: 'unknown host service'

Anyone had a similar issue ?

valentincognito avatar Jul 03 '18 10:07 valentincognito

yep, same here !

MathiasGilson avatar Oct 29 '18 11:10 MathiasGilson

Ya Im also facing the same problem

SreejithNS avatar Dec 01 '18 10:12 SreejithNS

same for me :/. Please could somebody fix this?

jupe avatar Jan 18 '19 11:01 jupe

For those who are curious, the problem is pretty well summed up here:

https://stackoverflow.com/questions/38224756/error-unknown-host-service-for-adb-wait-for-devices

TL;DR the adb server used to accept the command 'wait-for-any', but now the command has to be 'wait-for-device-any'. I'm planning on submitting a pull request when I'm done with my little project.

bradyriddle avatar Jan 18 '19 22:01 bradyriddle

Thanks for info! Hopefully we get fix asap released..

jupe avatar Jan 19 '19 05:01 jupe

@bradyriddle do you have fix already in some fork/branch so I could try it out?

jupe avatar Jan 21 '19 05:01 jupe

I do not, but if you do an npm install and go into the node module folder and find adb-kit you can find a file called waitfordevicecommand.js. if you go in that file you'll see the 'wait-for-any' string. Just swap it out and it should work.

bradyriddle avatar Jan 21 '19 05:01 bradyriddle

@bradyriddle I'm not seeing the waitfordevicecommand.js file within my node modules folder. Do you know where it could be located now? Getting the same error: Unhandled rejection FailError: Failure: 'unknown host service' when I try using the .waitForDevice method.

Andychochocho avatar Jun 05 '19 15:06 Andychochocho

@Andychochocho node_modules/adbkit/lib/adb/command/host-serial/waitfordevice.js on line 17:

Change this: this._send("host-serial:" + serial + ":wait-for-device"); to this: this._send("host-serial:" + serial + ":wait-for-any-device");

Source: https://stackoverflow.com/questions/38224756/error-unknown-host-service-for-adb-wait-for-devices?noredirect=1&lq=1

This issue seems really simple to fix. It's a 1 liner, someone should submit a PR.

sundayz avatar Jun 05 '19 23:06 sundayz

@sundayz Thank you so much!! Appreciate the help! PR has been sent 👍

Andychochocho avatar Jun 06 '19 01:06 Andychochocho

Well done! I hope it gets merged soon.

sundayz avatar Jun 06 '19 01:06 sundayz