JeffLIrion / adb_shell

A Python implementation of ADB with shell and FileSync functionality.
Apache License 2.0
530 stars 60 forks source link

Executing commands in background (&) does not work #235

Closed enty8080 closed 1 month ago

enty8080 commented 1 month ago

Description

Discovered an issue with shell() method. Command is simply not executed when used with & appended to it.

device.shell('touch /tmp/test &') # does not work
device.shell('nohup touch /tmp/test &') # does not work either
device.shell('touch /tmp/test') # works

Tried the same thing using adb command and it seems to work just fine.

adb connect <>
adb shell
touch /tmp/test &
enty8080 commented 1 month ago

It works inside the PTY shell provided by adb shell command. However, if passed through adb shell "touch /tmp/test &" it is not executed.

I assume the issue is not related to this library and is a problem in ADB in general.

enty8080 commented 1 month ago

Looks like my issue is a duplicate of #147