Android Device Monitor “data” folder is empty

前端 未结 9 1303
深忆病人
深忆病人 2020-12-02 13:04

I have tested creating, inserting and retrieving data into my apps db, and know it works through usage of Log statements.

However, I wish to expedite testing and us

相关标签:
9条回答
  • 2020-12-02 13:56

    It isn't empty....you just don't have permission to view that folder on a device.

    Try it in a simulator and it will work for you since you have root access.

    0 讨论(0)
  • 2020-12-02 13:59

    In addition to @Steven K's answers: If you want to gain access to your data without having to root your real device you need to run your app in an emulator with API 23 (or lower). It is a known problem that APIs above 23 can cause problems when deploying Android Device Monitor.

    0 讨论(0)
  • 2020-12-02 13:59

    If you are on Windows follow these instructions step by step:

    1. Launch your app in android emulator.
    2. Then open command prompt as an administrator and navigate to the sdk path for example cd C:\Android\sdk\platform-tools
    3. Type adb root
    4. Then type adb pull /data/data/ name-of-your-package /databases/name-of-your-database
    5. You'll find your database located in the folder called platform-tools.

    Then you can install Sqlite Manager extension in Google Chrome via chrome webstore and use it to view and manage your exported database.

    In case you have a rooted phone you can follow the same instructions as above.

    0 讨论(0)
提交回复
热议问题