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

Enable execution of complex shell commands via AdbServer #576

Closed
rokuoku opened this issue Sep 21, 2023 · 0 comments · Fixed by #597
Closed

Enable execution of complex shell commands via AdbServer #576

rokuoku opened this issue Sep 21, 2023 · 0 comments · Fixed by #597
Assignees
Labels
enhancement New feature or request

Comments

@rokuoku
Copy link

rokuoku commented Sep 21, 2023

Sometimes we use AdbServer for triggering an execution of shell commands on the PC, however because CmdCommandPerformer::perform() uses Runtime::exec(String command) instead of Runtime::exec(String[] cmdarray) it is impossible to execute commands which contain whitespaces in their arguments, or commands which use output redirection or pipes.

It would be great if it was possible to execute commands via Runtime::exec(String[] cmdarray).
E.g. instead of command adbServer.performCmd("script.sh \"some text\"") which fails, execute command adbServer.performCmd(arrayOf("script.sh", "some text") which would execute correctly.
Another example is adbServer.performCmd(arrayOf("sh", "-c", "adb shell dumpsys deviceidle | grep mForceIdle")

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

Successfully merging a pull request may close this issue.

2 participants