Skip to content

Instantly share code, notes, and snippets.

@alexito4
Created September 4, 2012 08:10
Show Gist options
  • Save alexito4/3618340 to your computer and use it in GitHub Desktop.
Save alexito4/3618340 to your computer and use it in GitHub Desktop.
Easy acces to Android emulator database
#!/bin/sh
while :
do
./querydb.sh
sleep 2
done
#!/bin/sh
clear
# extrat db from emulator
/Users/user/android-sdks/platform-tools/adb pull /data/data/com.test.app/databases/database.db database.db
# config sql
echo ".mode column" >> commands.txt
echo ".headers on" >> commands.txt
# code
echo ".tables" >> commands.txt # show tables
echo "select * from table;" >> commands.txt
# exec sql
sqlite3 database.db < commands.txt
# remove
rm commands.txt
rm database.db
@alexito4
Copy link
Author

alexito4 commented Sep 4, 2012

Combine with this and you have the information automatically updated.

!/bin/sh

while :
do

./querydb.sh
sleep 2

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment