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

北城以北 提交于 2019-11-27 21:27:17

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:*
dljava

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!