How to run command as background process using ADB

2019-03-28 12:02发布

I am trying to run logcat in background using adb.

adb shell "logcat -r 2000 -f /data/local/test.log &"

But it does not work. If I do adb shell ps | grep logcat I dont see logcat process running.

标签: android adb
2条回答
Animai°情兽
2楼-- · 2019-03-28 12:47

If you can't run nohup directly, then you could try this: busybox nohup logcat

BusyBox combines tiny versions of many common UNIX utilities into a single small executable. So it has nohup feature as well and you could use it via busybox if manufacturer turns nohup option on at compile time.

查看更多
冷血范
3楼-- · 2019-03-28 12:49

Adding nohup seems to work.
adb shell "nohup logcat -r 2000 -f /data/local/test.log &"

查看更多
登录 后发表回答