When I push a command adb uninstall com.pckg the /data/data/com.pckg is deleted, but I want to preserve the folder w/o using adb uninstall -k com.pckg as I need to install another app with same package name & different signature which conflicts with -k cmd.

I tried mv /data/data/com.package /data/data/com.package1 but com.package1 got deleted after adb uninstall command.

I don't want to copy the folder to a new location because it takes a lot of time.

  • After moving/renaming the package I would reboot the device to make sure all file-handles to the old directory are closed (file-handles survive a rename and then point to the new location). – Robert Mar 27 '18 at 18:34
  • @Robert I will try that soon and will update here. Btw is there any way to do this without rebooting the device? – Dhruv Kaushal Mar 28 '18 at 7:25
  • AFAIK there is a daemon (installd?) that handles (de)installations. Restarting this daemon would be sufficient. However I have never heard that Android daemons can be restarted linke regular Linux daemons. May be killing the daemon restarts it? – Robert Mar 28 '18 at 13:29

if you are already rooted why dont you use titanium backup
Steps :

  1. Install Titanium Backup ★ root
  2. Launch it and grant root permissions
  3. locate to the app and backup it
  4. now close titanium backup and uninstall app
  5. install the 2nd apk(the one with different signature)
  6. launch titanium backup and restore the existing backup but restore DATA ONLY not whole app

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.