adbkit icon indicating copy to clipboard operation
adbkit copied to clipboard

client.openTcp will block the real adb shell

Open harlentan opened this issue 8 years ago • 6 comments

I just find that the client.openTcp will block the real adb shell some time for android 6.x and 7.x

harlentan avatar May 12 '17 07:05 harlentan

Are you using tethering on your device?

sorccu avatar May 12 '17 07:05 sorccu

Nope, I just use client.startService and then try to use client.openTcp to connect to the port on device. But the openTcp will block the adb of the device, event if I use command line adb shell, it will block forever. I just test it on Pixel. It may not happen everytime, but with some probability

harlentan avatar May 12 '17 07:05 harlentan

I get the conn after first call client.openTcp, should I call con.end() before I exit the process?

harlentan avatar May 12 '17 07:05 harlentan

Check if forwards behave the same (without adbkit). Start the service and forward a local port to the device port. Connect and see if the same thing happens.

Also, check once more whether tethering is enabled or not. If it is, turn it off.

sorccu avatar May 12 '17 07:05 sorccu

I am sure tethering is not enabled. It just happen with Android 6.0.1,android android 7.x for sometime.

Is there something wrong with the my situation that I resue the same adbClient object for a lot of commands ?

harlentan avatar May 17 '17 09:05 harlentan

I think you're going to have to show your code. Please try to make a minimal test case that shows the behavior.

sorccu avatar May 17 '17 09:05 sorccu