This question already has answers here:
Failure [INSTALL_FAILED_ALREADY_EXISTS] when I tried to update my application
(7 answers)
Closed 9 years ago.
I know that adb install will not replace an existing package if it's of a different build type (i.e. debug vs. release).
Eclipse also successfully replaces the debug apks whenever I run a debug session.
But when I attempt adb install for replacing an existing release apk with another release apk (same package name!), I get a failure message:
adb install myapp-release.apk
pkg: /data/local/tmp/myapp-release.apk
Failure [INSTALL_FAILED_ALREADY_EXISTS]
745 KB/s (34310 bytes in 0.044s)
Wasn't that supposed to work? What am I missing?
I suppose if the app is already installed, you need to supply the -r key:
adb install -r myapp-release.apk
From the adb help:
'-r' means reinstall the app, keeping its data
Related
background:
1. I have installed the APK with the 1.1.30 version built by flutter.
2. I want to install it back to 1.1.29
3. I uninstall the 1.1.30 app.
4. I install the 1.1.29 package, and it will throw the error package appears to be invalid.
5. I try to use ADB to install it, but the error will change to INSTALL_FAILED_VERSION_DOWNGRADE: Package Verification Result
6. no idea why the app built by flutter will cause this issue, even if I uninstall the app fully.
7. the solution is using ADB install -r -d [path_to_debug_apk] to replace and downgrade the app.
can someone explain why this happened? is the app can not uninstall completely? thanks.
also refer to this link: Error: ADB exited with exit code 1 Failure [INSTALL_FAILED_VERSION_DOWNGRADE]
it seems the same to me who still can not install it even though the app was removed.
some information added:
I used adb shell cmd package list packages, can not find my app but the command with adb shell dumpsys package[pageckage name] can find my app.
so weird
I am trying to uninstall an old version of my app, and reinstall the new version via ADB on a Lollipop Android device. These are my current steps:
adb uninstall com.company.mypackagename
adb install app-release.apk
adb shell pm list packages
The original uninstall of my old app was successful and the app disappeared from the Android 5.5 device.
The new attempt to install the upgraded app returns:
adb install app-release.apk
Performing Push Install
app-release.apk: 1 file pushed, 0 skipped. 10.7 MB/s (822124 bytes in 0.073s)
pkg: /data/local/tmp/app-release.apk
Success
but when I run a list of the packages, my new APK package is not there.
adb shell pm list packages
When I try to run it anyway:
adb shell am start -n "com.company.mypackagename/com.company.mypackagename.MainActivity"
I get:
Error: Activity class {com.company.mypackagename/com.company.mypackagename.MainActivity} does not exist.
So obviously it is not installing correctly, as it is not showing in packages and unable to run - even though it shows Success. What is the best way to troubleshoot this? Any help appreciated!
I finally found the issue!!!
I'm posting here because I spent way too much time trying to figure this out, since it wasn't giving me any error messages.
I was able to get a copy of the original APK from the deployment team and analyze their AndroidManifest.xml, and saw that the original APK package name was all lowercase: "com.company.mypackagename" but the one I was building was actually using Camel-Case "com.company.myPackageName". When I tried to install it, ADB should have given an error similar to: "Application ID Does not Match", but instead it just repeatedly gave me a response of: "Success".
Hopefully this saves someone else some time!
This question already has answers here:
Failure [INSTALL_FAILED_ALREADY_EXISTS] when I tried to update my application
(7 answers)
Closed 4 years ago.
command
When I try to update a new version from server by downloading apk,
then enter install it, but failed to get installed, so I used adb command to install error found pkg:
/data/local/tmp/ntsj_2018012614.apk *
Failure [INSTALL_FAILED_ALREADY_EXISTS]**
adb can't install an apk if the device already have an apk installed where the package name is the same. So, you need to remove it by using:
adb uninstall com.your.package.name
where com.your.package.name is your apk package name. Or you can use the following if you want to keep all the apk data (in case you want to update the apk):
adb uninstall -k com.your.package.name
Then you can install the apk with:
adb install yourpackage.apk
In case you don't know the package name, please read more about it at Read the package name of an Android APK
This question already has answers here:
adb server is out of date. killing [duplicate]
(4 answers)
Closed 5 years ago.
I'm currently experiencing a few issues using ADB with Debian Stretch. Whenever I issue an ADB command, I get the following message:
$ adb root
adb server version (39) doesn't match this client (36); killing...
* daemon started successfully *
Normally this doesn't cause any issues other than a 2 second delay while the ADB server restarts, but when I'm using adb shell the connection will occasionally drop, which is annoying. Note that this is different to other questions such as this one as the server version is greater than the client version.
This problem was caused by me having ADB installed twice on my machine. Once in my home directory (used by Android Studio), and again in /usr/bin/adb as I had the android-sdk package installed from aptitude. As Debian tends to be a bit slow with package updates, adb from the command line was calling the older version at /usr/bin/adb rather than the newer version in my home folder. This issue was solved by running:
sudo apt-get remove adb
This question already has answers here:
unable to execute adb in Ubuntu. Downloaded file is meant for x86-64 while I have i686 [duplicate]
(2 answers)
Closed 7 years ago.
I'm using Ubuntu 15.10 32bit on a 32bit machine and the latest version of Android Studio with all packages downloaded from SDK manager (without the Intel atom, TV, Wear).
When I try to run or debug the App (the default simplest hello world) the console show these errors and prompt a pop-up with:
ADB not responding. If you'd like to retry, then please manually kill "adb" and click 'Restart':
Console:
13.31.35 Unable to detect adb version, adb output:
/home/user/Android/Sdk/platform-tools/adb: 1:
/home/user/Android/Sdk/platform-tools/adb: Syntax error: ")"unexpected
13.31.37 Error running app: Unable to obtain debug bridge
I already tried:
killall adb
adb: no such process
and
adb kill-server
adb start-server
* daemon not running. starting it now on port 5037 *
* daemon started successfully *
But the error still occurs.
The problem was that the platform-tools were for a 64bit machine, after replacing those with this version:
https://dl.google.com/android/repository/platform-tools_r23.0.1-linux.zip
Android Studio recognizes the adb.
But after AVD chosen, another error occurs:
Cannot launch AVD in emulator.
Output:
ERROR: 32-bit Linux Android emulator binaries are DEPRECATED, to use them
you will have to do at least one of the following:
- Use the '-force-32bit' option when invoking 'emulator'.
- Set ANDROID_EMULATOR_FORCE_32BIT to 'true' in your environment.
Either one will allow you to use the 32-bit binaries, but please be
aware that these will disappear in a future Android SDK release.
Consider moving to a 64-bit Linux system before that happens.