How to find and clear the SQLite db file in Android (emulator)

后端 未结 6 887
我寻月下人不归
我寻月下人不归 2021-02-01 23:17

I\'ve just got my first SQLite database up and running but to reproduce it I wanted a quick way to clear the db file (so I can call my openOrCreateDatabase method a

6条回答
  •  醉梦人生
    2021-02-02 00:17

    It's stored inside the emulator, not on your machine (at least, not in a place that is easily accessible). Just remove it using adb:

    C:\> adb -e shell rm /data/data/com.example.package/databases/*.db
    

    You can also choose the "Wipe user data" option when launching the emulator AVD, or you can uninstall the application to wipe all data for just that one app:

    C:\> adb -e uninstall com.example.package
    

    Finally, you can also just clear user data for a given application without uninstalling it, by going to Settings > Applications > Manage Applications... Select your application, then click the "Clear Data" button.

提交回复
热议问题