android – How do I Replace a File in the Internal Storage of a Debuggable App?-ThrowExceptions

Exception or error:

I’ve got an android app, which is debuggable.

I can back up its important files to my PC like so:

adb exec-out run-as org.test.myapp cat files/afile > afile-from-phone

But how do I put them back?

I.e. what command with copy the file

afile-from-phone

from my pc to

files/afile

in the storage area that belongs to org.test.myapp on the phone?

How to solve:

If your device allows you to run adb as root you can do:

adb push afile-from-phone data/app/org.test.myapp/

Change “data” for “system” if it’s a system app.

Leave a Reply

Your email address will not be published. Required fields are marked *