如何判断外部adb命令是否完成了android活动? [英] How do I tell if an android activity is finished from an external adb command?

查看:323
本文介绍了如何判断外部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.

这篇关于如何判断外部adb命令是否完成了android活动?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆