0

Is there a way to connect to the SQLite database while the emulator is running and do manual queries against the database?

The following is a basic sequence of steps I'm looking to achieve:

  1. Query user table.
  2. Add a user via the program.
  3. Query user table to verify add successful.
4

2 回答 2

3

是的,甚至在 Android 开发者网站上也有指南。

在 adb 远程 shell 中,您可以使用 sqlite3 命令行程序来管理由 Android 应用程序创建的 SQLite 数据库。

请注意,您还可以使用 DDMS 从模拟器中复制数据库文件,然后使用SQLiteStudio等工具对其进行检查。

于 2013-04-17T15:25:56.493 回答
0

This is an old question but if anyone still looking for this then Facebook Stetho is the best tool for debugging DB related stuff: http://facebook.github.io/stetho/

Only downside is that you need to add a couple of line to your gradle script and application class. But well worth it.

于 2016-07-27T23:06:05.210 回答