为什么我会收到“sqlite3:未找到”消息当我尝试使用 adb shell 打开数据库时,已 root 的 Nexus One 上出现错误?

发布于 2024-09-17 22:16:57 字数 155 浏览 13 评论 0原文

# sqlite3 /data/data/com.moodme.android/databases/moodme
sqlite3 /data/data/com.moodme.android/databases/moodme
sqlite3: not found
# sqlite3 /data/data/com.moodme.android/databases/moodme
sqlite3 /data/data/com.moodme.android/databases/moodme
sqlite3: not found

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(6

无声情话 2024-09-24 22:16:58

在 Android 模拟器上,sqlite3 位于 /system/xbin 中。 Nexus One (Android 2.2) 上没有 /system/xbin。因此,我怀疑 Nexus One 上没有安装 sqlite3

On the Android emulator, sqlite3 is in /system/xbin. There is no /system/xbin on a Nexus One (Android 2.2). Hence, I suspect that sqlite3 is not installed on the Nexus One.

花期渐远 2024-09-24 22:16:58

从 evelio 的回答来看,我在将 sqlite3 文件推送到 /system/bin 时遇到了问题。因此,我将其推送到 /sdcard。

在这个帖子中,我找到了正确的解决方案(Kila 的答案):
如何在运行 Gingerbread 的 root NexusOne 上安装 sqlite3

$ adb push sqlite3 /sdcard/
$ adb shell
$ su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# dd if=/sdcard/sqlite3 of=/system/bin/sqlite3
# chmod 4755 /system/bin/sqlite3
# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system 

它适用于我的 Samsung Galaxy S II 2.3.3。

From the answer of evelio, I had problem to push the sqlite3 file to /system/bin. So, instead, I have pushed it to the /sdcard.

In this thread I found the right Solution (answer of Kila):
How can I install sqlite3 on rooted NexusOne runs Gingerbread

$ adb push sqlite3 /sdcard/
$ adb shell
$ su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# dd if=/sdcard/sqlite3 of=/system/bin/sqlite3
# chmod 4755 /system/bin/sqlite3
# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system 

It works on my Samsung Galaxy S II with 2.3.3.

节枝 2024-09-24 22:16:58

要在非 ROOTED 设备上安装 sqlite3,这里有一种方法已被证明在我的 Galaxy S3, FYR 上有效。

$ adb -e pull /system/xbin/sqlite3  # get sqlite3 binary from emulator with the same CPU arch.
$ adb -d push sqlite3 /mnt/sdcard   # push it
$ adb -d shell
$ run-as <PACKAGE_NAME>             # run as your app, which should be debuggable.
$ cd databases; pwd
/data/data/<PACKAGE_NAME>/databases
$ cat /mnt/sdcard/sqlite3 > sqlite3 # copy it to internal storage directory
$ ls -l sqlite3
-rw-rw-rw- u0_a138  u0_a138     36860 2014-03-26 06:37 sqlite3
$ chmod 777 sqlite3                 # change mode bits, to be executable

$ ./sqlite3                         # now it works on your NON-ROOTED device
SQLite version 3.7.11 2012-03-20 11:35:50
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>

To install sqlite3 on NON-ROOTED devices, here is a way that has been proved working on my Galaxy S3, FYR.

$ adb -e pull /system/xbin/sqlite3  # get sqlite3 binary from emulator with the same CPU arch.
$ adb -d push sqlite3 /mnt/sdcard   # push it
$ adb -d shell
$ run-as <PACKAGE_NAME>             # run as your app, which should be debuggable.
$ cd databases; pwd
/data/data/<PACKAGE_NAME>/databases
$ cat /mnt/sdcard/sqlite3 > sqlite3 # copy it to internal storage directory
$ ls -l sqlite3
-rw-rw-rw- u0_a138  u0_a138     36860 2014-03-26 06:37 sqlite3
$ chmod 777 sqlite3                 # change mode bits, to be executable

$ ./sqlite3                         # now it works on your NON-ROOTED device
SQLite version 3.7.11 2012-03-20 11:35:50
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
路还长,别太狂 2024-09-24 22:16:58

在 Nexus 4 上执行以下操作:

adb shell
$ su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# dd if=/sdcard/sqlite3 of=/system/xbin/sqlite3
# chmod 777 /system/xbin/sqlite3
# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system

注意文件夹为 /system/xbin,chmod 为 777

On the Nexus 4 do the following :

adb shell
$ su
# mount -o remount,rw -t yaffs2 /dev/block/mtdblock3 /system
# dd if=/sdcard/sqlite3 of=/system/xbin/sqlite3
# chmod 777 /system/xbin/sqlite3
# mount -o remount,ro -t yaffs2 /dev/block/mtdblock3 /system

Notice the folder is /system/xbin and the chmod is 777

雪落纷纷 2024-09-24 22:16:58

一些可能对解决此问题有所帮助的信息

对于那些想知道从哪里获取可工作的 sqilte3 文件二进制文件进行复制的人:

您可以使用模拟器来获取可工作的二进制文件。您必须先检查您的版本是否基于_86、_64或ARM并复制此映像,否则您可能会得到不兼容的版本,从而导致错误。

检查您的 Android 设备版本

https://www.quora.com/How-can-I-check-whether-my-Android-phone-is-32-bit-or-64-位

在 android studio 中构建 ARM

Android Studio - 如何使用 ARM 而不是 HAXM 制作 AVD?

然后,使用下面的注释在您的计算机之间移动文件并返回到 Android 设备。

使 adb 可写

Android 模拟器 sdcard 推送错误:只读文件系统

将文件从adb复制到本地设备计算机

如何使用 adb pull 从 Android 复制选定的文件

在 root 设备 nexus 4 上,这些包含本页说明的链接有效。希望它能帮助某人。关键是你需要通过adb挂载才能获得设备的写入权限。

Some more information that may help someone about this issue

For the people who wonder where to get a working sqilte3 file binary to copy:

You can use the emulator to get a working binary. You must before check if your build is based on _86, _64, or ARM and replicate this image or you may get an incompatible version that will cause an err.

Checking which version is your android device

https://www.quora.com/How-can-I-check-whether-my-Android-phone-is-32-bit-or-64-bit

Building ARM in android studio

Android Studio - How Can I Make an AVD With ARM Instead of HAXM?

Then, use the notes below to move files between your machine and back to the android device.

Making adb writable

Android Emulator sdcard push error: Read-only file system

Copying files from adb to local device machine

How to copy selected files from Android with adb pull

On a rooted device nexus 4 these links with the instruction on this page worked. Hope it helps someone. The key is you need to mount to get writing permission in the device via adb.

心的憧憬 2024-09-24 22:16:57

作为替代方案(尽管可能不安全,甚至不是个好主意),您始终可以将 sqlite3 二进制文件上传到 /system/bin 这对我有用:

首先让我们挂载 /system/ 允许

$ adb shell
$ su
# mount -o remount,rw /system

在另一个终端中读/写 (rw) 将目录 (cd) 更改为 sqlite3 所在位置,然后将其推

$ ls
sqlite3
$ adb push sqlite3 /sdcard/

送到另一个 shell 现在让我们复制并更改权限 现在

# cat /sdcard/sqlite3 > /system/bin/sqlite3
# chmod 4755 /system/bin/sqlite3

现在让我们以只读方式挂载 /system/

# mount -o remount,ro /system

我们可以从 shell 使用 sqlite3:

# sqlite3 /data/data/com.telly/databases/fun.db
SQLite version 3.7.4
Enter ".help" for instructions
sqlite> .tables
android_metadata  lulz               

注意我正在使用 sqlite3 “SuperOneClickv1.6.5-ShortFuse”附带的二进制文件

您始终可以从模拟器中提取 sqlite3 二进制文件:

启动模拟器,然后从终端

$ adb pull /system/xbin/sqlite3

如果您像我一样懒,您可以 在这里下载 ICS 或之前的版本Jelly Bean 及更高版本

确保使用适合您的 Android 版本的版本,因为您可能会在执行时遇到 eloc_library[1306]: 14446 无法定位 'sqlite3_enable_load_extension'... 或类似错误

As an alternative (may not be secure or even good idea though) you can always upload the sqlite3 binary to /system/bin this worked for me:

First lets mount /system/ to allow read/write (rw)

$ adb shell
$ su
# mount -o remount,rw /system

in another terminal change directory (cd) to where sqlite3 is and lets push it

$ ls
sqlite3
$ adb push sqlite3 /sdcard/

Now back to the other shell lets copy and change permissions of the binary

# cat /sdcard/sqlite3 > /system/bin/sqlite3
# chmod 4755 /system/bin/sqlite3

Now lets mount back /system/ as read only (ro)

# mount -o remount,ro /system

And now we can use sqlite3 from shell:

# sqlite3 /data/data/com.telly/databases/fun.db
SQLite version 3.7.4
Enter ".help" for instructions
sqlite> .tables
android_metadata  lulz               

Note: I'm using the sqlite3 binary that comes with "SuperOneClickv1.6.5-ShortFuse"

You can always pull sqlite3 binary from emulator:

Start an emulator and then from a terminal

$ adb pull /system/xbin/sqlite3

If you are lazy like me you can download one right here for ICS or before or for Jelly Bean and later here

Make sure to use the proper one for your Android version as you may get eloc_library[1306]: 14446 cannot locate 'sqlite3_enable_load_extension'... or similar errors on execute

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文