Unable to install apk in android emulator

流过昼夜 提交于 2019-12-05 03:40:30

问题


I am trying to install an apk (downloaded from one site) in ICS emulator through adb shell but its giving following error:

Failure [INSTALL_FAILED_UID_CHANGED]

What could be the issue?


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/11444837/unable-to-install-apk-in-android-emulator

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