Environment: Meizu mx5,android 5.1
Issue: After developing the app using the real machine debugging, drag the icon on the desktop to uninstall app-debug.apk, and then install the signature version of the app-release.apk prompt to replace the xxx version, press OK after the prompt is incompatible, the installation fails.
Analysis: Has been uninstalled and then installed, according to the truth should not be prompted to replace XXX, is definitely because the uninstall is not clean (on other phones there is no such problem), should be the Meizu built-in application management uninstall problem.
Resolution: 1) in the system settings-fingerprint and security-root permissions to obtain the system's own root permissions, to determine the restart after the installation of RE File manager (you can freely browse files and modify file permissions)
2) Open re and then in data\data,data\app,data\dalvik-cache\arm64,data\dalvik-cache\profiles the inside of the package name related to the removal of everything, the data\system inside the packages.xml files copied to the computer (recommended to use Android studio Android Device Monitor), find the package name related <package> tag Item Deletion in the Packages.xml file, and install the app-release.apk after modifying the packages.xml copy back to overwrite the original file.
The Data\system\packages.xml file is used to log app attribute permissions, similar to the registry, where users delete the file themselves (I did it!). ), Packagemanagerservice will restart the phone and then restore the app based on the records in the Packages-backup.xml (previously loaded but uninstalled apps are back!) )
Reference: http://blog.csdn.net/chinajl1980/article/details/52451535
Resolve Meizu MX5 Uninstall Debug-app not clean, cause the installation, upgrade unsuccessful problem