我想看看在模拟器/data/data/com.android.provider.contacts 下面的contacts.db文件
我的想法是用adb shell把它拷贝出来,再用其它软件打开。
但是在adb shell中运行cp命令把它拷贝到D:\test
cp /data/data/com.android.provider.contacts/contacts.db d:\test 不行。
请各位告诉我一个可行的方法。
我的想法是用adb shell把它拷贝出来,再用其它软件打开。
但是在adb shell中运行cp命令把它拷贝到D:\test
cp /data/data/com.android.provider.contacts/contacts.db d:\test 不行。
请各位告诉我一个可行的方法。
解决方案 »
- 怎么让android 2.x支持actionBar和fragment
- 关于android sqlite的date类型排序问题
- Andriod sdk的安装问题
- 结帖率100% 再次发问 有关于android截取图像的问题 绝对有挑战
- 请问KeyEvent.KEYCODE中的哪个是表示小数点的?
- Android中如何设置字体格式!!!
- httppost请求获取上传进度问题
- android:theme="@android:style/Theme.NoTitleBar"
- android 5.0的摄像头类修改了吗?
- 初学andriod 开发,求高手指导
- Touch Email icon on homescreen, fore close.
- viewpager中使用viewpager,怎么监听到里面的viewpager的事件
先弄到d:盘到拷到别的地方吧查看db文件的话可以用SQLite Database Browser
下载地址:
http://sourceforge.net/projects/sqlitebrowser/
而且里面也没有people表啊
“关键是我的databases目录下没有contacts。db文件啊,只有个contacts2.db”我的也只有contacts2.db,一楼回复时参考楼主给的参数没有把2写上
“而且里面也没有people表啊”
楼主哪看的contacts2.db有people表,如果要查联系人资料的话,可以在raw_contacts中查
学习,我想问下怎么从sql状态中回到adb shell呢??
SQLite version 3.6.22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .help
.help
.backup ?DB? FILE Backup DB (default "main") to FILE
.bail ON|OFF Stop after hitting an error. Default OFF
.databases List names and files of attached databases
.dump ?TABLE? ... Dump the database in an SQL text format
If TABLE specified, only dump tables matching
LIKE pattern TABLE.
.echo ON|OFF Turn command echo on or off
.exit Exit this program
.explain ?ON|OFF? Turn output mode suitable for EXPLAIN on or off.
With no args, it turns EXPLAIN on.
.genfkey ?OPTIONS? Options are:
--no-drop: Do not drop old fkey triggers.
--ignore-errors: Ignore tables with fkey errors
--exec: Execute generated SQL immediately
See file tool/genfkey.README in the source
distribution for further information.
.header(s) ON|OFF Turn display of headers on or off
.help Show this message
.import FILE TABLE Import data from FILE into TABLE
.indices ?TABLE? Show names of all indices
If TABLE specified, only show indices for tables
matching LIKE pattern TABLE.
.load FILE ?ENTRY? Load an extension library
.log FILE|off Turn logging on or off. FILE can be stderr/stdout
.mode MODE ?TABLE? Set output mode where MODE is one of:
csv Comma-separated values
column Left-aligned columns. (See .width)
html HTML <table> code
insert SQL insert statements for TABLE
line One value per line
list Values delimited by .separator string
tabs Tab-separated values
tcl TCL list elements
.nullvalue STRING Print STRING in place of NULL values
.output FILENAME Send output to FILENAME
.output stdout Send output to the screen
.prompt MAIN CONTINUE Replace the standard prompts
.quit Exit this program
.read FILENAME Execute SQL in FILENAME
.restore ?DB? FILE Restore content of DB (default "main") from FILE
.schema ?TABLE? Show the CREATE statements
If TABLE specified, only show tables matching
LIKE pattern TABLE.
.separator STRING Change separator used by output mode and .import
.show Show the current values for various settings
.tables ?TABLE? List names of tables
If TABLE specified, only list tables matching
LIKE pattern TABLE.
.timeout MS Try opening locked tables for MS milliseconds
.width NUM1 NUM2 ... Set column widths for "column" mode
.timer ON|OFF Turn the CPU timer measurement on or off
sqlite> .exit
.exit
# exit
exit
需要先导出来 推荐用firefox的SQL LITE插件查看
我创建了一个联系人Test1也添加了号码,为什么就看不到呢?
people表是以前的版本用的,如果你的数据库是contacts2.db那所有的数据都在 data 那个表里,raw_contacts也有点。有一个视图叫“view_data_restricted”,相关的东西都在里面了。
我试了试命令什么都没有显示D:\adb>adb shell
# sqlite
sqlite
sqlite: not found
# sqlite /data/data/com.android.providers.contacts/databases/contacts2.db
sqlite /data/data/com.android.providers.contacts/databases/contacts2.db
sqlite: not found
# sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db
sqlite3 /data/data/com.android.providers.contacts/databases/contacts2.db
SQLite version 3.6.22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> .tables
.tables
BigPhotoData properties
_sync_state raw_contacts
_sync_state_metadata settings
accounts status_updates
activities v1_settings
agg_exceptions view_contacts
android_metadata view_contacts_restricted
calls view_data
contact_entities_view view_data_restricted
contact_entities_view_restricted view_groups
contacts view_raw_contacts
data view_raw_contacts_restricted
groups view_v1_contact_methods
groups_photo_data view_v1_extensions
mimetypes view_v1_group_membership
name_lookup view_v1_groups
nickname_lookup view_v1_organizations
packages view_v1_people
phone_lookup view_v1_phones
pinyin view_v1_photos
sqlite> select * form data
select * form data
...> select * form view_data_restricted
select * form view_data_restricted
...>