pull 到電腦的當前路徑下
push 到安卓系統文件路徑
查看sdcard剩余存儲空間 檢查文件系統的磁盤空間占用情況。
adb shell df?
格式:df [選項]? ? ?說明:df命令可顯示所有文件系統對I節點和磁盤塊的使用情況。
命令中各個選項的含義:
df -a:顯示所有文件系統的磁盤使用情況,包括0塊(block)的文件系統。
df -h:以容易理解的格式輸出文件系統大小,例如124KB、345MB、46GB。
df -i:顯示i節點信息,而不是磁盤塊。
df -t:顯示各指定類型的文件系統的磁盤空間使用情況。
df -x:列出不是某一指定類型文件系統的磁盤空間使用情況。
df -T:顯示文件系統類型。
df 以512字節為單位
df –k 以1024字節為單位.
adb logcat? 命令,這個命令會輸出Log的格式為:
日志時間,進程號,線程號,Log級別,TAG(標簽),Log內容
感謝其他作者:主干來源簡書作者;ps命令部分 來自簡書
shell 是(殼)交互,例如:你用Windows系統連接安卓手機,但是你不能直接通過Windows命令操作 Android系統
adb 命令是什么?adb的全稱為Android Debug Bridge.是android司機經常用到的工具.
adb devices -l? ? 查看連接到pc設備的手機 序列號、型號、名稱、傳輸id,然后通過:adb -s <串列號>shell 指定設備,什么時候使用這個命令,當一個電腦連接多個手機時,分別操作:如下圖序列號是33301995 。就是說:當多手機共同連接你的pc時,你想要操作手機時,先告訴電腦你選的那個序列號,如果只有一個設備,不需要指定,就是默認的;操作如下
adb install :將電腦上的apk包安裝到手機上
格式:adb? install? -參數? "路徑下\包名"? ? ? ? 注意命令間的一個空格,參數可省略,參數起到權限和強制安裝的作用,如果你的手機,權限比較放開了,不加參數也可以。因地制宜!
例如:adb? install? ?-t? ?C:\Program Files\ss.apk 沒加雙引好可能會報錯,提示找不到路徑
例如:adb install -t "C:\Program Files\ss.apk"
官方參數解釋? -l: forward lock application、-r: replace existing application、-t: allow test packages、-i: specify the installer package name、-s: install application on sdcard、-f: install application on internal flash、-d: allow version code downgrade (debuggable packages only)、-p: partial application install、-g: grant all runtime permissions、-S: size in bytes of entire session
pc連接手機后,如何進入 手機,輸入adb shell? 。如下;進入root,需要先 adb root
華麗分割線,前面我還沒寫完,后面copy其他作者的和自己補充的,統一補全,方便Crtl+F查找
一. 基本指令
進入指定設備?adb -s serialNumber shell (注解:serialNumber 是序列號 見第一張圖)
查看版本?adb version
查看日志?adb logcat
查看設備?adb devices
連接狀態?adb get-state
啟動ADB服務?adb start-server
停止ADB服務?adb kill-server
電腦推送到手機?adb push local remote
手機拉取到電腦?adb pull remote local
二. adb shell下的am 與 pm 與 ps
注:am和pm和ps命令必須先進入shell(先輸入? adb shell) 才能使
am全稱activity manager,可以啟動Service、Broadcast,殺進程,監控等功能你能使用am去模擬各種系統的行為,例如去啟動一個activity,強制停止進程,發送廣播進程,修改設備屏幕屬性等等。
啟動app :am start -n {packageName}/.{activityName}
殺app的進程 :am kill
強制停止一切:am force-stop
啟動服務:am startservice
停止服務: am stopservice
打開簡書 :am start -a android.intent.action.VIEW -d http://www.lxweimin.com/
撥打10086 :am start -a android.intent.action.CALL -d tel:10086
介紹adb shell中一個很重要的命令pm(Package Manager),這個命令主要用于獲取和安裝在 Android 設備上的應用信息
windows PC 查找 :findstr? ? ? ? ? ? --------------? ? ? ? ? ? linux PC 查找:grep
? ? ? pm list packages [-f] [-d] [-e] [-s] [-3] [-i] [-u] [--user USER_ID] [FILTER]
? ? ? pm list permission-groups
? ? ? pm list permissions [-g] [-f] [-d] [-u] [GROUP]
? ? ? pm list instrumentation [-f] [TARGET-PACKAGE]
? ? ? pm list features
? ? ? pm list libraries
? ? ? pm list users
? ? ? pm path PACKAGE
? ? ? pm dump PACKAGE
? ? ? pm install [-lrtsfd] [-i PACKAGE] [PATH]
? ? ? pm install-create [-lrtsfdp] [-i PACKAGE] [-S BYTES]
? ? ? pm install-write [-S BYTES] SESSION_ID SPLIT_NAME [PATH]
? ? ? pm install-commit SESSION_ID
? ? ? pm install-abandon SESSION_ID
? ? ? pm uninstall [-k] [--user USER_ID] PACKAGE
? ? ? pm set-installer PACKAGE INSTALLER
? ? ? pm clear [--user USER_ID] PACKAGE
? ? ? pm enable [--user USER_ID] PACKAGE_OR_COMPONENT
? ? ? pm disable [--user USER_ID] PACKAGE_OR_COMPONENT
? ? ? pm disable-user [--user USER_ID] PACKAGE_OR_COMPONENT
? ? ? pm disable-until-used [--user USER_ID] PACKAGE_OR_COMPONENT
? ? ? pm hide [--user USER_ID] PACKAGE_OR_COMPONENT
? ? ? pm unhide [--user USER_ID] PACKAGE_OR_COMPONENT
? ? ? pm grant PACKAGE PERMISSION
? ? ? pm revoke PACKAGE PERMISSION
? ? ? pm set-install-location [0/auto] [1/internal] [2/external]
? ? ? pm get-install-location
? ? ? pm set-permission-enforced PERMISSION [true|false]
? ? ? pm trim-caches DESIRED_FREE_SPACE
? ? ? pm create-user [--profileOf USER_ID] [--managed] USER_NAME
? ? ? pm remove-user USER_ID
? ? ? pm get-max-users
官方英文描述
pm list packages: prints all packages, optionally only
? those whose package name contains the text in FILTER.? Options:
? ? -f: see their associated file.
? ? -d: filter to only show disbled packages.
? ? -e: filter to only show enabled packages.
? ? -s: filter to only show system packages.
? ? -3: filter to only show third party packages.
? ? -i: see the installer for the packages.
? ? -u: also include uninstalled packages.
pm list permission-groups: prints all known permission groups.
pm list permissions: prints all known permissions, optionally only
? those in GROUP.? Options:
? ? -g: organize by group.
? ? -f: print all information.
? ? -s: short summary.
? ? -d: only list dangerous permissions.
? ? -u: list only the permissions users will see.
pm list instrumentation: use to list all test packages; optionally
? supply <TARGET-PACKAGE> to list the test packages for a particular
? application.? Options:
? ? -f: list the .apk file for the test package.
pm list features: prints all features of the system.
pm list users: prints all users on the system.
pm path: print the path to the .apk of the given PACKAGE.
pm dump: print system state associated with the given PACKAGE.
pm install: install a single legacy package
pm install-create: create an install session
? ? -l: forward lock application
? ? -r: replace existing application
? ? -t: allow test packages
? ? -i: specify the installer package name
? ? -s: install application on sdcard
? ? -f: install application on internal flash
? ? -d: allow version code downgrade
? ? -p: partial application install
? ? -S: size in bytes of entire session
pm install-write: write a package into existing session; path may
? be '-' to read from stdin
? ? -S: size in bytes of package, required for stdin
pm install-commit: perform install of fully staged session
pm install-abandon: abandon session
pm set-installer: set installer package name
pm uninstall: removes a package from the system. Options:
? ? -k: keep the data and cache directories around after package removal.
pm clear: deletes all data associated with a package.
pm enable, disable, disable-user, disable-until-used: these commands
? change the enabled state of a given package or component (written
? as "package/class").
pm grant, revoke: these commands either grant or revoke permissions
? to applications.? Only optional permissions the application has
? declared can be granted or revoked.
pm get-install-location: returns the current install location.
? ? 0 [auto]: Let system decide the best location
? ? 1 [internal]: Install on internal device storage
? ? 2 [external]: Install on external media
pm set-install-location: changes the default install location.
? NOTE: this is only intended for debugging; using this can cause
? applications to break and other undersireable behavior.
? ? 0 [auto]: Let system decide the best location
? ? 1 [internal]: Install on internal device storage
? ? 2 [external]: Install on external media
pm trim-caches: trim cache files to reach the given free space.
pm create-user: create a new user with the given USER_NAME,
? printing the new user identifier of the user.
pm remove-user: remove the user with the given USER_IDENTIFIER,
? deleting all data associated with that user
adb shell ps(Process status )查看進程狀態的命令,該命令顯示瞬間進程的狀態
簡單用法,直接adb shell ps命令
$ adb shell ps --help
usage: ps [-AadefLlnwZ] [-gG GROUP,] [-k FIELD,] [-o FIELD,] [-p PID,] [-t TTY,] [-uU USER,]
List processes.
Which processes to show (selections may be comma separated lists):
-A? ? ? All processes
-a? ? ? Processes with terminals that aren't session leaders
-d? ? ? All processes that aren't session leaders
-e? ? ? Same as -A
-g? ? ? Belonging to GROUPs
-G? ? ? Belonging to real GROUPs (before sgid)
-p? ? ? PIDs (--pid)
-P? ? ? Parent PIDs (--ppid)
-s? ? ? In session IDs
-t? ? ? Attached to selected TTYs
-T? ? ? Show threads
-u? ? ? Owned by USERs
-U? ? ? Owned by real USERs (before suid)
Output modifiers:
-k? ? ? Sort FIELDs in +increasing or -decreasting order (--sort)
-M? ? ? Measure field widths (expanding as necessary)
-n? ? ? Show numeric USER and GROUP
-w? ? ? Wide output (don't truncate fields)
Which FIELDs to show. (Default = -o PID,TTY,TIME,CMD)
-f? ? ? Full listing (-o USER:12=UID,PID,PPID,C,STIME,TTY,TIME,ARGS=CMD)
-l? ? ? Long listing (-o F,S,UID,PID,PPID,C,PRI,NI,ADDR,SZ,WCHAN,TTY,TIME,CMD)
-o? ? ? Output FIELDs instead of defaults, each with optional :size and =title
-O? ? ? Add FIELDS to defaults
-Z? ? ? Include LABEL
Command line -o fields:
? ARGS? ? CMDLINE minus initial path? ? CMD? Command (thread) name (stat[2])
? CMDLINE? Command line (argv[])? ? ? ? ? COMM Command filename (/proc/$PID/exe)
? COMMAND? Command file (/proc/$PID/exe)? NAME Process name (argv[0] of $PID)
Process attribute -o FIELDs:
? ADDR? Instruction pointer? ? ? ? ? ? ? BIT? Is this process 32 or 64 bits
? CPU? Which processor running on? ? ? ? ETIME? Elapsed time since PID start
? F? ? Flags (1=FORKNOEXEC 4=SUPERPRIV)? GID? ? Group id
? GROUP Group name? ? ? ? ? ? ? ? ? ? ? ? LABEL? Security label
? MAJFL Major page faults? ? ? ? ? ? ? ? MINFL? Minor page faults
? NI? ? Niceness (lower is faster)
? PCPU? Percentage of CPU time used? ? ? PCY? ? Android scheduling policy
? PGID? Process Group ID
? PID? Process ID? ? ? ? ? ? ? ? ? ? ? ? PPID? ? Parent Process ID
? PRI? Priority (higher is faster)? ? ? PSR? ? Processor last executed on
? RGID? Real (before sgid) group ID? ? ? RGROUP? Real (before sgid) group name
? RSS? Resident Set Size (pages in use)? RTPRIO? Realtime priority
? RUID? Real (before suid) user ID? ? ? ? RUSER? Real (before suid) user name
? S? ? Process state:
? ? ? ? R (running) S (sleeping) D (device I/O) T (stopped)? t (traced)
? ? ? ? Z (zombie)? X (deader)? x (dead)? ? ? K (wakekill) W (waking)
? SCHED Scheduling policy (0=other, 1=fifo, 2=rr, 3=batch, 4=iso, 5=idle)
? STAT? Process state (S) plus:
? ? ? ? < high priority? ? ? ? ? N low priority L locked memory
? ? ? ? s session leader? ? ? ? + foreground? l multithreaded
? STIME Start time of process in hh:mm (size :19 shows yyyy-mm-dd hh:mm:ss)
? SZ? ? Memory Size (4k pages needed to completely swap out process)
? TCNT? Thread count? ? ? ? ? ? ? ? ? ? ? TID? ? Thread ID
? TIME? CPU time consumed? ? ? ? ? ? ? ? TTY? ? Controlling terminal
? UID? User id? ? ? ? ? ? ? ? ? ? ? ? ? USER? ? User name
? VSZ? Virtual memory size (1k units)? ? %VSZ? ? VSZ as % of physical memory
? WCHAN What are we waiting in kernel for
示例:
localhost:~ name$ adb shell ps
USER? ? ? PID? PPID? VSIZE? RSS? WCHAN? ? ? ? ? ? ? PC? NAME
root? ? ? 1? ? 0? ? 5368? 1492? SyS_epoll_ 0000000000 S /init
root? ? ? 2? ? 0? ? 0? ? ? 0? ? ? kthreadd 0000000000 S kthreadd
root? ? ? 3? ? 2? ? 0? ? ? 0? ? smpboot_th 0000000000 S ksoftirqd/0
root? ? ? 5? ? 2? ? 0? ? ? 0? ? worker_thr 0000000000 S kworker/0:0H
root? ? ? 7? ? 2? ? 0? ? ? 0? ? smpboot_th 0000000000 S migration/0
root? ? ? 8? ? 2? ? 0? ? ? 0? ? rcu_gp_kth 0000000000 S rcu_preempt
root? ? ? 9? ? 2? ? 0? ? ? 0? ? rcu_gp_kth 0000000000 S rcu_bh
root? ? ? 56? ? 2? ? 0? ? ? 0? ? down_timeo 0000000000 D blackbox_main_t
shell? ? 14905 4519? 5996? 1312? ? ? ? ? 0 7f9b3f4114 R ps
各字段的含義:
USER進程當前用戶
PID進程ID
PPID父進程ID
VSIZE進程的虛擬內存大小,以KB為單位
RSS實際占用的內存大小,以KB為單位
WCHAN進程正在睡眠的內核函數名稱;該函數的名稱是從/root/system.map文件中獲得的。
PCProgram Counter
NAME進程狀態及名稱
休眠進程:這個是進程的狀態,從上面打印的內容中可看出進程的狀態
進程狀態有不同的值:
D - 不可中斷的睡眠態。
R – 運行態
S – 睡眠態
T – 被跟蹤或已停止
Z – 僵尸態
W -? 進入內存交換(從內核2.6開始無效)
X? - 死掉的進程
< -? 高優先級
N? -? 低優先級
L? - 有些頁被鎖進內存
s? -? 包含子進程
l? -? 多線程,克隆線程
*+ - 位于后臺的進程組? ? ? ? ? ? ? ? ? *
program counter:計算機中提供要從[存儲器]中取出的下一個指令地址的[寄存器]
ps 命令參數:-P -p -t -x -c [pid] [name]
-P 顯示調度策略,通常是bg或fg,當獲取失敗將會是un和er
-p 顯示進程的優先級和nice等級
-t 顯示進程下的線程列表
-x 顯示進程耗費的用戶時間和系統時間,格式:(u:0, s:0),單位:秒(s)
-c 顯示進程耗費的CPU時間 (可能不兼容Android 4.0以前的老版本系統)
[pid] 過濾指定的進程PID
[name] 過濾指定的進程NAME
ps xxx 顯示過濾指定名稱的進程
和Linux的ps不同,Linux的ps命令可以這樣子:ps -aux,Android上ps的參數并不能一起使用,如ps -txPc.
查看進程調度等級
localhost:~ name$adb shell ps -P
USER? ? ? PID? PPID? VSIZE? RSS? PCY WCHAN? ? ? ? ? ? ? PC? NAME
root? ? ? 1? ? 0? ? 5368? 1492? fg? SyS_epoll_ 0000000000 S /init
root? ? ? 3056? 1? ? 4280? 476? tv? SyS_epoll_ 0000000000 S /sbin/healthd
u0_a58? ? 5183? 3261? 1939580 86688 bg? SyS_epoll_ 0000000000 S com.huawei.secime
比之前打印的內容多出了一列PCY,表示進程的調度等級
Android進程調度狀態:
1.foreground process
2.visible process
3.Service process
4.background process
5.empty process
作者:IT楓
鏈接:http://www.lxweimin.com/p/d18ed08b40c4
來源:簡書
簡書著作權歸作者所有,任何形式的轉載都請聯系作者獲得授權并注明出處。
三. 模擬用戶事件
文本輸入:adb shell input text
例:手機端輸出demo字符串,相應指令:adb shell input "demo".
鍵盤事件:input keyevent ,其中KEYCODE見本文結尾的附表
例:點擊返回鍵,相應指令: input keyevent 4.
點擊事件:input tap
例:?點擊坐標(500,500),相應指令: input tap 500 500.
滑動事件:?input swipe
例:?從坐標(300,500)滑動到(100,500),相應指令: input swipe 300 500 100 500.
例:?200ms時間從坐標(300,500)滑動到(100,500),相應指令: input swipe 300 500 100 500 200.
循環 shell命令:
四. logcat日志
顯示包含的logcat?logcat \| grep
顯示包含,并忽略大小寫的logcat?logcat \| grep -i
讀完所有log后返回,而不會一直等待?logcat -d
清空log并退出?logcat -c
打印最近的count?logcat -t
格式化輸出Log,其中format有如下可選值:?logcat -v
brief — 顯示優先級/標記和原始進程的PID (默認格式)
process — 僅顯示進程PID
tag — 僅顯示優先級/標記
thread — 僅顯示進程:線程和優先級/標記
raw — 顯示原始的日志信息,沒有其他的元數據字段
time — 顯示日期,調用時間,優先級/標記,PID
long —顯示所有的元數據字段并且用空行分隔消息內容
五. 常用節點
查看節點值,例如:cat /sys/class/leds/lcd-backlight/brightness
修改節點值,例如:echo 128 > sys/class/leds/lcd-backlight/brightness
LPM:?echo N > /sys/modue/lpm_levels/parameters/sleep_disabled
亮度:/sys/class/leds/lcd-backlight/brightness
CPU:?/sys/devices/system/cpu/cpu0/cpufreq
GPU:?/sys/class/ kgsl/kgsl-3d0/gpuclk
限頻:cat /data/pmlist.config
電流:?cat /sys/class/power_supply/battery/current_now
查看Power:?dumpsys power
WIFI :data/misc/wifi/wpa_supplicant.conf
持有wake_lock:?echo a> sys/power/wake_lock
釋放wake_lock:echo a> sys/power/wake_unlock
查看Wakeup_source:?cat sys/kernel/debug/wakeup_sources
Display(關閉AD):mv /data/misc/display/calib.cfg /data/misc/display/calib.cfg.bak 重啟
關閉cabc:echo 0 > /sys/device/virtual/graphics/fb0/cabc_onoff
打開cabc:echo 3 > /sys/device/virtual/graphics/fb0/cabc_onoff
systrace:sdk/tools/monitor
限頻:echo /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq 1497600
當出現read-only 且 remount命令不管用時:adb shell mount -o rw,remount /
進入9008模式:?adb reboot edl
查看高通gpio:sys/class/private/tlmm 或者 sys/private/tlmm
查看gpio占用情況:sys/kernle/debug/gpio
六. 遠程ADB
為避免使用數據線,可通過wifi通信,前提是手機與PC處于同一局域網
啟動方法:
adb tcpip5555//這一步,必須通過數據線把手機與PC連接后再執行? adb connect <手機IP>
停止方法:
adb disconnect//斷開wifi連接adb usb//切換到usb模式
七. 常用操作示例
查看當前?ls
打印當前路徑?pwd
查看當前連接的設備?adb devices
終止adb服務進程?adb kill-server
重啟adb服務進程?adb start-server
PID是:8607 查看某個進程的日志?adb logcat -v process |grep 8607
清理緩存?logcat -c
打印xys標簽log?adb logcat -s xys
打印192.168.56.101:5555設備里的xys標簽log?adb -s 192.168.56.101:5555 logcat -s xys
打印在ActivityManager標簽里包含start的日志?adb logcat -s ActivityManager | findstr "START"
"-s"選項 : 設置輸出日志的標簽, 只顯示該標簽的日志;
"-f"選項 : 將日志輸出到文件, 默認輸出到標準輸出流中, -f 參數執行不成功;
"-r"選項 : 按照每千字節輸出日志, 需要 -f 參數, 不過這個命令沒有執行成功;
"-n"選項 : 設置日志輸出的最大數目, 需要 -r 參數, 這個執行 感覺 跟 adb logcat 效果一樣;
"-v"選項 : 設置日志的輸出格式, 注意只能設置一項;
"-c"選項 : 清空所有的日志緩存信息;
"-d"選項 : 將緩存的日志輸出到屏幕上, 并且不會阻塞;
"-t"選項 : 輸出最近的幾行日志, 輸出完退出, 不阻塞;
"-g"選項 : 查看日志緩沖區信息;
"-b"選項 : 加載一個日志緩沖區, 默認是 main, 下面詳解;
"-B"選項 : 以二進制形式輸出日志;
重啟機器?adb reboot
獲取序列號?adb get-serialno
重啟到bootloader,即刷機模式?adb reboot bootloader
重啟到recovery,即恢復模式?adb reboot recovery
安裝APK:adb install //比如:adb install baidu.apk
安裝apk到sd卡:?adb install -s // 比如:adb install -s baidu.apk
卸載APK:adb uninstall //比如:adb uninstall com.baidu.search
獲取機器MAC地址?adb shell cat /sys/class/net/wlan0/address
啟動應用:adb shell am start -n /. 例如:adb shell am start -n yf.o2o.store/yf.o2o.store.activity.LoginActivity
查看占用內存排序?adb shell? top
查看占用內存前6的app:adb shell top -m 6
刷新一次內存信息,然后返回:adb shell top -n 1
查詢各進程內存使用情況:adb shell procrank
殺死一個進程:adb shell kill [pid]
查看進程列表:adb shell ps
查看指定進程狀態:adb shell ps -x [PID]
查看后臺services信息:?adb shell service list
查看當前內存占用:?adb shell cat /proc/meminfo
查看IO內存分區:adb shell cat /proc/iomem
將system分區重新掛載為可讀寫分區:adb remount
從本地復制文件到設備:?adb push
從設備復制文件到本地:?adb pull
列出目錄下的文件和文件夾,等同于dos中的dir命令:adb shell ls
進入文件夾,等同于dos中的cd 命令:adb shell cd
重命名文件:?adb shell rename path/oldfilename path/newfilename
刪除system/avi.apk:?adb shell rm /system/avi.apk
刪除文件夾及其下面所有文件:adb shell rm -r
移動文件:adb shell mv path/file newpath/file
設置文件權限:adb shell chmod 777 /system/fonts/DroidSansFallback.ttf
新建文件夾:adb shell mkdir path/foldelname
查看文件內容:adb shell cat
查看wifi密碼:adb shell cat /data/misc/wifi/*.conf
清除log緩存:adb logcat -c
查看bug報告:adb bugreport
獲取設備名稱:adb shell cat /system/build.prop
查看ADB幫助:adb help
跑monkey:
adb shell monkey -v -p your.package.name 500
adb -s 192.168.244.151:5555 shell monkey -v -p com.bolexim 500
八.附表
下表中, 箭頭左邊為keycode值,箭頭右邊為keycode的含義,部分用中文標注
0–> “KEYCODE_UNKNOWN”
1–> “KEYCODE_MENU”
2–> “KEYCODE_SOFT_RIGHT”
3–> “KEYCODE_HOME”//Home鍵
4–> “KEYCODE_BACK”//返回鍵
5–> “KEYCODE_CALL”
6–> “KEYCODE_ENDCALL”
7–> “KEYCODE_0”//數字鍵0
8–> “KEYCODE_1”
9–> “KEYCODE_2”
10–> “KEYCODE_3”
11–> “KEYCODE_4”
12–> “KEYCODE_5”
13–> “KEYCODE_6”
14–> “KEYCODE_7”
15–> “KEYCODE_8”
16–> “KEYCODE_9”
17–> “KEYCODE_STAR”
18–> “KEYCODE_POUND”
19–> “KEYCODE_DPAD_UP”
20–> “KEYCODE_DPAD_DOWN”
21–> “KEYCODE_DPAD_LEFT”
22–> “KEYCODE_DPAD_RIGHT”
23–> “KEYCODE_DPAD_CENTER”
24–> “KEYCODE_VOLUME_UP”//音量鍵+
25–> “KEYCODE_VOLUME_DOWN”//音量鍵-
26–> “KEYCODE_POWER”//Power鍵
27–> “KEYCODE_CAMERA”
28–> “KEYCODE_CLEAR”
29–> “KEYCODE_A”//字母鍵A
30–> “KEYCODE_B”
31–> “KEYCODE_C”
32–> “KEYCODE_D”
33–> “KEYCODE_E”
34–> “KEYCODE_F”
35–> “KEYCODE_G”
36–> “KEYCODE_H”
37–> “KEYCODE_I”
38–> “KEYCODE_J”
39–> “KEYCODE_K”
40–> “KEYCODE_L”
41–> “KEYCODE_M”
42–> “KEYCODE_N”
43–> “KEYCODE_O”
44–> “KEYCODE_P”
45–> “KEYCODE_Q”
46–> “KEYCODE_R”
47–> “KEYCODE_S”
48–> “KEYCODE_T”
49–> “KEYCODE_U”
50–> “KEYCODE_V”
51–> “KEYCODE_W”
52–> “KEYCODE_X”
53–> “KEYCODE_Y”
54–> “KEYCODE_Z”
55–> “KEYCODE_COMMA”
56–> “KEYCODE_PERIOD”
57–> “KEYCODE_ALT_LEFT”
58–> “KEYCODE_ALT_RIGHT”
59–> “KEYCODE_SHIFT_LEFT”
60–> “KEYCODE_SHIFT_RIGHT”
61-> “KEYCODE_TAB”
62–> “KEYCODE_SPACE”
63–> “KEYCODE_SYM”
64–> “KEYCODE_EXPLORER”
65–> “KEYCODE_ENVELOPE”
66–> “KEYCODE_ENTER”//回車鍵
67–> “KEYCODE_DEL”
68–> “KEYCODE_GRAVE”
69–> “KEYCODE_MINUS”
70–> “KEYCODE_EQUALS”
71–> “KEYCODE_LEFT_BRACKET”
72–> “KEYCODE_RIGHT_BRACKET”
73–> “KEYCODE_BACKSLASH”
74–> “KEYCODE_SEMICOLON”
75–> “KEYCODE_APOSTROPHE”
76–> “KEYCODE_SLASH”
77–> “KEYCODE_AT”
78–> “KEYCODE_NUM”
79–> “KEYCODE_HEADSETHOOK”
80–> “KEYCODE_FOCUS”
81–> “KEYCODE_PLUS”
82–> “KEYCODE_MENU”
83–> “KEYCODE_NOTIFICATION”
84–> “KEYCODE_SEARCH”