【问题标题】:How to close Android application under test using ant?如何使用ant关闭正在测试的Android应用程序?
【发布时间】:2012-10-20 02:03:24
【问题描述】:

启动我正在做的应用程序:

<target name="run">
    <exec executable="adb">
        <arg value="shell"/>
        <arg value="am"/>
        <arg value="start"/>
        <arg value="-a"/>
        <arg value="android.intent.action.MAIN"/>
        <arg value="-n"/>
        <arg value="com.go.ring.demo1/.RootActivity"/>
    </exec>
  </target>

但是,我想关闭此应用程序。执行此操作的 ant 代码是什么?

【问题讨论】:

    标签: android ant android-emulator automation


    【解决方案1】:

    kill怎么样:

    am kill: kill all processes associated with <PACKAGE>
    

    force-stop:

    am force-stop: force stop everything associated with <PACKAGE>
    

    一般来说,你应该这样做:

    adb shell
    

    在 shell 中,不带参数执行 am - 这将显示 am 的所有选项和开关。

    【讨论】:

    • 工作成功!!.. 非常感谢您的帮助。 :D
    猜你喜欢
    • 2016-07-10
    • 1970-01-01
    • 1970-01-01
    • 2015-01-10
    • 2012-04-25
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多