Drag and drop install APK script

September 30th, 2010 by Christian Leave a reply »

Update April 5th 2011: since the latest Android SDK, the adb tool has been moved to the platform-tools folder. I updated the script to point to the correct directory.

If you want to be able to just drag and drop your APK file onto a CMD file, and let it be installed on the connected device automatically, use something like this (simply copy this to your *.cmd file):

New:

:: Just some debug output:
echo Attempting to install file: %1
 
:: Enter drive letter:
d:
 
:: Enter path to adb here:
cd D:\android_sdk on 10.17.1.205\platform-tools
 
:: Install file:
adb install -r %1
PAUSE

Old:

:: Just some debug output:
echo Attempting to install file: %1
 
:: Enter drive letter:
d:
 
:: Enter path to adb here:
cd D:\androidsdk\tools
 
:: Install file:
adb install -r %1
PAUSE

PS: Of course one could use set varNAme=__PATH__ instead of the cd-ing, but my path has some spaces and that leads to troubles.

1 comment

  1. _geo_ says:

    You could “enable” Android SDK more elegantly by setting the PATH variable instead of changing the directory.

    set ANDROID_SDK=C:\path_to_sdk\tools
    set PATH=%PATH%;%ANDROID_SDK%

    ;-)

Leave a Reply