ARM-software / devlib

Library for interaction with and instrumentation of remote devices.
Apache License 2.0
47 stars 78 forks source link

The`kick_off` method is broken for AndroidTarget #623

Closed marcbonnici closed 1 year ago

marcbonnici commented 1 year ago

The kick_off method with Android Target is currently broken, it either exhibits blocking behaviour on the command to be ran or fails to run the command correctly.

Example blocking behaviour reproducer:

from devlib import AndroidTarget
target = AndroidTarget()
target.kick_off('sleep 10; echo "Completed" > /sdcard/sleep.log')   # This command blocks until the command completes.

Example failure to execute reproducers:

target.kick_off('echo "Testing" > /sdcard/testing')
target.execute('cat /sdcard/testing')
"nohup: can't execute 'echo': No such file or directory\n"
target.kick_off('ls')
TargetTransientError: adb has returned early; did not get an exit code. Was kill-server invoked?
OUTPUT:
-----

0
nohup: appending output to nohup.out

-----
STDERR:
-----

-----
douglas-raillard-arm commented 1 year ago

So I had a go at it, here are my observations:

So overall I'd suggest:

2) will fix both the blocking issue and the shell builtin issue.