Ant builds support a property named adb.device.arg, 를 이용 한다.

For example:

root@ubuntu:~/Android_Application_source/testingProjectPackage/NotePad# ant -Dadb.device.arg="-s 0149A97F16021014" emma debug install

Buildfile: /root/Android_Application_source/testingProjectPackage/NotePad/build.xml

Luckily, adb supports another way to specify the device: via the ANDROID_SERIAL environment variable. This variable takes the same serial values as the -s flag, and being part of the environment is independent of how you end up running adb. To repeat my previous example, I just need to set the variable to the serial for my emulator:

jsankey@caligula:~/work/my-app$ export ANDROID_SERIAL=emulator-5554

jsankey@caligula:~/work/my-app$ ant install

Buildfile: build.xml

    [setup] Android SDK Tools Revision 6

    [setup] Project Target: Android 2.2





     [echo] Installing /home/jsankey/work/my-app/build/MyAppActivity-debug.apk onto default emulator or device...

     [exec] 277 KB/s (14446 bytes in 0.050s)

     [exec]     pkg: /data/local/tmp/MyAppActivity-debug.apk

     [exec] Success



Total time: 4 seconds

+ Recent posts