Viewing private files created by an android app

后端 未结 5 1029
情歌与酒
情歌与酒 2021-02-04 01:53

I have an xml file being written by an app that is set to MODE_PRIVATE, but I now want to read that file outside of the phone, for debugging purposes. In Eclipse, I can access o

5条回答
  •  情歌与酒
    2021-02-04 02:46

    If your app is installed in debug mode, you can get your private files on a device without rooting.

    1. Go to [android-sdk]/platform-tools folder and run adb shell.
    2. run-as com.example.yourapp
    3. cp -r /data/data/com.example.yourapp /sdcard/

    (Where com.example.yourapp is the package name of your application.) After executing the steps above, the private folder of your application is copied into the root of your sdcard storage, under your package name, where you have permission to download and view them.

    Note 1: If you don't need to download them, then instead of step 3, you can use unix commands to navigate around and list files and folders.

    Note 2: Starting from Android Studio 2.0, you'll find more files in the cache and files/instant-run folder, related to the Instant Run and the GPU Debugger features, placed there by the IDE.

提交回复
热议问题