如何找到并清除的SQLite数据库文件中的Andr​​oid(模拟器) [英] How to find and clear the SQLite db file in Android (emulator)

查看:116
本文介绍了如何找到并清除的SQLite数据库文件中的Andr​​oid(模拟器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚拿到了我的第一个SQLite数据库运行起来,但重现它,我希望有一个快速的方法来清除数据库文件(这样我就可以打电话给我 openOrCreateDatabase 方法再次)

I've just got my first SQLite database up and running but to reproduce it I wanted a quick way to clear the db file (so I can call my openOrCreateDatabase method again)

第一个问题:我看遍网络 /数据/数据​​/包装/数据库/ 但到底是哪里此存储在Windows机器上?它不会出现在我的本地项目文件夹,因为当我做一个简单的 git的状态,没有 *。DB 文件中列出后,创建成功。

First question: I see all over the web /data/data/PKG/databases/ but where exactly is this stored on a windows machine? It doesn't appear to be in my local project folder because when I do a simple git status, no *.db file is listed after the create is successful.

另外,如果我想清楚,这是一个简单的删除和仿真器就知道重新创建此?如果没有我怎样才能清除它从模拟器? (思iPhone在这儿,你必须删除并重新推应用到仿真器以清除了这一点,并有数据库重新创建的)

Also if I wanted to clear this is it a simple delete and the emulator will know to re create this? If not how can I clear it from the emulator? (thinking iPhone here where you had to delete and re-push the app to the simulator to clear this out and have the db re-created)

推荐答案

它保存在仿真器内部,而不是在你的机器(至少不是在一个地方,是方便)。只是用其删除亚洲开发银行

It's stored inside the emulator, not on your machine (at least, not in a place that is easily accessible). Just remove it using adb:

C:\> adb -e shell rm /data/data/com.example.package/databases/*.db

您也可以选择擦除用户数据选项启动模拟器AVD的时候,也可以卸载应用程序擦除所有数据,只是一个应用程序:

You can also choose the "Wipe user data" option when launching the emulator AVD, or you can uninstall the application to wipe all data for just that one app:

C:\> adb -e uninstall com.example.package

最后,你可以不卸载它,通过将设置一个给定的应用还只是清除用户数据>应用程序>管理应用程序...选择你的应用程序,然后点击清除数据按钮。

Finally, you can also just clear user data for a given application without uninstalling it, by going to Settings > Applications > Manage Applications... Select your application, then click the "Clear Data" button.

这篇关于如何找到并清除的SQLite数据库文件中的Andr​​oid(模拟器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆