thatdude1087
thatdude1087

Reputation: 155

Deleting data from SQLite database on device

I'm doing UAT testing and need to wipe the data off my phone.. not my emulator an actual phone which I've installed the app on so that I can reinstall the app.. my app has a register activity that only runs if the database isn't present in other words the first time the app is run. Is there a way to access existing SQLite db's on the phone itself?

Upvotes: 0

Views: 1250

Answers (2)

petey
petey

Reputation: 17140

To clear app data very quickly, use a adb + pm command. From terminal (or command prompt),

adb shell pm clear your.app.package

This will work on most modern devices (I have one shitty OG samsung tab on android 2.2 where it doesn't, but works on all my others).

As a plus, in case you ever want to uninstall,

adb uninstall your.app.package

Upvotes: 4

Jesse J
Jesse J

Reputation: 542

Go to Android Settings->Apps->"Your App", and then click the Clear Data button. This will delete any data associated with the app including the database. If you rerun the app, then no database will be present.

Upvotes: 0

Related Questions