Android: Delete entire database

天大地大妈咪最大 提交于 2019-12-04 12:17:15

问题


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

Do you know any adb command, or android sentence to do it?


回答1:


I think you need to start up your emulator with the command: -wipe-data




回答2:


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




回答3:


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"




回答4:


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




回答5:


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.




回答6:


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



来源:https://stackoverflow.com/questions/2161243/android-delete-entire-database

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!