gradle: add android-example run task

This commit is contained in:
Hannes Janetzek 2014-03-01 16:01:16 +01:00
parent cee96c9ed0
commit 3118086ff3

View File

@ -64,5 +64,17 @@ eclipse.project {
buildCommand 'com.android.ide.eclipse.adt.ResourceManagerBuilder' buildCommand 'com.android.ide.eclipse.adt.ResourceManagerBuilder'
buildCommand 'com.android.ide.eclipse.adt.PreCompilerBuilder' buildCommand 'com.android.ide.eclipse.adt.PreCompilerBuilder'
buildCommand 'com.android.ide.eclipse.adt.ApkBuilder' buildCommand 'com.android.ide.eclipse.adt.ApkBuilder'
} }
task run (dependsOn: 'installDebug'){
doFirst {
println(">> adb run...")
String adb = System.getenv()['ANDROID_HOME'] + '/platform-tools/adb'
String cmd = "${adb} shell am start -n org.oscim.android.test/.Samples"
def proc = cmd.execute()
proc.in.eachLine {line -> println line}
proc.err.eachLine {line -> System.err.println( 'ERROR: ' + line)}
proc.waitFor()
}
}