"sqlite3 not found"

在android开发时,使用adb shell 进行sqlite调试,出现“sqlite3 not found”错误信息。原因是手机里面/system/xbin/目录下没有sqlite3。从模拟器中pull一个出来,再push到手机中。具体方法如下:

原文:http://stackoverflow.com/questions/3645319/why-do-i-get-a-sqlite3-not-found-error-on-a-rooted-nexus-one-when-i-try-to-op

 

 

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.4Enter ".help" for instructions
sqlite> .tablesandroid_metadata  lulz              

You can always pull sqlite3 binary from emulator:

Start an emulator and then from a terminal

$ adb pull /system/xbin/sqlite3
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值