Unable to install apk in android emulator

帅比萌擦擦* 提交于 2019-12-03 20:54:05

Uninstall the previous version of the app from the emulator first, then try again. You can do this by visiting System Settings > Applications > Manage Applications and selecting the app.

If the app still fails to install, then start the emulator with the Wipe user data option selected.

Simply rm -r the data directory in question. If you were installing and got this error, you'd simply run "rm -r /data/data/com.app.class" from an ADB shell. If you want to try preserving the data, you could find the proper UID and then "chown -R UID:UID /data/data/com.app.class".

In Android, the part of the source code that handles installing apps is PackageManagerService. Since the Android source is public, it's easy to see where Android will throw a INSTALL_FAILED_UID_CHANGED error. If the following is true: the package you are installing already has a data directory AND the permissions on that data directory are different than the UID assigned to this package, you'll get that error.

Open command prompt and write below code in it:

adb devices

This will list down the number of devices attached or are active.Copy your apk in your System folder

adb -s DEVICE_NAME install YOUR_APK_NAME

through this you will be able to install your particular apk on the device by giving device name in above line.

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