I would like to delete a complete database created by my application.
Do you know any adb command, or android sentence to do it?
SQLite is an embedded database engine, so in order to drop a database you have to delete the file from the machine. This action will make the database no longer accessible.
The TRUNCATE TABLE statement is used to remove all records from a table. SQLite does not have an explicit TRUNCATE TABLE command like other databases. Instead, it has added a TRUNCATE optimizer to the DELETE statement. To truncate a table in SQLite, you just need to execute a DELETE statement without a WHERE clause.
sqlite> DELETE FROM table_name; Following is the basic syntax of DROP TABLE. sqlite> DROP TABLE table_name; If you are using DELETE TABLE command to delete all the records, it is recommended to use VACUUM command to clear unused space.
You can run the command:
adb -s emulator-5554 shell (or whatever port you use)
cd /data/data/<packagename>/databases/
By typing ls, you will see the databases created and you can remove the one you want with rm
rm myapp.db
See more here
I think you need to start up your emulator with the command: -wipe-data
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With