Reputation: 10472
I'm tired of uninstalling and than reinstalling in development.
Is there a way to do adb -force install some.apk ? I mean this would save a lot of time. Each time going to system ->apps->uninstall every time a signature is different.
Obviously debug is a dev setting so I don't see why one constantly needs to uninstall the app manually, what a waste of time? Anything that can make development easier is going to result in better code, and better apps so whats up with this?
I have hot deployed to server side Java EE servers in less time. This is less an issue on command line, since one could do an uninstall or replace the adb script with an uninstall followed by an install.
However in eclipse its still a pain. It has been pointed out that this is largely about signature changes. Yes, it is. But why should signatures change in development, and debug mode, and cause the reinstallation issue?
Upvotes: 52
Views: 98208
Reputation: 2369
adb has [-r] parameter to reinstall.
adb install -r some.apk
Upvotes: 236
Reputation: 11005
You can install an app forcefully by passing -r parameter.
-r parameter lets adb to reinstall the app.
adb install -r app-release.apk
Upvotes: 3
Reputation: 40397
A web search you could have done reveals that the answer to your adb question is:
adb uninstall some.package.name
Note that it's not the file.apk name you use with adb install, but rather the actual package name it ends up installed as.
Upvotes: 14
Reputation: 2127
adb install -r -d path/to/file.apk
-r to replace -d to force downgrade
Upvotes: 7
Reputation: 57682
The normal build process uses the android debug keystore that can be found in your android folder in your home directory (path depends on your OS).
With this debug keystore your app will be signed. This debug signature can be installed on every android device in the world as long as there isn't your app with another signature already installed.
When you say you only do code checkouts, rebuild and your signature is different, than probably your build process is broken. Your debug keystore is valid for at least a year and as long as you are on the same PC while building the generated APK should never have a different signature.
For further checking you should bring some light in your development process. What do you use? Eclipse?
If you work on different developing machines, pick one keystore from one machine and put it into your version control and use this to sign your apk with the debug signature.
Upvotes: 12
Reputation: 94
for uninstall adb uninstall app_package_name
for install adb install app_package_name
into the command prompt in windows and terminal in linex/Macos
Upvotes: -6
Reputation: 888
The debug keystore can be set in Eclipse in Preferences/Android/Build/Custom debug keystore, which is very helpful when working in a team. Every member should set up the same keystore there, and then it is no problem any longer to share devices.
Upvotes: -2