palingenesis 发表于 2013-1-30 01:18:46

android adb 练习

 
G:\Users\Window7>adb shell
#
 
# sqlite3 /data/data/com.example.android.notepad/databases/note_pad.db
sqlite3 /data/data/com.example.android.notepad/databases/note_pad.db
SQLite version 3.6.22
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite>
 
sqlite> .help
.help
.backup ?DB? FILE      Backup DB (default "main") to FILE
.bail ON|OFF           Stop after hitting an error.  Default OFF
.databases             List names and files of attached databases
.dump ?TABLE? ...      Dump the database in an SQL text format
                         If TABLE specified, only dump tables matching
                         LIKE pattern TABLE.
.echo ON|OFF           Turn command echo on or off
.exit                  Exit this program
.explain ?ON|OFF?      Turn output mode suitable for EXPLAIN on or off.
                         With no args, it turns EXPLAIN on.
.genfkey ?OPTIONS?     Options are:
                         --no-drop: Do not drop old fkey triggers.
                         --ignore-errors: Ignore tables with fkey errors
                         --exec: Execute generated SQL immediately
                       See file tool/genfkey.README in the source
                       distribution for further information.
.header(s) ON|OFF      Turn display of headers on or off
.help                  Show this message
.import FILE TABLE     Import data from FILE into TABLE
.indices ?TABLE?       Show names of all indices
                         If TABLE specified, only show indices for tables
                         matching LIKE pattern TABLE.
.load FILE ?ENTRY?     Load an extension library
.log FILE|off          Turn logging on or off.  FILE can be stderr/stdout
.mode MODE ?TABLE?     Set output mode where MODE is one of:
                         csv      Comma-separated values
                         column   Left-aligned columns.  (See .width)
                         html     HTML <table> code
                         insert   SQL insert statements for TABLE
                         line     One value per line
                         list     Values delimited by .separator string
                         tabs     Tab-separated values
                         tcl      TCL list elements
.nullvalue STRING      Print STRING in place of NULL values
.output FILENAME       Send output to FILENAME
.output stdout         Send output to the screen
.prompt MAIN CONTINUE  Replace the standard prompts
.quit                  Exit this program
.read FILENAME         Execute SQL in FILENAME
.restore ?DB? FILE     Restore content of DB (default "main") from FILE
.schema ?TABLE?        Show the CREATE statements
                         If TABLE specified, only show tables matching
                         LIKE pattern TABLE.
.separator STRING      Change separator used by output mode and .import
.show                  Show the current values for various settings
.tables ?TABLE?        List names of tables
                         If TABLE specified, only list tables matching
                         LIKE pattern TABLE.
.timeout MS            Try opening locked tables for MS milliseconds
.width NUM1 NUM2 ...   Set column widths for "column" mode
.timer ON|OFF          Turn the CPU timer measurement on or off
 
 
sqlite> .tables
.tables
android_metadata  notes
sqlite> select count(*) from notes;
select count(*) from notes;
2
 
------------- from web----------
sqlite> .schema phones 
.schema phones 
CREATE TABLE phones (_id INTEGER PRIMARY KEY,person INTEGER,type INTEGER,number TEXT,number_key TEXT,label TEXT); 
CREATE INDEX phonesIndex1 ON phones (person); 
CREATE INDEX phonesIndex2 ON phones (number_key); 
CREATE TRIGGER phones_delete DELETE ON phones BEGIN UPDATE people SET _sync_dirty=1 WHERE people._id=old.person;END; 
CREATE TRIGGER phones_insert INSERT ON phones BEGIN UPDATE people SET _sync_dirty=1 WHERE people._id=new.person;END; 
CREATE TRIGGER phones_update UPDATE ON phones BEGIN UPDATE people SET _sync_dirty=1 WHERE people._id=old.person;END; 
CREATE TRIGGER preferred_phone_cleanup DELETE ON phones BEGIN UPDATE people SET preferred_phone = NULL WHERE preferred_phone = old._id; END; 
 
源文档 < http://www.iteye.com/problems/14473>
 
 
http://developer.51cto.com/art/200906/131301.htm
Android db test
 
 
---------------------
卸载应用,后面参数跟package
adb uninstall com.example.android.snake
adb uninstall com.test
 
cd /data/app
m appName.apk
ls // 查看目录
date // 打印或设置当前系统时间
cat /proc/meminfo // 查看内存信息
cat /proc/cpuinfo // 查看CPU信息
 
adb get-product // 获取设备的ID  
adb get-serialno // 获取设备的序列号  
adb devices // 得当前运行的模拟器/设备的实例的列表及每个实例的状态  
adb bugreport // 查看bug报告
 
---------------------
C:\Users\Window7Of64Bit>adb shell
# cd data/data
cd data/data
# ls
ls
com.android02
com.android.settings
...
com.svox.pico
com.tetris
#
 
---------------------
--adb shell pm list packages 列出所有已经安装的包
#pm list packages
pm list packages
package:com.android.soundrecorder
package:com.android.inputmethod.latin
...
 
---------------------
 
adb install apk路径
页: [1]
查看完整版本: android adb 练习