dadb
dadb copied to clipboard
Failed to run shell on marshmallow physical device
Running simple shell:
val dabd = Dadb.discover()
dabd.shell("echo test")
Fails on physical device 6.0 (Marshmallow):
Exception in thread "main" java.io.IOException: Command failed (shell,v2,raw:echo test): closed
at dadb.adbserver.AdbServer.send$dadb(AdbServer.kt:99)
at dadb.adbserver.AdbServerDadb.open(AdbServer.kt:138)
at dadb.Dadb$DefaultImpls.openShell(Dadb.kt:43)
at dadb.adbserver.AdbServerDadb.openShell(AdbServer.kt:118)
at dadb.Dadb$DefaultImpls.shell(Dadb.kt:36)
at dadb.adbserver.AdbServerDadb.shell(AdbServer.kt:118)
Android Debug Bridge version 1.0.41 Version 33.0.3-8952118
Any ideas why?
This actually makes Maestro test to fail run on Marshmallow devices.
Hey I believe this is due to a bug in the implementation of the base adb protocol. When I looked into this last, our experimental go implementation works on 6.0 devices while this kotlin implementation does not. I tried to fix a similar issue in this PR: https://github.com/mobile-dev-inc/dadb/pull/38/files but we ended up reverting due to it causing hangs in our cloud infra. We did not look further into this. I would start by looking into AdbStream to see if there are any discrepancies between this implementation and the go version (which I believe does still work on 6.0 devices.
@Leland-Takamine the link to the go implementation is not accessible, private repo?
Are there plans to publish the go implementation? I'd like to look into this
Would also like to look into this, if you can share a snippet of the connection.go
code to go off please.
ADB docs say API < 24 don't support the v2 shell protocol which is used by dadb.
https://android.googlesource.com/platform/packages/modules/adb/+/refs/heads/main/SERVICES.TXT#164
Is this and Maestro still being actively worked on?
maestro probably yes, this library seems a bit dead :/