Home > Android > Installing/Updating APKs onto an Android Phone

Installing/Updating APKs onto an Android Phone

June 4th, 2009

While developing for Android, I found myself installing and reinstalling various .apk files. I use Windows 7, but this applies to Windows in general. I created a shortcut so that I can just double-click an apk and install it.

If you have the SDK setup and working, skip ahead to step 3.

  1. Download the Android SDK Download.
  2. Install using the Android SDK Install Guide.
    1. In summary:
    2. Pick a place on your HD and extract the folder.
    3. Go into Control Panel \ System \ [Advanced system settings on Sidebar] \ Advanced tab \ Environment Variables \ System variables \ PATH
    4. Append a semicolon (;) followed by where you extracted it to with the tools folder.
      IE: Path = …;…;C:\android-sdk-1.5\tools
  3. In notepad, paste the text below and save it in that tools folder as “installapk.bat”.
    NOTE: Make sure, in the Save As box, that you change the “Save as type” from Text Documents to All Files. That way you don’t get a secret .txt append on there.
  4. Double-click any .apk you have lying around.
  5. Click “Select a program from a list of install programs”, then OK.
  6. Check “Always use the selected program to open this kind of file”
  7. Click Browse and select the .bat file you created.
  8. Click Open and you are done!

Additional tip: If you always install to the emulator, add -e directly after the “adb”. If you always install to your device, add -d after the “adb”.

@ECHO OFF
ECHO Selected: %*
ECHO.
CHOICE /c:CIR /m "Install, Reinstall or Cancel? "

IF errorlevel 3 GOTO reinstall
IF errorlevel 2 GOTO install
GOTO cancel

:install
adb install %*
GOTO done

:reinstall
adb install -r %*
GOTO done

:cancel
EXIT

:done
PAUSE

Josh Android , , , ,

Comments are closed.