openatx / adbutils

pure python adb library for google adb service.
MIT License
761 stars 175 forks source link

The ability of get shell command output should be enhanced. #1

Closed bs111 closed 5 years ago

bs111 commented 5 years ago

if we want to get current Activity, we can get from by this shell command->dumpsys activity | grep -w ResumedActivity but ,failed.

print(d.shell_output("dumpsys activity |grep -w ResumedActivity")) /system/bin/sh: dumpsys activity |grep -w ResumedActivity: not found

example:

adb shell W-P311:/ $ dumpsys activity |grep -w ResumedActivity ResumedActivity: ActivityRecord{b11e81c u0 com.tencent.mobileqq/.activity.SplashActivity t12623} W-P311:/ $

codeskyblue commented 5 years ago

fix in 0.2.4, I change to a new method shell instead of shell_output

d.shell("dumpsys activity | grep -w ResumedActivty")