Where is the deployed apk file? how to uninstall it with adb?
Asked Answered
E

3

15

I have tried to install my apk using adb like this:

D:\C_Desktop\Development\Android SDK\platform-tools>adb install "C:\test_haxe\bin\android\bin\bin\testhaxe-debug.apk"
4274 KB/s (3702929 bytes in 0.846s)
        pkg: /data/local/tmp/testhaxe-debug.apk
Success

so, its installed fine, but at my phone, I couldn't find the apk file, is it deleted after being installed?!

also, I tried to uninstall it like this:

adb uninstall com.ketab.haxe

but I get

Failure

Because I have no emulator, I will have to install the app each time to see the progress, so I will need to uninstall it and then install the new app on my phone, is this the right way to go any way?

Eternity answered 29/1, 2013 at 7:50 Comment(4)
apk's are not saved on the device when you do adb install, it just installs the app.Tennison
that's a good info, so why I can't uninstall it?Eternity
Don't know - are you sure the package name is correct? But I also think that adb install will override your existing installation if you have signed it with the same debug key, so there's no need to uninstall (unless you have other reasons to do so).Tennison
I will have an error if I try to install before uninstall, the error is: Failure [INSTALL_FAILED_ALREADY_EXISTS], yes I am sure its the same name of package, how can I detect installed packages names?Eternity
F
23

to find out the apk file location after installation use pm path <package> command:

adb shell pm path com.ketab.haxe

you could try uninstalling the package with:

adb shell pm uninstall com.ketab.haxe

in case of failure check the error message with:

adb logcat -d -s PackageManager:*
Federal answered 29/1, 2013 at 19:49 Comment(0)
A
1

Linux/mac users can also create a script to uninstall ("delete") an apk with something like the following. Create a file named adb-uninstall with these 3 lines:

pkg=$(aapt dump badging $1|awk -F" " '/package/ {print $2}'|awk -F"'" '/name=/ {print $2}')
adb uninstall $pkg

Then chmod +x adb-uninstall to make it executable.

now you can simply:

adb-uninstall myapp.apk

The benefit here is that you don't need to know the package name. Similarly, you can create adb-run myapp.apk.

Note: This requires that you have aapt in your path. You can find it under the new build tools folder in the SDK.

Audy answered 4/2, 2014 at 20:35 Comment(0)
U
1

[with solution] I couln't find the apk file on my android device after installing successfuly from the command line my app apk (adb install ~/Downloads/myapp.apk) . After searching my phone's File Manager, I found out the app was downloaded as an APP and not as an apk file, as I had expected. So if anyone else was looking for the apk file - it's an application and not a file you can see

Unblinking answered 20/12, 2020 at 15:11 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.