赞
踩
adb命令行操作Android 真机sqlite3数据库,可以直接通过adb shell来完成。但是前提条件必须是获取root权限。
# 获得root权限
adb root
adb remount
#拷贝sqlite3二进制文件到android真机中
adb push ~
/Downloads/sqlite/sqlite3
/system/xbin/
#然后改一下这个文件的权限
adb shell
chmod
4755
/system/xbin/sqlite3
#这个时候如果直接运行sqlite3还有问题,就需要拷贝libncurses.so到真机中
adb push ~
/Downloads/sqlite/libncurses
.so
/system/lib/
|
C:\Users\zqh>adb shell root@lte26007:/ # cd /mnt/shell/emulated/0/MMIData/ root@lte26007:/mnt/shell/emulated/0/MMIData # ls MMI.db MMI.db-journal tmk_load.db tmk_load.db-journal root@lte26007:/mnt/shell/emulated/0/MMIData # sqlite3 MMI.db SQLite version 3.7.11 2012-03-20 11:35:50 Enter ".help" for instructions Enter SQL statements terminated with a ";" sqlite> .tables TMK_load_tb android_metadata sqlite> select rowid,* from TMK_load_tb; 1|105330154110002|00000274|FA3BEC2125AC7E9F7EB97956FC945E1B|00|1 2|105330154110002|00000274|FA3BEC2125AC7E9F7EB97956FC945E1B|00|1 3|001653072770006|00000001|E679F69DC4CF5471E679F69DC4CF5471|00|1 4|001653063000054|00000006|E679F69DC4CF5471E679F69DC4CF5471|00|0 5|001653063000054|00000005|E679F69DC4CF5471E679F69DC4CF5471|00|0 6|001653063000054|00000004|E679F69DC4CF5471E679F69DC4CF5471|00|0 7|001653063000054|00000003|E679F69DC4CF5471E679F69DC4CF5471|00|0 8|001653063000054|00000002|E679F69DC4CF5471E679F69DC4CF5471|00|0 9|001653063000054|00000001|E679F69DC4CF5471E679F69DC4CF5471|00|0 sqlite> select * from TMK_load_tb; 105330154110002|00000274|FA3BEC2125AC7E9F7EB97956FC945E1B|00|1 105330154110002|00000274|FA3BEC2125AC7E9F7EB97956FC945E1B|00|1 001653072770006|00000001|E679F69DC4CF5471E679F69DC4CF5471|00|1 001653063000054|00000006|E679F69DC4CF5471E679F69DC4CF5471|00|0 001653063000054|00000005|E679F69DC4CF5471E679F69DC4CF5471|00|0 001653063000054|00000004|E679F69DC4CF5471E679F69DC4CF5471|00|0 001653063000054|00000003|E679F69DC4CF5471E679F69DC4CF5471|00|0 001653063000054|00000002|E679F69DC4CF5471E679F69DC4CF5471|00|0 001653063000054|00000001|E679F69DC4CF5471E679F69DC4CF5471|00|0
sqlite3还有很多命令,常用的有下面几个:
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。