Android Tutorials - Herong's Tutorial Examples - v3.05, by Herong Yang
Installing Application to Tablet using "ant installd" Command
This section provides a tutorial example on how to install the debug package of my 'HelloAndroid' application to my LG-V905R tablet using the 'ant installd' command through the USB debugging interface.
I think I am ready try to install my own applications on my LG-V905R tablet and debug/test them.
Let's try to install the "HelloAndroid" debug package to my tablet first using the "ant installd" command. See previous tutorials on how to build the debug package.
You may need to shutdown the Android emulator to run "ant installd", because it can not support 2 connected Android devices.
C:\herong\HelloAndroid>\local\apache-ant-1.8.3\bin\ant installd Unable to locate tools.jar. Expected to find it in C:\Program Files\Java\jre7\lib\tools.jar Buildfile: C:\herong\HelloAndroid\build.xml -set-mode-check: -set-debug-files: install: [echo] Installing C:\herong\HelloAndroid\bin\HelloAndr oid-debug.apk onto default emulator or device... [exec] pkg: /data/local/tmp/HelloAndroid-debug.apk [exec] Success [exec] 1125 KB/s (14980 bytes in 0.013s) installd: BUILD SUCCESSFUL Total time: 3 seconds
Ok. We have an error here. The default Java environment on my Windows system is JRE 1.6, which does not have the tools.jar, which required by "ant"
I need to set the JAVA_HOME variable to point to the JDK environment, which contains the tools.jar file.
Go to the emulator Windows and close it. Then rerun the "ant installd" command:
C:\herong\HelloAndroid>set "JAVA_HOME=\Program Files\java\jdk1.7.0_03" C:\herong\HelloAndroid>\local\apache-ant-1.8.3\bin\ant installd Buildfile: C:\herong\HelloAndroid\build.xml -set-mode-check: -set-debug-files: install: [echo] Installing C:\herong\HelloAndroid\bin\HelloAndr oid-debug.apk onto default emulator or device... [exec] pkg: /data/local/tmp/HelloAndroid-debug.apk [exec] 1218 KB/s (14980 bytes in 0.012s) [exec] Success installd: BUILD SUCCESSFUL Total time: 2 seconds
It works this time! "ant installd" installed my debug package of "HelloAndroid" to my LG-V905R tablet through the USB debugging interface.
To verify, go to the tablet and tap on "Applications". You will see "HelloAndroid" listed and ready to run.
Table of Contents
Installing JDK 1.8 on Windows System
Installation of Android SDK R24 and Emulator
Installing Apache Ant 1.9 on Windows System
Developing First Android Application - HelloAndroid
Android Application Package (APK) Files
Android Debug Bridge (adb) Tool
AboutAndroid - Application to Retrieve System Information
android.app.Activity Class and Activity Lifecycle
View Objects and Layout Resource Files
Using "adb logcat" Command for Debugging
Build Process and Package File Content
Samsung Galaxy Tab 3 Mini Tablet
USB Debugging Applications on Samsung Tablet
►USB Debugging Applications on LG-V905R Tablet
Turning on USB Debugging on LG-V905R
Viewing LG-V905R Android USB Device in Control Panel
Running "adb" on LG-V905R USB Debugging Interface
►Installing Application to Tablet using "ant installd" Command
Installing Application to Tablet using "adb -d install" Command
Installing "AboutAndroid" to LG-V905R Tablet