简体   繁体   中英

Why can't I push sqlite into Android using adb command?

I have a rooted Nexus S and it doesn't have Sqlite installed so I googled it and found I need to use this command:

adb push sqlite3 /sdcard/

However it gave me this error:

failed to copy 'sqlite3' to '/sdcard//sqlite3': Read-only file system

So that means the /system is read only. Then I searched it and found that I need to remount my /system folder as rw. I used this command in the adb shell:

mount -o rw,remount -t yaffs2 /dev/block/mtdblock5 /system

I still cannot push Sqlite3 and it produces the same error as before in the command line window. I then typed

root@android:/ # mount

But all I can see is the /system is mounted differently:

/dev/block/platform/s3c-sdhci.0/by-name/system /system ext4 rw,relatime,barrier=
1,data=ordered 0 0

How can I mount my system folder as "rw" and push the sqlite3 into my Android phone?

Maybe you can try another location. The script I used to root my phone was placing its stuff on the /data/local/ after creating a tmp folder:

adb shell "cd /data/local && mkdir tmp"
adb push sqlite3 /data/local/tmp/.
adb shell "chmod 755 /data/local/tmp/sqlite3"
adb shell "cp /data/local/tmp/sqlite3 /system/bin/sqlite3"
adb shell "cd /data/local/tmp && rm *"

In fact, the two answers are mandatory. If we set only

adb shell "cd /data/local && mkdir tmp"
adb push sqlite3 /data/local/tmp/.
adb shell "chmod 755 /data/local/tmp/sqlite3"
adb shell "cp /data/local/tmp/sqlite3 /system/bin/sqlite3"
adb shell "cd /data/local/tmp && rm *"

We have the same error

Read-only file system

So, before copy the sqlite3 to /system/bin/sqlite3, we must add the following line:

mount -o rw,remount -t yaffs2 /dev/block/mtdblock5 /system

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM