开发者

Android: Delete entire database

I would like to delete a complete database created by my application.

Do 开发者_StackOverflowyou know any adb command, or android sentence to do it?


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


Also, in Eclipse you can go to "Window -> Show View -> Other... -> Android -> File Explorer"

Then navigate to "data/data//databases"

Select the database file, then click the red minus sign to "delete the selection"


go to DDMS->FleExplorer-data/data/packagename/databases/name_of_database

click on the name_of_database and press the red minus!

If you don't have the FileExplorer go to Window->ShowView->FileExplorer


Perhaps this is too obvious but uninstalling the application via Manage Applications will remove the db, assuming it's in the application's files dir.


The clear data button will actually delete the database without uninstalling the entire app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜