Skip to content

Instantly share code, notes, and snippets.

@Oshuma
Created December 12, 2011 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Oshuma/1467395 to your computer and use it in GitHub Desktop.
Save Oshuma/1467395 to your computer and use it in GitHub Desktop.
<target
name="run"
description="Build and run the app on the default emulator."
depends="clean, debug, installd">
<property name="adb"
value="${sdk.dir}/platform-tools/adb" />
<property name="main.activity"
value="de.nerdno.android/de.nerdno.android.NerdNode" />
<property name="command.opts"
value="shell am start -a android.intent.action.MAIN -n ${main.activity}" />
<echo message="Running on emulator..." />
<exec executable="${adb}">
<arg line="${command.opts}" />
</exec>
</target>
<target
name="simulator"
description="Start the simulator defined as 'avd.target'.">
<fail
unless="avd.target"
message="Define an 'avd.target' like: ant -Davd.target=target_name simulator" />
<echo message="Running AVD '${avd.target}'..." />
<exec spawn="true" executable="${sdk.dir}/tools/emulator">
<arg line="-avd ${avd.target} -scale 0.8" />
</exec>
</target>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment