android - 访问终端以从 Android 执行查询

标签 android sqlite

如何从终端查询我的应用程序的 SQLite 数据库?

我需要它来进行调试,并检查值。

我尝试从模拟器命令行移动到/data/data//databases 文件夹并从那里执行“sqlite3”,但是 .database 命令没有返回我的数据库。

最佳答案

在你的sdk文件夹tools里有一个特殊的工具。它被称为 sqlite3。阅读更多 here .

您会在这里找到所有必要的信息,例如:

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

关于android - 访问终端以从 Android 执行查询,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5410049/

相关文章:

java - 在 Android Studio 中从 SQLite 数据库中以字符串形式检索数据

android - 从 android 中通过 sqlite 数据库进行不适当的搜索

android - Urban Airship 。使用/api/apids/method 获取 Android APID

java - 获取外部存储目录不起作用

android - 三星 Galaxy SIII 的相机是否存在缺陷?

java - 在哪里使用 JDBC 创建准备好的语句?

c - 将 SQLite FTS 扩展构建为 DLL 的正确方法是什么?

sql - 为什么在我的应用程序中没有返回行,而相同的查询在 DBBrowser 中返回行?

java - Libgdx - 处理同一 Actor 的不同动画

android - 使用 SimpleAdapter 将背景图像应用于 ListView