Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to run shell on marshmallow physical device #50

Open
sav007 opened this issue Feb 8, 2023 · 8 comments
Open

Failed to run shell on marshmallow physical device #50

sav007 opened this issue Feb 8, 2023 · 8 comments

Comments

@sav007
Copy link

sav007 commented Feb 8, 2023

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?

@sav007
Copy link
Author

sav007 commented Feb 8, 2023

This actually makes Maestro test to fail run on Marshmallow devices.

@Leland-Takamine
Copy link
Contributor

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.

@sav007
Copy link
Author

sav007 commented Feb 13, 2023

@Leland-Takamine the link to the go implementation is not accessible, private repo?

@NyCodeGHG
Copy link

Are there plans to publish the go implementation? I'd like to look into this

@testifyqa
Copy link

Would also like to look into this, if you can share a snippet of the connection.go code to go off please.

@NyCodeGHG
Copy link

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

@testifyqa
Copy link

Is this and Maestro still being actively worked on?

@NyCodeGHG
Copy link

maestro probably yes, this library seems a bit dead :/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants