在shell中使用Sqlite3

 

Examining sqlite3 Databases from a Remote Shell

From an adb remote shell, you can use the  sqlite3 command-line program to  manage SQLite databases created by Android applications. The sqlite3tool includes many useful commands, such as .dumpto print out the contents of a table and .schemato print the SQL CREATE statement for an existing table.  The tool also gives you the ability to execute SQLite commands on the fly.

To usesqlite3, enter a remote shell on the emulator instance, as described above, then invoke the tool using thesqlite3command. Optionally, when invokingsqlite3you can specify the full path to the database you want to explore. Emulator/device instances store SQLite3 databases in the folder/data/data/<package_name>/databases/.

Here's an example:

$ adb -s emulator-5554 shell
# sqlite3 /data/data/com.example.google.rss.rssexample/databases/rssitems.db
SQLite version 3.3.12
Enter ".help" for instructions
.... enter commands, then quit...
sqlite> .exit


Once you've invokedsqlite3, you can issuesqlite3commands in the shell. To exit and return to the adb remote shell, useexitorCTRL+D.

转载于:https://my.oschina.net/cuitongliang/blog/153318

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值