2012-10-30 24 views
2

要啓動應用程序我做:如何使用ant關閉Android應用程序?

<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> 

不過,我要關閉這個應用程序。什麼是螞蟻代碼來做到這一點?約

回答

0

什麼用kill

am kill: kill all processes associated with <PACKAGE> 

force-stop

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

在一般情況下,你應該做的:

adb shell 

,並同時在外殼,做am不帶參數 - 這將顯示我所有的選項和開關。

+0

工作成功!! ..非常感謝您的幫助。 :d – hereisdhiraj