Android:sqlite3:not found

1.问题描述:

Android中使用sqlite打开数据库,输入sqlite3,提示sqlite3:not found

Android:sqlite3:not found_第1张图片

2.问题分析:

出现sqlite3:not found是因为所使用的Android设备中没有sqlite3,可以打开DDMS中的File explorer,打开 /system/xbin 目录发现没有sqlite3 这个文件。

3.解决方法:

3.1.让/system文件夹可读写

adb shell # mount -o remount,rw -t /system

3.2.导入所需的sqlite3文件到/system/xbin目录。(可以新建个模拟器,从/system/xbin中导出sqlite3)
注意:所需的sqlite3文件必须和你所使用的模拟器或者真机的版本一致,否则会出现SQLite header and source version mismatch错误提示

Android:sqlite3:not found_第2张图片

adb push sqlite3 /system/xbin

3.3.修改 sqlite3 权限

chmod 4755 /system/xbin/sqlite3

3.4.设置 /system为只读文件

mount -o remount,ro -t  /system

3.5.至此,就可以使用 sqlite3 命令来操作 SQLite 数据库了。

Android:sqlite3:not found_第3张图片

你可能感兴趣的:(Android:sqlite3:not found)