如何判断外部adb命令是否完成了android活动?
在我们的测试中,我想使用脚本来运行许多android活动。我可以使用adb shell start activity命令来启动这些活动。有没有办法使用adb命令来告知活动何时完成?在发出下一个adb start activity命令之前,脚本需要知道第一个活动何时完成。
In our testing, I want to use a script to run a number of android activities. I can use an adb shell start activity command to start these activities. Is there a way, using an adb command, to tell when an activity finishes? The script needs to know when the first activity is done before issuing the next adb start activity command.
我最近做了一些事情,希望让bash脚本运行adb命令并显示/等待直到完成。这对我有用:
I did something recently where I wanted a bash script to run an adb command and show/wait until it was finished. This is what worked for me:
./adb shell am start -W -n com.android.settings/.ApplicationSettings
然后脚本继续等待应用程序菜单加载。不确定如何在更长的过程中使用,但值得一试。
The script then waited for the applications menu to load before continuing. Not sure how this would work for a longer process but it's worth a shot.