Abdelhafid Madoui Abdelhafid Madoui - 13 days ago 6
Android Question

Can I make this a One-liner solution with ADB or Windows Batch?

Can I get those three lines in a one-liner solution from windows cmd or in a windows batch file ?

adb shell
sqlite3 /data/data/my.package.name/databases/myDb.db
SELECT value1, value2 FROM Table1;


I was thinking this is it; but i can't figure how to write it exactly

adb shell sqlite3 /data/data/my.package.name/databases/myDb.db | SELECT value1, value2 FROM Table1;

Answer

Assuming your phone is rooted (or has engineering build loaded):

adb shell "sqlite3 /data/data/my.package.name/databases/myDb.db 'SELECT value1, value2 FROM Table1;'"

Because otherwise shell user will not have access to /data/data/my.package.name/