Last active
August 31, 2017 09:13
-
-
Save allenatwork/dd9b35a87872421416ba9d01432a5a56 to your computer and use it in GitHub Desktop.
Working with SQLite command in Android
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. adb shell | |
2. run-as your.package.name | |
3. chmod 777 databases/your_db | |
4. exit | |
5. cat /data/data/package.name/databases/your_db > /sdcard/des_db | |
6. exit | |
7. adb pull /sdcard/des_db |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. adb shell | |
2. run-as your.package.name -> auto cd to app folder | |
3. cd databases | |
4. sqlite3 your_db | |
5. try some command: .databases, .tables, insert, select | |
6. to quit: .quit -> enter | |
=================== | |
Count number of row: SELECT count(*) FROM COMPANY; | |
Delete all row of a talbe : delete from table_name; | |
Attach second database: attach database 'anh_viet_src.sqlite' as src |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment