I have a simple \"Hello Android\" application on my computer (Eclipse environment), and I have built an APK file. How do I transfer the APK file to my Android phone for test
outside device,we can use :
adb install file.apk
or adb install -r file.apk
adb install [-l] [-r] [-s] [--algo <algorithm name> --key <hex-encoded key> --iv <hex-encoded iv>] <file>
- push this package file to the device and install it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data)
('-s' means install on SD card instead of internal storage)
('--algo', '--key', and '--iv' mean the file is encrypted already)
inside devices also, we can use:
pm install file.apk
or pm install -r file.apk
pm install: installs a package to the system. Options:
-l: install the package with FORWARD_LOCK.
-r: reinstall an exisiting app, keeping its data.
-t: allow test .apks to be installed.
-i: specify the installer package name.
-s: install package on sdcard.
-f: install package on internal flash.
-d: allow version code downgrade.
If you have access to a Gmail account on the phone then an easy way (in terms of minimal set up effort) is to mail the .apk file to that Gmail account.
If you then access that account from the native Gmail app on the phone it recognises that the attachment is an app and offers an "Install" button.
As per other responses this approach also requires that you have selected USB debugging on the device.
Try this - it is remarkably easy ;-)
If you dont have SDK or you are setting up 3rd party app here is another way:
Simply, you use ADB, as follows:
adb install <path to apk>
Also see the section Installing an Application in Android Debug Bridge.
I quote Hello Android because I can't say it better ;-)
You need to enable USB debugging on the phone itself (by starting the Settings application and selecting Applications > Development > USB Debugging), install the Android USB device driver if you haven’t already (Windows only), and then plug the phone into your computer using the USB cable that came with the phone.
Close the emulator window if it’s already open. As long as the phone is plugged in, Eclipse will load and run applications on the phone instead. You need to right-click the project and select Run As > Android Application.
For what its worth, installing a system app to the /system/app
directory will be:
adb push appname.apk /system/app/
Just ensure you're in the right directory where the target .apk file to be installed is, or you could just copy the .apk file to the platform-tools
directory of the Android SDK and adb
would definitely find it.