Running from the command-line on a Windows 10 PC, and I'm having a problem with quotation marks:
adb shell su -c "sqlite3 /data/data/com.android.chrome/app_chrome/Default/Cookies 'select count(*) from cookies;'"
adb shell su -c sqlite3 /data/data/com.android.chrome/app_chrome/Default/Cookies 'select count(*) from cookies;'
adb shell su -c sqlite3 /data/data/com.android.chrome/app_chrome/Default/Cookies "select count(*) from cookies;"
adb shell su -c "sqlite3 /data/data/com.android.chrome/app_chrome/Default/Cookies 'select * from cookies;'"
adb shell su -c "sqlite3 /data/data/com.android.chrome/app_chrome/Default/Cookies .schema"
And going into ADB shell works:
>adb shell
/ $ su
/ # sqlite3 /data/data/com.android.chrome/app_chrome/Default/Cookies 'select count(*) from cookies;'
3238
I simply want to get the results of a query from the command-line.
What am I missing?
Try this:
adb shell su -c sqlite3 /data/data/com.android.chrome/app_chrome/Default/Cookies "\"select count(*) from cookies;\""
or
query="\"select count(*) from cookies;\""
adb shell su -c sqlite3 /data/data/com.android.chrome/app_chrome/Default/Cookies "$query"
I guess the problem is with the double quotes. I am still not quite sure why those double quotes are needed within the query, but this is most certainly to work.
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.