C:\Users\test\AppData\Local\Android\Sdk\platform-tools>adb devices
List of devices attached
emulator-5554   device

C:\Users\test\AppData\Local\Android\Sdk\platform-tools>adb kill-server

C:\Users\test\AppData\Local\Android\Sdk\platform-tools>adb root
* daemon not running; starting now at tcp:5037
* daemon started successfully

C:\Users\test\AppData\Local\Android\Sdk\platform-tools>adb devices
List of devices attached
emulator-5554   device

C:\Users\test\AppData\Local\Android\Sdk\platform-tools>adb shell
generic_x86:/ # su

generic_x86:/ # ls -l /data/data/com.example.myapp.testdb_app/databases/
total 100
-rw-rw---- 1 u0_a85 u0_a85  4096 2019-05-08 08:13 TestDB
-rw------- 1 u0_a85 u0_a85 32768 2019-05-08 08:29 TestDB-shm
-rw------- 1 u0_a85 u0_a85 57712 2019-05-08 08:29 TestDB-wal

generic_x86:/ # cd /data/data/com.example.myapp.testdb_app/databases
generic_x86:/data/data/com.example.myapp.testdb_app/databases # 
generic_x86:/data/data/com.example.myapp.testdb_app/databases # sqlite3 TestDB
SQLite version 3.22.0 2018-01-22 18:45:57
Enter ".help" for usage hints.
sqlite>
sqlite> .databases
main: /data/data/com.example.myapp.testdb_app/databases/TestDB
temp:
sqlite>

sqlite> .schema
CREATE TABLE android_metadata (locale TEXT);
CREATE TABLE testdb_app_log (id integer primary key autoincrement, curr_time TIMESTAMP not null);
CREATE TABLE sqlite_sequence(name,seq);

-- Query Testing Data
sqlite> .header on
sqlite> select * from testdb_app_log;
id|curr_time
1|2019-05-08 08:14:58
2|2019-05-08 08:22:11
3|2019-05-08 08:29:32

-- Insert Testing Data
sqlite> insert into testdb_app_log(curr_time) values(DateTime('now'));
sqlite> select * from testdb_app_log;
id|curr_time
1|2019-05-08 08:14:58
2|2019-05-08 08:22:11
3|2019-05-08 08:29:32
4|2019-05-08 08:42:20

sqlite> .quit
1|generic_x86:/data/data/com.example.myapp.testdb_app/databases #


 

 

 

 

arrow
arrow
    文章標籤
    adb SQLite
    全站熱搜

    DanBrother 發表在 痞客邦 留言(0) 人氣()