Search code examples
androidandroid-sqlite

SQLite database on Android - how to remove it?


I'm using SQLite database for caching. I want to remove this database on my phone, because I have multiple app versions on which I'm working at and some has different database versions. This is causing exception:

Caused by: android.database.sqlite.SQLiteException: Can't downgrade database from version 7 to 5

I need to remove whole db file on my phone and create it again with older version.

How to access this file and delete it? I should be stored in data folder but I cant see that folder in my phone storage.


Solution

  • I was able to remove it from adb shell in Android Studio adb shell run-as com.package.name cd /data/data/com.package.name/ rm -r databases