如何查看设备的Android SQLite数据库 [英] How to view the sqlite database in device android
问题描述
我有一组源码database.I数据需要查看device.How数据库做that.I在DDMS模式已检查,在文件浏览器中的数据是空的。
I have a set of data in sqlite database.I need to view the database in device.How to do that.I have checked in ddms mode,the data in file explorer is empty.
推荐答案
下面是一步一步的指示(大部分是取自其他答案的组合),这个工程即使在未root权限的设备。
Here are step by step instructions (mostly taken from a combination of the other answers) This works even on devices that are not rooted.
-
连接您的设备并启动在调试模式下的应用程序。
Connect your device and launch the application in debug mode.
您可能需要使用 ADB -d壳运行方式com.yourpackge.name LS /data/data/com.yourpackge.name/databases/"$c$ c>来查看数据库文件名是什么。
You may want to use adb -d shell "run-as com.yourpackge.name ls /data/data/com.yourpackge.name/databases/"
to see what the database filename is.
说明: com.yourpackge.name是你的应用程序包的名字,你可以从manifest文件得到它
Notice: com.yourpackge.name is your application package name, you can get it from the manifest file.
从您的应用程序文件夹复制数据库文件到你的SD卡。
Copy the database file from your application folder to your sd card.
亚行-d壳运行方式com.yourpackge.name猫/data/data/com.yourpackge.name/databases/filename.sqlite> /sdcard/filename.sqlite
adb -d shell "run-as com.yourpackge.name cat /data/data/com.yourpackge.name/databases/filename.sqlite > /sdcard/filename.sqlite"
请注意: filename.sqlite是当你创建的数据库,你用你的数据库名称
Notice: filename.sqlite is your database name you used when you created the database
拉出数据库文件到您的计算机:
Pull the database files to your machine:
亚行拉/sdcard/filename.sqlite
adb pull /sdcard/filename.sqlite
这将会从SD卡复制数据库到您的亚洲开发银行存在的地方。
This will copy the database from the sdcard to the place where your adb exist.
-
安装Firefox SQLLite经理:<一href="https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/">https://addons.mozilla.org/en-US/firefox/addon/sqlite-manager/
打开Firefox SQLLite管理器(工具 - > SQLite的经理),并从上面的步骤3打开数据库文件。
Open Firefox SQLLite Manager (Tools->SQLite Manager) and open your database file from step 3 above.
享受!
这篇关于如何查看设备的Android SQLite数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!