<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-6506852281250910408</id><updated>2026-09-28T03:27:57.497-07:00</updated><category term="Roll out"/><title type='text'>Android Tech on control and test</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default?start-index=26&amp;max-results=25&amp;redirect=false'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>27</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-7866165298283110926</id><published>2014-05-22T00:04:00.000-07:00</published><updated>2014-05-26T18:20:15.678-07:00</updated><title type='text'>Using Shell Script on Android</title><content type='html'>&lt;b&gt;Preface&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Shell Script is a good tool to control Android device. You can run&amp;nbsp;the script&amp;nbsp;either by connecting PC or by disconnecting.PC. In order to enter Android&#39;s console mode, the ADB is required. Therefore, you can start to use Shell Script on Android. Shell Script is well known on Linux PC to do some scenario control. The kernel of Android is Linux Based. Hence, you can use similar script to control your Android device.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Let&#39;s learn how to run a Shell Script on Android at first. I&#39;ll give an example.&lt;br /&gt;
In begging, you need a edit tool for shell script on PC. GEdit is a good choice for you. Note that you need to save your shell script on Linux Format rather than Windows.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s get start on writing shell script to run on your Android.&lt;br /&gt;
=================================================&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#The comments you can write here follows #&lt;br /&gt;
#Assign Value 1 to variable named val&lt;br /&gt;
val=1&lt;br /&gt;
#Assign a String &quot;Hello World&quot; to a variable str1 by export command&lt;br /&gt;
export str1=&quot;Hello World&quot;&lt;br /&gt;
echo &quot;$str1&quot;&lt;br /&gt;
#Append a String to its variable by &quot;&lt;b&gt;:&lt;/b&gt;&quot;&lt;br /&gt;
export str1=$str1&lt;b&gt;:&lt;/b&gt;&quot; Hello World again&quot;&lt;br /&gt;
&lt;br /&gt;
#The Screen will show you &quot;Hello World Hello World again&quot;&lt;br /&gt;
echo &quot;$str1&quot;&lt;br /&gt;
&lt;br /&gt;
#The Screen will show you &quot;Hello World Hello World again&quot; by infinite loop&lt;br /&gt;
while [ true ]&lt;br /&gt;
do&lt;br /&gt;
&amp;nbsp; &amp;nbsp;echo &quot;$str1&quot;&lt;br /&gt;
done&lt;br /&gt;
=================================================&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Save this file as Linux format and push this file to Android device by following command.&lt;/b&gt;&lt;br /&gt;
adb push filename /data/local/tmp/&lt;br /&gt;
&lt;b&gt;Execute this shell by following command.&lt;/b&gt;&lt;br /&gt;
adb shell sh /data/local/tmp/filenmae&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;The output would be as follows,&lt;/b&gt;&lt;br /&gt;
Hello World&lt;br /&gt;
Hello World: Hello World again&lt;br /&gt;
Hello World: Hello World again&lt;br /&gt;
Hello World: Hello World again&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Note&lt;/b&gt;&lt;br /&gt;
It&#39;s unnecessary to have root permission to run the shell script if you place files in the folder of /data/local/tmp/ and don&#39;t use the none permitted command.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Keyword:&lt;/b&gt; Shell Script, Android</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/7866165298283110926/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2014/05/using-shell-script-on-android.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7866165298283110926'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7866165298283110926'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2014/05/using-shell-script-on-android.html' title='Using Shell Script on Android'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-2590299051256464232</id><published>2014-05-06T18:31:00.001-07:00</published><updated>2014-05-13T18:22:08.849-07:00</updated><title type='text'>在Android做LTP (Linux Test Project)測試</title><content type='html'>&lt;h2&gt;
&lt;b&gt;在Android做LTP (Linux Test Project)測試&lt;/b&gt;&lt;/h2&gt;
&lt;h3&gt;
&lt;b&gt;序:&lt;/b&gt;&lt;/h3&gt;
LTP是一個測試Linux核心的開源(Open Source)測試套件, 一開始由SGI發起, 由 IBM, Cisco, Fujitsu, SUSE, Red Hat 等公司開發與維護. 目前能持續的進版中. LTP針對Linux系統做可靠度, 強健度, 與穩定度做系統測試, 內涵許多的Test Case可供測試. 測試Linux伺服器時, 也可以採用這樣的測試套件來為你購買的硬體設備做燒機(Burn/Run in)測試.&lt;br /&gt;
&lt;br /&gt;
Android的底層核心是Linux系統, 可透過Android ADB的連線進到大家熟悉的Linux Console環境. LTP套件基本上的設計是基於PC的系統架構與權限條件. 但Android的架構與X86是不一樣的, 因此要把LTP佈署在Android的裝置上, 必須採用可在X86環境上編譯Android架構可用的編譯器(Compiler), 稱作跨平台編譯器(Cross Compiler). 由於LTP的源碼(Source Code)的架構與參數設定, 是給X86架構使用的, 因此在編譯前, 還必須做些參數上的調整.當中有相當多的觀念可以學習.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;介紹:&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;&lt;i&gt;環境建置:&lt;/i&gt;&lt;/b&gt;
在開始編譯一個合適你的Android系統測試用的LTP前, 環境建置是必須的. 以下分別介紹要安裝那些套件.&lt;br /&gt;
&lt;br /&gt;
1.&amp;nbsp;安裝Ubuntu64 bit在你的電腦上, 我是用12版.&lt;br /&gt;
2. 到 sourcery.mentor.com 下載&lt;a href=&quot;https://sourcery.mentor.com/GNUToolchain/package10933/public/arm-none-linux-gnueabi/arm-2012.09-64-arm-none-linux-gnueabi.bin&quot; target=&quot;_blank&quot;&gt;Cross Compiler&lt;/a&gt;.&amp;nbsp;也可以用新版的Cross Compiler.&lt;br /&gt;
3. 於Ubuntu上安裝以下套件.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;sudo apt-get install git-core flex bison gperf libesd0-dev libwxgtk2.6-dev zlib1g-dev build-essential libstdc++5 tofrodos&lt;/li&gt;
&lt;li&gt;sudo apt-get install x-dev&lt;/li&gt;
&lt;li&gt;sudo apt-get install libx11-dev&lt;/li&gt;
&lt;li&gt;sudo apt-get install libncurses5-dev&lt;/li&gt;
&lt;li&gt;sudo apt-get install libreadline-dev&lt;/li&gt;
&lt;li&gt;sudo apt-get install g++-multilib (build kernel用)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Ubuntu 64bit&lt;/li&gt;
&lt;li&gt;apt-get install ia32-libs ia32-libs-gtk&lt;/li&gt;
&lt;li&gt;sudo dpkg-reconfigure dash  Selection &#39;NO‘&lt;/li&gt;
&lt;li&gt;./arm-2012.09-64-arm-none-linux-gnueabi.bin&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
3. 於sourceforge.net下載LTP原始碼&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://sourceforge.net/projects/ltp/?source=dlp&quot;&gt;http://sourceforge.net/projects/ltp/?source=dlp&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
4. 編譯環境設定.&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;設定Cross Compiler的路徑到環境變數中. 以下路徑需要修改為你放置與安裝Cross Compiler的正確資料夾. &lt;span style=&quot;color: red;&quot;&gt;注意這些環境設定是適用於ARM平台.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
export PATH=$PATH:/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/&lt;/div&gt;
&lt;div&gt;
export CC=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-gcc&lt;/div&gt;
&lt;div&gt;
export LD=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-ld&lt;/div&gt;
&lt;div&gt;
export AR=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-ar&lt;/div&gt;
&lt;div&gt;
export LIB_DIR=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/lib&lt;/div&gt;
&lt;div&gt;
export AS=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-as&lt;/div&gt;
&lt;div&gt;
export RANLIB=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-ranlib&lt;/div&gt;
&lt;div&gt;
export STRIP=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;編譯與安裝LTP&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
1. 設定你的LTP.&lt;br /&gt;
./configure AR=arm-none-linux-gnueabi-ar CC=arm-none-linux-gnueabi-gcc RANLIB=arm-none-linux-gnueabi-ranlib STRIP=arm-none-linux-gnueabi-strip --host=arm-linux --target=arm-linux CFLAGS=&quot;-static&quot; LDFLAGS=&quot;-static -pthread“&lt;/div&gt;
&lt;div&gt;
2. 為了要讓LTP能順利在ARM平台下的Linux執行, 需要做一些參數上的調整. 這邊參考了網路一些零碎的資料, 實做了, 是可行的. 以下以20120104的LTP版本為例. 實驗過2013版本也是可行的.&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;在 ltp-full-20120104/testcases/kernel/controllers/libcontrollers/libcontrollers.h 裡增加 LINE_MAX 的 define, 這邊是設定為 255.&lt;/li&gt;
&lt;li&gt;將 ltp-full-20120104/testcases/kernel/fs/fs-bench 裡 random-access.c, random-del-create.c &amp;amp; random-access-del-create.c 這三個檔案裡的 openlog[] 陣列名稱修改成其他的名稱, 避免衝突.&lt;/li&gt;
&lt;li&gt;在 ltp-full-20120104/testcases/kernel/sched/sched_stress/sched_driver.c 和 ltp-full-20120104/testcases/kernel/fs/ftest/libftest.c 這兩個檔案裡, 增加 PATH_MAX 的 define 值, 這裡是設定成 1024.&lt;/li&gt;
&lt;li&gt;在 ltp-full-20120104/testcases/kernel/sched/cfs-scheduler/hackbench.c 裡加上 PTHREAD_STACK_MIN 的 define, 這兒是設成 1024.&lt;/li&gt;
&lt;li&gt;make&lt;/li&gt;
&lt;li&gt;make install prefix=/[Install Folder]&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/div&gt;
3. 開始編譯與安裝在指定的資料夾. 這會需要一段很長的時間, 視電腦速度而異. 編譯出來約1GByte的大小. 若只有100M上下的檔案大小, 就是沒有編譯成功.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;make&lt;/li&gt;
&lt;li&gt;make install prefix=/[Install Folder]&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;i&gt;佈署LTP到你的Android裝置&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
1. 下載Busybox, 並且推到你的Android中. 因為Android裝置內的Linux指令已經精簡過了, 因此少了很多Shell Command. 你需要補強幾個LTP會用到的Linux Shell Command.&lt;br /&gt;
adb push busybox /data/local/tmp&lt;br /&gt;
2. 把編譯出的LTP整個資料夾推送到Android裝置內的/data/local/tmp/資料夾.&lt;br /&gt;
3. 讓你的Busybox內的command可以實體化. 以下只舉幾個例子, 最好可以把busybox內的所有command都做一次以下動作.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;busybox ln -f busybox readlink&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox basename&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox mktemp&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox dirname&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox grep&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox sed&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox awk&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox head&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox free&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox uname&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
4. 於Android ADB命令列下設定執行LTP環境. 例如我編譯出的LTP都推到Android內的 /data/local/tmp/LTP13/資料夾內.&lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;export PATH=/data/local/tmp/busyboxdir:$PATH&lt;/li&gt;
&lt;li&gt;export PATH=/data/local/tmp/LTP13:$PATH&lt;/li&gt;
&lt;li&gt;export PATH=/data/local/tmp/LTP13/testcases/bin:$PATH&lt;/li&gt;
&lt;li&gt;export PATH=/data/local/tmp/LTP13/runtest:$PATH&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;b&gt;&lt;i&gt;開始執行LTP&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;i&gt;sh ./runltp -p -l 130326report1ipc.log -o 130326output1ipc.log &amp;nbsp;-d /data/local/tmp/LTP13/tmp -f ipc&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;後記&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
由於LTP的Source Code中有些程式碼不符合Android的一些限制, 需要做修改後方可正常執行. 若有興趣的人, 在留言板上留言, 我們再來討論吧.&lt;br /&gt;
&lt;br /&gt;
至於LTP的Soruce Code是用甚麼語言寫的, 主要分為兩種, 一種是C語言, 另外一種是Shell Script配合Shell Command執行.&lt;br /&gt;
&lt;h3&gt;
&lt;b&gt;參考資料:&lt;/b&gt;&lt;/h3&gt;
&lt;b&gt;Internet Q&amp;amp;A&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;關鍵字: LTP, Android, Linux Test Project, Stress Test, Android Reliability, Automation Test.&lt;/b&gt;
&lt;a href=&quot;http://line.naver.jp/R/msg/text/?Android%E4%B8%8A%E7%9A%84Linux%E6%A0%B8%E5%BF%83%E4%BF%A1%E8%B3%B4%E5%BA%A6%E6%B8%AC%E8%A9%A6%E6%8A%80%E8%A1%93%E5%85%AC%E9%96%8Bhttp://android-test-tw.blogspot.tw/2014/05/ltpandroid.html&quot;&gt;分享到Line&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/2590299051256464232/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2014/05/ltpandroid.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/2590299051256464232'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/2590299051256464232'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2014/05/ltpandroid.html' title='在Android做LTP (Linux Test Project)測試'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-7644444590843938111</id><published>2014-05-06T18:07:00.000-07:00</published><updated>2014-05-25T18:20:04.841-07:00</updated><title type='text'>Linux Test Project (LTP) on Android</title><content type='html'>&lt;h2&gt;
&lt;b&gt;Perform LTP on Android&lt;/b&gt;&lt;/h2&gt;
&lt;h3&gt;
&lt;b&gt;Preface&lt;/b&gt;&lt;/h3&gt;
&lt;a href=&quot;https://github.com/linux-test-project/ltp/wiki&quot; target=&quot;_blank&quot;&gt;LTP WiKi said, &lt;/a&gt;&quot;The Linux Test Project is a joint project started by SGI, developed and maintained by IBM, Cisco, Fujitsu, SUSE, Red Hat and others, that has a goal to deliver test suites to the open source community that validate the reliability, robustness, and stability of Linux. The LTP testsuite contains a collection of tools for testing the Linux kernel and related features.&quot;&lt;br /&gt;
&lt;br /&gt;
The kernel layer of Android is based on Linux. User can connect to Linux Console by Android ADB. Download the LTP from official website, it can run on Linux PC. However, it can not run on ARM platform such as Android because of its original design on X86. Therefore, if you would like to use LTP on Android, the Cross Compiler is required.&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;b&gt;Introduction&lt;/b&gt;&lt;/h3&gt;
&lt;b&gt;&lt;i&gt;Configuration Environment&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
1. Prepare a PC and install Ubuntu64 bit on it. (version 12 is applicable.)&lt;br /&gt;
2. Download the&amp;nbsp;&lt;a href=&quot;https://sourcery.mentor.com/GNUToolchain/package10933/public/arm-none-linux-gnueabi/arm-2012.09-64-arm-none-linux-gnueabi.bin&quot; target=&quot;_blank&quot;&gt;Cross Compiler&lt;/a&gt;&amp;nbsp;from sourcery.mentor.com. (Newer version is applicable.)&lt;br /&gt;
3. Install following program on Ubuntu&lt;br /&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;sudo apt-get install git-core flex bison gperf libesd0-dev libwxgtk2.6-dev zlib1g-dev build-essential libstdc++5 tofrodos&lt;/li&gt;
&lt;li&gt;sudo apt-get install x-dev&lt;/li&gt;
&lt;li&gt;sudo apt-get install libx11-dev&lt;/li&gt;
&lt;li&gt;sudo apt-get install libncurses5-dev&lt;/li&gt;
&lt;li&gt;sudo apt-get install libreadline-dev&lt;/li&gt;
&lt;li&gt;sudo apt-get install g++-multilib (For build kernel)&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Ubuntu 64bit&lt;/li&gt;
&lt;li&gt;apt-get install ia32-libs ia32-libs-gtk&lt;/li&gt;
&lt;li&gt;sudo dpkg-reconfigure dash  Selection &#39;NO‘&lt;/li&gt;
&lt;li&gt;./arm-2012.09-64-arm-none-linux-gnueabi.bin&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
3. Download LTP source code from sourceforge.net&lt;/div&gt;
&lt;div&gt;
&lt;a href=&quot;http://sourceforge.net/projects/ltp/?source=dlp&quot;&gt;http://sourceforge.net/projects/ltp/?source=dlp&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
4. Environment settings for Cross Compiler&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;You need to modify the file path for your own. Note that settings here is for ARM platform&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;div&gt;
export PATH=$PATH:/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/&lt;/div&gt;
&lt;div&gt;
export CC=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-gcc&lt;/div&gt;
&lt;div&gt;
export LD=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-ld&lt;/div&gt;
&lt;div&gt;
export AR=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-ar&lt;/div&gt;
&lt;div&gt;
export LIB_DIR=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/lib&lt;/div&gt;
&lt;div&gt;
export AS=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-as&lt;/div&gt;
&lt;div&gt;
export RANLIB=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-ranlib&lt;/div&gt;
&lt;div&gt;
export STRIP=/home/carl/CodeSourcery/Sourcery_CodeBench_Lite_for_ARM_GNU_Linux/bin/arm-none-linux-gnueabi-strip&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;i&gt;Compile and install LTP&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
1. Configuration&lt;br /&gt;
./configure AR=arm-none-linux-gnueabi-ar CC=arm-none-linux-gnueabi-gcc RANLIB=arm-none-linux-gnueabi-ranlib STRIP=arm-none-linux-gnueabi-strip --host=arm-linux --target=arm-linux CFLAGS=&quot;-static&quot; LDFLAGS=&quot;-static -pthread“&lt;/div&gt;
&lt;div&gt;
2. Some values of parameter should be changed for ARM platform. Here I illustrate what should be changed by the version in 2012. (The version of 2013 is applicable)&lt;/div&gt;
&lt;div&gt;
&lt;ul&gt;
&lt;li&gt;Find and edit the file ltp-full-20120104/testcases/kernel/controllers/libcontrollers/libcontrollers.h and add one line for LINE_MAX and define its value as 255.&lt;/li&gt;
&lt;li&gt;Change the varialbe name of array in&amp;nbsp;random-access.c, random-del-create.c and random-access-del-create.c which files are located at&amp;nbsp;ltp-full-20120104/testcases/kernel/fs/fs-bench/&lt;/li&gt;
&lt;li&gt;Find and edit the files named ltp-full-20120104/testcases/kernel/sched/sched_stress/sched_driver.c and ltp-full-20120104/testcases/kernel/fs/ftest/libftest.c and add one line for PATH_MAX and define its value as1024.&lt;/li&gt;
&lt;li&gt;Find and edit the file ltp-full-20120104/testcases/kernel/sched/cfs-scheduler/hackbench.c and add one line for PTHREAD_STACK_MIN and define its value as 1024.&lt;/li&gt;
&lt;li&gt;make&lt;/li&gt;
&lt;li&gt;make install prefix=/[Install Folder]&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
3. After the install, there are some files in your Install Folder and the total file size is about 1GByte. It takes long time to perform compiling work.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;&lt;i&gt;Deploy LTP into your Android device&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
1. Download Busybox and push it to your Android in order to have necessary shell command on Android. adb push busybox /data/local/tmp&lt;br /&gt;
2. Push all the installed LTP folder (Install Folder) to Android. I always push the files to /data/local/tmp.&lt;br /&gt;
3. &lt;b&gt;Ln&lt;/b&gt; all the command from busybox. Following examples only shows you some pieces, you need to ln all the commands that busybox have.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;busybox ln -f busybox readlink&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox basename&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox mktemp&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox dirname&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox grep&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox sed&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox awk&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox head&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox free&lt;/li&gt;
&lt;li&gt;busybox ln -f busybox uname&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
4. Setting the LTP variable environment in Adroid. You need to change the path to where your file located in Android.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;export PATH=/data/local/tmp/busyboxdir:$PATH&lt;/li&gt;
&lt;li&gt;export PATH=/data/local/tmp/LTP13:$PATH&lt;/li&gt;
&lt;li&gt;export PATH=/data/local/tmp/LTP13/testcases/bin:$PATH&lt;/li&gt;
&lt;li&gt;export PATH=/data/local/tmp/LTP13/runtest:$PATH&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;b&gt;&lt;i&gt;Run LTP on Android&lt;/i&gt;&lt;/b&gt;&lt;br /&gt;
&lt;i&gt;sh ./runltp -p -l 130326report1ipc.log -o 130326output1ipc.log &amp;nbsp;-d /data/local/tmp/LTP13/tmp -f ipc&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;h3&gt;
&lt;b&gt;Reference&lt;/b&gt;&lt;/h3&gt;
&lt;b&gt;Internet Q&amp;amp;A&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;b&gt;Keyword: LTP, Android, Linux Test Project, Stress Test, Android Reliability, Automation Test.&lt;/b&gt;&amp;nbsp;&lt;a href=&quot;http://line.naver.jp/R/msg/text/?Android%E4%B8%8A%E7%9A%84Linux%E6%A0%B8%E5%BF%83%E4%BF%A1%E8%B3%B4%E5%BA%A6%E6%B8%AC%E8%A9%A6%E6%8A%80%E8%A1%93%E5%85%AC%E9%96%8Bhttp://android-test-tw.blogspot.tw/2014/05/ltpandroid.html&quot;&gt;Share to Line&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/7644444590843938111/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2014/05/would-you-like-to-know-how-to-build-ltp.html#comment-form' title='18 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7644444590843938111'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7644444590843938111'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2014/05/would-you-like-to-know-how-to-build-ltp.html' title='Linux Test Project (LTP) on Android'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>18</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-1728978550901816339</id><published>2013-01-02T00:39:00.000-08:00</published><updated>2013-04-23T00:33:40.204-07:00</updated><title type='text'>Android Power State Information Acquired</title><content type='html'>&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Introduction&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;Android Power state can be found by using console/ADB command - adb shell dumpsys power, then the message would be printed as follows,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;Power Manager State:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mIsPowered=true mPowerState=3 mScreenOffTime=958909 ms&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mPartialCount=1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mWakeLockState=SCREEN_BRIGHT_BIT SCREEN_ON_BIT&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mUserState=&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mPowerState=SCREEN_BRIGHT_BIT SCREEN_ON_BIT&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mLocks.gather=SCREEN_BRIGHT_BIT SCREEN_ON_BIT&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mNextTimeout=66689 now=1022321 -955s from now&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mDimScreen=true mStayOnConditions=3 mPreparingForScreenOn=false mSkippedScreenOn=false&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mScreenOffReason=2 mUserState=0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mBroadcastQueue={-1,-1,-1}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mBroadcastWhy={0,0,0}&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mPokey=0 mPokeAwakeonSet=false&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mKeyboardVisible=false mUserActivityAllowed=false&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mKeylightDelay=6000 mDimDelay=47000 mScreenOffDelay=7000&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mPreventScreenOn=false &amp;nbsp;mScreenBrightnessOverride=-1 &amp;nbsp;mButtonBrightnessOverride=-1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mScreenOffTimeoutSetting=60000 mMaximumScreenOffTimeout=2147483647&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mLastScreenOnTime=1019715&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mBroadcastWakeLock=UnsynchronizedWakeLock(mFlags=0x1 mCount=0 mHeld=false)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mStayOnWhilePluggedInScreenDimLock=UnsynchronizedWakeLock(mFlags=0x6 mCount=0 mHeld=true)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mStayOnWhilePluggedInPartialLock=UnsynchronizedWakeLock(mFlags=0x1 mCount=0 mHeld=true)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mPreventScreenOnPartialLock=UnsynchronizedWakeLock(mFlags=0x1 mCount=0 mHeld=false)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mProximityPartialLock=UnsynchronizedWakeLock(mFlags=0x1 mCount=0 mHeld=false)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mProximityWakeLockCount=0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mProximitySensorEnabled=false&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mProximitySensorActive=false&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mProximityPendingValue=-1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mLastProximityEventTime=0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mLightSensorEnabled=false mLightSensorAdjustSetting=0.0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mLightSensorValue=-1.0 mLightSensorPendingValue=-1.0&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mHighestLightSensorValue=-1 mWaitingForFirstLightSensor=false&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mLightSensorPendingDecrease=false mLightSensorPendingIncrease=false&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mLightSensorScreenBrightness=-1 mLightSensorButtonBrightness=-1 mLightSensorKeyboardBrightness=-1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mUseSoftwareAutoBrightness=true&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; mAutoBrightessEnabled=false&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;mScreenBrightnessAnimator:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; animating: start:0, end:102, duration:960, current:102&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; startSensorValue:-1 endSensorValue:-1&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; startTimeMillis:1019791 now:1022324&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; currentMask:SCREEN_BRIGHT_BIT&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;mLocks.size=3:&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; SCREEN_DIM_WAKE_LOCK &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;StayOnWhilePluggedIn Screen Dim&#39; activated (minState=1, uid=1000, pid=622)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; PARTIAL_WAKE_LOCK &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&#39;StayOnWhilePluggedIn Partial&#39; activated (minState=0, uid=1000, pid=622)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&amp;nbsp; FULL_WAKE_LOCK &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &#39;keyguard&#39;ACQUIRE_CAUSES_WAKEUP &amp;nbsp;activated (minState=3, uid=1000, pid=622)&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace; font-size: x-small;&quot;&gt;mPokeLocks.size=0:&lt;/span&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;The power state is listed by parameter&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;mPowerState which has the flag value as follows,&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: &#39;Courier New&#39;, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol class=&quot;linenums&quot; style=&quot;background-color: white; color: grey; font-family: monospace; font-size: 10.666666984558105px; line-height: 10.666666984558105px; margin-bottom: 0px; margin-top: 0px; white-space: pre;&quot;&gt;
&lt;li class=&quot;L6&quot; style=&quot;list-style-type: decimal;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;// flags for setPowerState&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L7&quot; style=&quot;list-style-type: decimal;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; ALL_LIGHTS_OFF &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0x00000000&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L8&quot; style=&quot;list-style-type: decimal;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; SCREEN_ON_BIT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0x00000001&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L9&quot; style=&quot;list-style-type: decimal;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; SCREEN_BRIGHT_BIT &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0x00000002&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L0&quot; style=&quot;list-style-type: decimal;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; BUTTON_BRIGHT_BIT &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0x00000004&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L1&quot; style=&quot;list-style-type: decimal;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; KEYBOARD_BRIGHT_BIT &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0x00000008&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L2&quot; style=&quot;list-style-type: decimal;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; BATTERY_LOW_BIT &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;lit&quot; style=&quot;color: #006666;&quot;&gt;0x00000010&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;If device is on suspend mode, it would print 0 for mPowerState parameter.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;When device is on screen on mode, the value 3 is shown for parameter mPowerState because of following reason.&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;ol class=&quot;linenums&quot; style=&quot;background-color: white; color: grey; font-family: monospace; font-size: 10.666666984558105px; line-height: 10.666666984558105px; margin-bottom: 0px; margin-top: 0px; white-space: pre;&quot;&gt;
&lt;li class=&quot;L2&quot; style=&quot;list-style-type: decimal;&quot;&gt;&lt;span class=&quot;com&quot; style=&quot;color: #880000;&quot;&gt;// SCREEN_BRIGHT == screen on, screen backlight bright&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&lt;/span&gt;&lt;/li&gt;
&lt;li class=&quot;L3&quot; style=&quot;background-color: #eeeeee; background-position: initial initial; background-repeat: initial initial; list-style-type: decimal;&quot;&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt;&amp;nbsp; &amp;nbsp; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;private&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;static&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;final&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; &lt;/span&gt;&lt;span class=&quot;kwd&quot; style=&quot;color: #000088;&quot;&gt;int&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; SCREEN_BRIGHT &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;=&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; SCREEN_ON_BIT &lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;|&lt;/span&gt;&lt;span class=&quot;pln&quot; style=&quot;color: black;&quot;&gt; SCREEN_BRIGHT_BIT&lt;/span&gt;&lt;span class=&quot;pun&quot; style=&quot;color: #666600;&quot;&gt;;&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;where SCREEN_ON_BIT and SCREEN_BRIGHT_BIT are performed or operation.&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;References&lt;/span&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Courier New, Courier, monospace;&quot;&gt;https://android.googlesource.com/platform/frameworks/base/+/android-4.1.2_r1/services/java/com/android/server/PowerManagerService.java&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/1728978550901816339/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2013/01/android-power-state-information-acquired.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/1728978550901816339'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/1728978550901816339'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2013/01/android-power-state-information-acquired.html' title='Android Power State Information Acquired'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-7410462909654903134</id><published>2012-11-19T00:53:00.001-08:00</published><updated>2013-04-23T00:34:08.406-07:00</updated><title type='text'>Extending monkeyrunner with Plugins - Jar File</title><content type='html'>&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Preface&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;As you can see the description on Android Developer Site, you can extend MonkeyRunner by writing &amp;nbsp;java programming language and integrate to an Jar file and create more capacities for your control purpose. In following section, using 21 steps to guide you how to create a monkeyrunner extension JAR file.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;How to create a Jar component for MonkeyRunner?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Before we start to know how to create a Jar Component for MonkeyRunner, there&#39;re something you need to do in advance. The J2SDK installation on your computer is required and you need to know how to program &amp;nbsp;Java based program. Eclipse is an option, however it&#39;s very useful. Android SDK installation is required.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Here I&#39;ll show you an example by using Eclipse to create a Jar component for MonkeyRunner Extension.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;1. Using Eclipse to create a Java Project through File-&amp;gt;New-&amp;gt;Java Project. Fill the project name.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;2. Press Next button.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCmngyCEhqc0mFzbEuzJJ8bpM9PRE-Tgq5s_Ch1_naDUJEYr3B4GtWE2e1pssEmvkfRxS6u4dSqD0zFDfGGk5AmgokHkdElCRsSGme8fTTlIDKbySAUAmVd2GsqUTRdlLNdZOdwlC84YU/s1600/monkeyrunner-ext-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCmngyCEhqc0mFzbEuzJJ8bpM9PRE-Tgq5s_Ch1_naDUJEYr3B4GtWE2e1pssEmvkfRxS6u4dSqD0zFDfGGk5AmgokHkdElCRsSGme8fTTlIDKbySAUAmVd2GsqUTRdlLNdZOdwlC84YU/s1600/monkeyrunner-ext-1.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp;3. Tap Libraries.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGUcQhY3y4Q21TjDVY2r7uLe7Fxp12kbOjBdzyaZVZqL8aSTrjywkWK2VMbWmjohnnhSRcHmUmjJ2QqbJDuUmwmgr2Yl0EcyOUvkAzs2QqQNlUTyGVVxa7XPShq2ZxvRoEzwLjBgbhM74/s1600/monkeyrunner-ext-2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGUcQhY3y4Q21TjDVY2r7uLe7Fxp12kbOjBdzyaZVZqL8aSTrjywkWK2VMbWmjohnnhSRcHmUmjJ2QqbJDuUmwmgr2Yl0EcyOUvkAzs2QqQNlUTyGVVxa7XPShq2ZxvRoEzwLjBgbhM74/s1600/monkeyrunner-ext-2.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;4. Tap &quot;Add External JARs...&quot; button.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRCq_TvMGseM7063VVMAuAQQ4Ddx6rpJjm7iTMUfu_iCda6F2qU5vkta-vEkhtKpdeCIWfZdkWgofBD6Tk3MxdTUfVSPunN2Q0ojcCh2WxK-c5-4412YHt6XWzMNxWtxmXeeexRd_jIj0/s1600/monkeyrunner-ext-3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRCq_TvMGseM7063VVMAuAQQ4Ddx6rpJjm7iTMUfu_iCda6F2qU5vkta-vEkhtKpdeCIWfZdkWgofBD6Tk3MxdTUfVSPunN2Q0ojcCh2WxK-c5-4412YHt6XWzMNxWtxmXeeexRd_jIj0/s1600/monkeyrunner-ext-3.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;5. Add Jar files - Pick chimpchat.jar, guavalib.jar, jython.jar, and monkeyrunner.jar in the folder - /android_sdk_folder/tools/lib/.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;6. Press Finish button.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyppR2g6iIDtjIHwkav_nPFgyjApRWyrfdUxsSAqs14RnAqYWYsqhwYv1LTLdA8rsiC1cnTT07zK_qZn38G2ytiBqIyHdxOERff3D-oDbgDkQsSdW3NTLpZpy3hAKCci1gSQBAJkTmZXA/s1600/monkeyrunner-ext-4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyppR2g6iIDtjIHwkav_nPFgyjApRWyrfdUxsSAqs14RnAqYWYsqhwYv1LTLdA8rsiC1cnTT07zK_qZn38G2ytiBqIyHdxOERff3D-oDbgDkQsSdW3NTLpZpy3hAKCci1gSQBAJkTmZXA/s1600/monkeyrunner-ext-4.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;7. Fill the package name - com.android.monkeyrunner.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;8. Fill the&amp;nbsp;class&amp;nbsp;name.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;9. Press Finish button. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguFEOufmBU-1PjcTWeYk9XABZbdB7CRl5nvDaFHcENHqGLDDMzUZTNOOcLsRCm-8EMMD2B1fbb6Zqm2uo0CwAeugv5bJh7Zz0VZsGQ91bLT0aoYKnsbPAZcZI77knwMvL7NnOHiBGf9IU/s1600/monkeyrunner-ext-5.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEguFEOufmBU-1PjcTWeYk9XABZbdB7CRl5nvDaFHcENHqGLDDMzUZTNOOcLsRCm-8EMMD2B1fbb6Zqm2uo0CwAeugv5bJh7Zz0VZsGQ91bLT0aoYKnsbPAZcZI77knwMvL7NnOHiBGf9IU/s1600/monkeyrunner-ext-5.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;10.&amp;nbsp;&amp;nbsp;If you need to initial some variable for monkeyrunner runtime environment, you can implement a interface named&amp;nbsp;Predicate&lt;pythoninterpreter&gt; and write the initial thing in apply method.&lt;/pythoninterpreter&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;11. In this example, I create three static methods for interacting with Android device. They&#39;re tap, PressButton, and saveScreenToFile respectively. These functions are to trigger a touch event, and a button event, and to save run-time screen to a file. In order to implement these function to communicate with Android device, we need to import MonkyDevice and MonkeyImage classes. The usage is similar with what you wrote on monkeyrunner console to control Android devices. &lt;u style=&quot;color: red;&quot;&gt;The difference is that you need to use Python Object class for given parameters.&lt;/u&gt;&amp;nbsp;For instance, to invoke a touch event, you can use touch method in MonkeyDevice class. But you need to give a value which is belong to the type of PyObject. Hence, we declare a PyObject variable and assign two integer and one string as their values that is needed by declared PyObject variable. For given parameters, the two integer values are used to assign where to touch and the string value is used to assign which action we&#39;re going to use for touch event (E.g. DOWN, UP, or DOWN_AND_UP). Note that, you can not use &lt;i&gt;int &lt;/i&gt;as integer&#39;s type in PyObject&#39;s initialization.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;To assign an integer value to PyObject class, the type of PyInteger Object is needed.&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;To assign a string value to PyObject class, the type of PyString Object is needed.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjahhpS_Y4RErxB4kmThrKqqgUKQXkB6UJQDKXAgI9FCyTiEAMJ7Do7IBT5pnz2rWuOly9H6JDAl9Da91hsilCxfeP3edn3RglORmG0NgHvCdEwdAmbQgNhg-759gqH8EQTmqh74zbe60w/s1600/monkeyrunner-ext-11.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjahhpS_Y4RErxB4kmThrKqqgUKQXkB6UJQDKXAgI9FCyTiEAMJ7Do7IBT5pnz2rWuOly9H6JDAl9Da91hsilCxfeP3edn3RglORmG0NgHvCdEwdAmbQgNhg-759gqH8EQTmqh74zbe60w/s1600/monkeyrunner-ext-11.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;12. The Eclipse is very useful for developing MonkeyRunner Extension Jar file, because you can see the tip when your mouse move cursor to the method. Hence, you can know what type and &amp;nbsp;you should use and how many parameters you should provide for particular method.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv7xlyQ9nFwwRZ8nNkec3DPAzdEBTgymZVRftF7G5R4gOZCPGwzjZb9Zjmp2q-kh5pY2nIaW5Q_NlM4PiAwXVyel4XmufvixtEM5Kx9Q8BavryPzXFnaCeDymHD1tUUIQLT-AUExjd_w0/s1600/monkeyrunner-tip.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgv7xlyQ9nFwwRZ8nNkec3DPAzdEBTgymZVRftF7G5R4gOZCPGwzjZb9Zjmp2q-kh5pY2nIaW5Q_NlM4PiAwXVyel4XmufvixtEM5Kx9Q8BavryPzXFnaCeDymHD1tUUIQLT-AUExjd_w0/s1600/monkeyrunner-tip.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;13. Start to export your wrote files to a Jar file for MonkeyRunner after you finish the coding work.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;14. Move mouse to project name on Eclipse and right click the mouse.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;15. Click Export option. &amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjykGM6E0skXdp_BwQCz57JdYTwFxooKzJz7RB9WmUtYmxoND-G3Nt4uOSIdS5UHdWLF1couT6kuW1SJ_RK-3Bw7ajeAWhRQZyZKzfEUtbyBhaMzp3lUfLYvOiSRk-0cCxP0sxfU3J53Cw/s1600/monkeyrunner-ext-6.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjykGM6E0skXdp_BwQCz57JdYTwFxooKzJz7RB9WmUtYmxoND-G3Nt4uOSIdS5UHdWLF1couT6kuW1SJ_RK-3Bw7ajeAWhRQZyZKzfEUtbyBhaMzp3lUfLYvOiSRk-0cCxP0sxfU3J53Cw/s1600/monkeyrunner-ext-6.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;16. Select JAR file and press Next button.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-mG02bs-n3zkaoQ8_QThFovKM9NHAbpc8HuCCzgs-49cXSPb7tSMv7B4X8Tzr-p6i1XfIfyaRGWvwnPrOAf4O_SMVKL7g2STWEwPXJo9Hi2Tg9YKgRYGBBk8lTK6zVUI6Km9b_avE66s/s1600/monkeyrunner-ext-7.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj-mG02bs-n3zkaoQ8_QThFovKM9NHAbpc8HuCCzgs-49cXSPb7tSMv7B4X8Tzr-p6i1XfIfyaRGWvwnPrOAf4O_SMVKL7g2STWEwPXJo9Hi2Tg9YKgRYGBBk8lTK6zVUI6Km9b_avE66s/s1600/monkeyrunner-ext-7.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&amp;nbsp;17. Select the files which are going to be exported and press Next button.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie8JSN5yfM_0qdCFf3_sUaoM_7-clLah6D1wsZOHY_8Xh5VT2RqbWkIoIf2P7uavDfFPshIRePMA2tnzAVFi_7dzD4aKmEOT1Hpam3dyhZwmlEb88hGr5gh9srbOQzOW1Gr9s2-iZTkus/s1600/monkeyrunner-ext-8.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEie8JSN5yfM_0qdCFf3_sUaoM_7-clLah6D1wsZOHY_8Xh5VT2RqbWkIoIf2P7uavDfFPshIRePMA2tnzAVFi_7dzD4aKmEOT1Hpam3dyhZwmlEb88hGr5gh9srbOQzOW1Gr9s2-iZTkus/s1600/monkeyrunner-ext-8.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;18. Press Next Button.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6IRirsp5L2ejz1In4ThlzVI0MsRrdZCwp0mTdmj7ItxvWCtWjGbKOoi-awYsoRQCm2eqWYlbmNvTnW4WKzQeEsLFnYijEW9ERbCTOHJisCeRDntjT6Xt62q_kRWavGY21iaS9kN_QFxY/s1600/monkeyrunner-ext-9.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6IRirsp5L2ejz1In4ThlzVI0MsRrdZCwp0mTdmj7ItxvWCtWjGbKOoi-awYsoRQCm2eqWYlbmNvTnW4WKzQeEsLFnYijEW9ERbCTOHJisCeRDntjT6Xt62q_kRWavGY21iaS9kN_QFxY/s1600/monkeyrunner-ext-9.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;19. If you don&#39;t have a MANIFEST file existed already, you can select option of &quot;Generate the manifest file&quot; and press Browser button to select where to store the MANIFEST file. You can give a name like MANIFEST.MF and place in root folder of project. If you have a MANIFEST file already, you can select option - Use existing manifest from workspace and select your own file.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;20. Press Finish button.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC8tvZWEbGPatIwoxGCNBPvpuZ8OF9_w3dpRiq81pJHEILi2zWkDPyEhrbNzwk4x4U1ErQcCrccZlRZlcuwMjg7WjT_0CiICoNpr_jLyoC-NO49qJEeAeHtaB-8nNAHnKxN491aX4WpwA/s1600/monkeyrunner-ext-10.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjC8tvZWEbGPatIwoxGCNBPvpuZ8OF9_w3dpRiq81pJHEILi2zWkDPyEhrbNzwk4x4U1ErQcCrccZlRZlcuwMjg7WjT_0CiICoNpr_jLyoC-NO49qJEeAeHtaB-8nNAHnKxN491aX4WpwA/s1600/monkeyrunner-ext-10.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;21. Edit the MANIFEST file you used at last step and add a command -&amp;nbsp;&lt;i&gt;MonkeyRunnerStartupRunner: com.android.monkeyrunner.monkeyrunnerExt&lt;/i&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;to MANIFEST file. The string of&amp;nbsp;&lt;/span&gt;&lt;i style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;MonkeyRunnerStartupRunner:&lt;/i&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;&amp;nbsp;is followed by&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;full package name of your class. Finally,&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Times, &#39;Times New Roman&#39;, serif;&quot;&gt;save your modified MANIFEST file to your JAR file.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;How to import your own Jar file for MonkeyRunner?&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Copy your Jar file to /android-sdk_folder/tools/lib before running monkeyrunner.bat. Double click monkeyrunner.bat at the folder of android-sdk/tools/ to bring up a MonkeyRunner console as follows. And import the necessary class and your own class as follows. Then you can use your own class to do something on MonkeyRunner run-time environment.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3D7-QEUDIGSg7lcUNoSnhqUFEmj3nZ0Q8PpkHMYD4hUxkuQjLXfIPV58tSw0HwZWUTjBiLgQFHXRkdE6kjcpnFzKjGt3s__2Zl4oFWV99lziOGOTHUn-GsLoKK6tOPNAuVNJ8jMfFnlc/s1600/monkeyrunner-12.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3D7-QEUDIGSg7lcUNoSnhqUFEmj3nZ0Q8PpkHMYD4hUxkuQjLXfIPV58tSw0HwZWUTjBiLgQFHXRkdE6kjcpnFzKjGt3s__2Zl4oFWV99lziOGOTHUn-GsLoKK6tOPNAuVNJ8jMfFnlc/s1600/monkeyrunner-12.jpg&quot; /&gt;&lt;/span&gt;&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;Reference&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://developer.android.com/tools/help/monkeyrunner_concepts.html#Plugins&quot;&gt;&lt;span style=&quot;font-family: Times, Times New Roman, serif;&quot;&gt;http://developer.android.com/tools/help/monkeyrunner_concepts.html#Plugins&lt;/span&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/7410462909654903134/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/11/extending-monkeyrunner-with-plugins-jar.html#comment-form' title='27 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7410462909654903134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7410462909654903134'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/11/extending-monkeyrunner-with-plugins-jar.html' title='Extending monkeyrunner with Plugins - Jar File'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCmngyCEhqc0mFzbEuzJJ8bpM9PRE-Tgq5s_Ch1_naDUJEYr3B4GtWE2e1pssEmvkfRxS6u4dSqD0zFDfGGk5AmgokHkdElCRsSGme8fTTlIDKbySAUAmVd2GsqUTRdlLNdZOdwlC84YU/s72-c/monkeyrunner-ext-1.jpg" height="72" width="72"/><thr:total>27</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-3021025878523744693</id><published>2012-11-08T23:49:00.001-08:00</published><updated>2013-04-23T00:35:01.400-07:00</updated><title type='text'>Build an Android SDK</title><content type='html'>&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Preface&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;To build a customized Android SDK is a option to develop your SDK tools. In following section will talk about how to build a Android SDK. Before you read this paragraph, you need to know how to &lt;a href=&quot;http://android-test-tw.blogspot.tw/2012/11/android-build-environment-setup.html&quot; target=&quot;_blank&quot;&gt;build a Android Build Environment&lt;/a&gt;&amp;nbsp;in advance.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Description&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Android SDK is very easy to build up. After you finish both the Android Build Environment setup and &amp;nbsp;a particular version of Android Source Code&amp;nbsp;downloaded, you can do it by following command.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;1. Go to root folder of Android Source Code.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;2. Execute Console Command to build a Linix Android SDK -&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;background-color: white; line-height: 20px;&quot;&gt;$ . build/envsetup.sh&lt;/span&gt;&lt;br style=&quot;background-color: white; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: white; line-height: 20px;&quot;&gt;$ lunch sdk-eng&lt;/span&gt;&lt;br style=&quot;background-color: white; line-height: 20px;&quot; /&gt;&lt;span style=&quot;background-color: white; line-height: 20px;&quot;&gt;$ make sdk&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: white; line-height: 20px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;The Android SDK on Linux is started to build. Note that in case you want to build a Windows Android SDK, to perform the above actions in advance. Or the build process of Windows Android SDK would fail because&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;of&lt;/span&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;line-height: 20px;&quot;&gt;lack of something it needs from Linux Android SDK.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 20px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;line-height: 20px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;3. In case you want to build a Windows Android SDK, perform the following commands.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 20px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;line-height: 20px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;$ sudo apt-get install mingw32 tofrodos&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;line-height: 20px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;$ . build/envsetup.sh&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 20px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;$ lunch sdk-eng&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;line-height: 20px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;$ make win_sdk&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;line-height: 20px;&quot;&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;The build process will finish after a long time. It depends on the performance of your build machine. You will see the following screen once the build process is successfully.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbnGRmhPlAGCmeo7a0zW5qHcarLL_eig87c0MDLqiZZYx7JNqOaeohbAJ5tNzo4_c6ky24M2SM9xpJK9zUSqWUG5qtlaDALxgDSTl-7Rny3jHk21Of601u05jJJMPP7dbSUogW5N1pfHE/s1600/win_sdk.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;288&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbnGRmhPlAGCmeo7a0zW5qHcarLL_eig87c0MDLqiZZYx7JNqOaeohbAJ5tNzo4_c6ky24M2SM9xpJK9zUSqWUG5qtlaDALxgDSTl-7Rny3jHk21Of601u05jJJMPP7dbSUogW5N1pfHE/s1600/win_sdk.jpg&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;Reference&lt;/span&gt;&lt;/b&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Georgia, Times New Roman, serif;&quot;&gt;&lt;a href=&quot;http://tools.android.com/build&quot;&gt;http://tools.android.com/build&lt;/a&gt;&amp;nbsp;&lt;/span&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/3021025878523744693/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/11/build-android-sdk.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/3021025878523744693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/3021025878523744693'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/11/build-android-sdk.html' title='Build an Android SDK'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbnGRmhPlAGCmeo7a0zW5qHcarLL_eig87c0MDLqiZZYx7JNqOaeohbAJ5tNzo4_c6ky24M2SM9xpJK9zUSqWUG5qtlaDALxgDSTl-7Rny3jHk21Of601u05jJJMPP7dbSUogW5N1pfHE/s72-c/win_sdk.jpg" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-3012750955934432759</id><published>2012-11-07T20:31:00.002-08:00</published><updated>2013-04-23T00:35:22.463-07:00</updated><title type='text'>Android Build Environment Setup</title><content type='html'>&lt;h3&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Preface&lt;/span&gt;&lt;/h3&gt;
&lt;div&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Following Instructions will lead you to know how to build a Android build Environment.&lt;/span&gt;&lt;/div&gt;
&lt;h3&gt;
&lt;b&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small;&quot;&gt;Setup Your Ubuntu&lt;/span&gt;&lt;/b&gt;&lt;/h3&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;In case you&#39;d like to have both of Windows and Ubuntu can work on a computer concurrently, you can install&amp;nbsp;Oracle VM VirtualBox&amp;nbsp;in your Computer/Notebook&amp;nbsp;and then install Ubuntu on VirtualBox. You can follow the instruction below to setup your Android Build Environment. If you want to install Ubutun on a computer only, you can ignore installation of VirtualBox.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1. Download Oracle VirtualBox from&amp;nbsp;&lt;span style=&quot;background-color: white; color: #009933; line-height: 12.499999046325684px;&quot;&gt;https://www.&lt;/span&gt;&lt;b style=&quot;background-color: white; color: #009933; line-height: 12.499999046325684px;&quot;&gt;virtualbox&lt;/b&gt;&lt;span style=&quot;background-color: white; color: #009933; line-height: 12.499999046325684px;&quot;&gt;.org/.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2. Download Ubuntu 10.04 LTE from&amp;nbsp;&lt;a href=&quot;http://releases.ubuntu.com/lucid/&quot;&gt;http://releases.ubuntu.com/lucid/&lt;/a&gt;&amp;nbsp;and choose the file named&amp;nbsp;&lt;a href=&quot;http://releases.ubuntu.com/lucid/ubuntu-10.04.4-desktop-amd64.iso&quot; style=&quot;color: #772953; line-height: 16px; text-decoration: none;&quot;&gt;ubuntu-10.04.4-desktop-amd64.iso&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3. Install VirtualBox and Create a Virtual Ubuntu&amp;nbsp;System on VirtualBox.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4. Install Ubuntu on VirtualBox.&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif;&quot;&gt;&lt;b&gt;Configure Your Ubuntu&lt;/b&gt;&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;1. Launch a terminal on Ubuntu.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;2. Follow the instructions that Google said at &amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;a href=&quot;http://source.android.com/source/initializing.html&quot;&gt;http://source.android.com/source/initializing.html&lt;/a&gt;&amp;nbsp;to install the required tools.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: white; border: 0px; line-height: 1.3em; margin-bottom: 1em; margin-top: 1em; padding: 0px;&quot;&gt;
&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif;&quot;&gt;Detailed instructions for Ubuntu and MacOS follow. In general you will need:&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;ul style=&quot;background-color: white; line-height: 1.3em;&quot;&gt;
&lt;li style=&quot;line-height: 1.3em;&quot;&gt;&lt;div style=&quot;border: 0px; line-height: 1.3em; margin-bottom: 1em; margin-top: 1em; padding: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Python 2.5 -- 2.7, which you can download from&amp;nbsp;&lt;a href=&quot;http://www.python.org/download/&quot; style=&quot;color: #006699;&quot;&gt;python.org&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;line-height: 1.3em;&quot;&gt;&lt;div style=&quot;border: 0px; line-height: 1.3em; margin-bottom: 1em; margin-top: 1em; padding: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;GNU Make 3.81 -- 3.82, which you can download from&amp;nbsp;&lt;a href=&quot;http://ftp.gnu.org/gnu/make/&quot; style=&quot;color: #006699;&quot;&gt;gnu.org&lt;/a&gt;,&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;line-height: 1.3em;&quot;&gt;&lt;div style=&quot;border: 0px; line-height: 1.3em; margin-bottom: 1em; margin-top: 1em; padding: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;JDK 6 if you wish to build Gingerbread or newer; JDK 5 for Froyo or older. You can download both from&amp;nbsp;&lt;a href=&quot;http://java.sun.com/javase/downloads/&quot; style=&quot;color: #006699;&quot;&gt;java.sun.com&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li style=&quot;line-height: 1.3em;&quot;&gt;&lt;div style=&quot;border: 0px; line-height: 1.3em; margin-bottom: 1em; margin-top: 1em; padding: 0px;&quot;&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Git 1.7 or newer. You can find it at&amp;nbsp;&lt;a href=&quot;http://git-scm.com/download&quot; style=&quot;color: #006699;&quot;&gt;git-scm.com&lt;/a&gt;.&lt;/span&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;i&gt;Install the following tools by executing console command below.&lt;/i&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;sudo apt-get install git-core gnupg flex bison gperf build-essential&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;libgl1-mesa-dev g++-multilib mingw32 tofrodos python-markdown&lt;/span&gt;&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&amp;nbsp;libxml2-utils xsltproc&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Because Canonical is no longer to support Oracle Java, you need to install the Oracle JDK6 manually. It means you cannot use apt-get tool to install Oracle JDK6. Follow the instruct at following section -&amp;nbsp;&lt;u&gt;Installation Instruction of Oracle J2SDK 6 on Ubuntu 10.04 64 bit&lt;/u&gt; to install the Oracle J2SDK6.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;3. Download and install repo tool from Google -&amp;nbsp;&lt;a href=&quot;http://source.android.com/source/downloading.html&quot;&gt;http://source.android.com/source/downloading.html&lt;/a&gt;.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Make sure you have a bin/ directory in your home directory, and that it is included in your path:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;$ mkdir ~/bin&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;$ PATH=~/bin:$PATH&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Download the Repo script and ensure it is executable:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;$ curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo &amp;gt; ~/bin/repo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;$ chmod a+x ~/bin/repo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;4.&amp;nbsp;Initializing a Repo client&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;After installing Repo, set up your client to access the android source repository:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Create an empty directory to hold your working files. If you&#39;re using MacOS, this has to be on a case-sensitive filesystem. Give it any name you like:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;$ mkdir WORKING_DIRECTORY&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;$ cd WORKING_DIRECTORY&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;Run repo init to bring down the latest version of Repo with all its most recent bug fixes. You must specify a URL for the manifest, which specifies where the various repositories included in the Android source will be placed within your working directory.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;$ repo init -u https://android.googlesource.com/platform/manifest&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;To check out a branch other than &quot;master&quot;, specify it with -b:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;$ repo init -u https://android.googlesource.com/platform/manifest -b android-4.1.2_r1&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;u&gt;Note that the parameter -b is followed by Android version. The Android version can be assigned to the latest version or previous version that Google released. &amp;nbsp;&lt;/u&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;When prompted, please configure Repo with your real name and email address. To use the Gerrit code-review tool, you will need an email address that is connected with a registered Google account. Make sure this is a live address at which you can receive messages. The name that you provide here will show up in attributions for your code submissions.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;A successful initialization will end with a message stating that Repo is initialized in your working directory. Your client directory should now contain a .repo directory where files such as the manifest will be kept.&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;5. Get the source code by repo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;$ repo sync&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;6. After several hours, you may receive 6 to 8 GByte file in your storage.&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-8614717776242783453&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: white; position: relative; width: 570px;&quot;&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;b&gt;Installation Instruction of Oracle J2SDK 6 on Ubuntu 10.04 64 bit&amp;nbsp;&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;1. Download binary file from http://www.oracle.com/technetwork/java/javase/downloads/jdk6u37-downloads-1859587.html and click jdk-6u37-linux-x64.bin to download&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;2. Root permission is required to install J2SDK.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;3. Copy the file jdk-6u37-linux-x64.bin to /usr/lib/jvm folder.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;# cp /Download_Folder_Path/jdk-6u37-linux-x64.bin /usr/lib/jvm/jdk-6u37-linux-x64.bin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;# cd usr/lib/jvm/&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;# sh jdk-6u37-linux-x64.bin&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;4. After folder jdk1.6.0_37 is extracted, install it by using update-alternatives as follows,&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_37/bin/java 1000&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_37/bin/javac 1000&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_37/bin/javaws 1000&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_37/bin/jar 1000&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;The command of update-alternatives is a tool which can select particular tool version to be run on Linux. To view the manual by executing console command - &quot;man update-alternatives&quot; on Ubuntu.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;5. Choose the option of Oracle Java by following command in case your Ubuntu has installed other Java VM (E.g. OpenJava).&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;#update-alternatives --config java&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/span&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;6. Check the Java version you used on your Ubuntu by following command.&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;# java -version&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;java version &quot;1.6.0_37&quot;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;Java(TM) SE Runtime Environment (build 1.6.0_37-b06)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Helvetica, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;Java HotSpot(TM) 64-Bit Server VM (build 20.12-b01, mixed mode)&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-8614717776242783453&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4; position: relative; width: 570px;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-8614717776242783453&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: white; color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4; position: relative; width: 570px;&quot;&gt;
&lt;b&gt;Reference:&lt;/b&gt;&lt;/div&gt;
&lt;div class=&quot;post-body entry-content&quot; id=&quot;post-body-8614717776242783453&quot; itemprop=&quot;description articleBody&quot; style=&quot;background-color: white; position: relative; width: 570px;&quot;&gt;
&lt;div style=&quot;color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4;&quot;&gt;
&lt;a href=&quot;http://source.android.com/source/initializing.html&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; line-height: normal;&quot;&gt;http://source.android.com/source/initializing.html&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4;&quot;&gt;
&lt;a href=&quot;http://source.android.com/source/downloading.html&quot;&gt;http://source.android.com/source/downloading.html&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4;&quot;&gt;
&lt;a href=&quot;http://tools.android.com/build&quot;&gt;http://tools.android.com/build&lt;/a&gt;&lt;/div&gt;
&lt;span style=&quot;color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: x-small;&quot;&gt;&lt;span style=&quot;line-height: 18px;&quot;&gt;&lt;a href=&quot;https://www.virtualbox.org/&quot;&gt;https://www.virtualbox.org/&lt;/a&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;color: #222222; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; font-size: 13px; line-height: 1.4;&quot;&gt;
&lt;a href=&quot;http://yltechblog.blogspot.tw/2012/10/install-jdk6-on-ubuntu-1204.html&quot;&gt;http://yltechblog.blogspot.tw/2012/10/install-jdk6-on-ubuntu-1204.html&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/3012750955934432759/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/11/android-build-environment-setup.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/3012750955934432759'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/3012750955934432759'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/11/android-build-environment-setup.html' title='Android Build Environment Setup'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-7871466878876845994</id><published>2012-10-24T02:14:00.002-07:00</published><updated>2013-04-23T00:35:41.758-07:00</updated><title type='text'>Dumpsys Information - Android Open Source</title><content type='html'>&lt;b&gt;Preface&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Dumpsys is a tool to gather various information from Android device and tell you its system status. All you have to do is to execute a command - &quot;adb shell dumpsys&quot; on your computer with J2SDK and Android SDK. &amp;nbsp;Let&#39;s take a look on it.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Description&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
After executing the command of &quot;adb shell dumpsys&quot;, there&#39;re various service messages are outputted as follows. (In this case, I used an Android device to depict how to get the information and what they stand for.)&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&lt;i&gt;Currently running services:&lt;/i&gt;&lt;br /&gt;
&amp;nbsp; accessibility&lt;br /&gt;
&amp;nbsp; account&lt;br /&gt;
&amp;nbsp; activity&lt;br /&gt;
&amp;nbsp; alarm&lt;br /&gt;
&amp;nbsp; apn_settings_policy&lt;br /&gt;
&amp;nbsp; application_policy&lt;br /&gt;
&amp;nbsp; appwidget&lt;br /&gt;
&amp;nbsp; audio&lt;br /&gt;
&amp;nbsp; backup&lt;br /&gt;
&amp;nbsp; battery&lt;br /&gt;
&amp;nbsp; batteryinfo&lt;br /&gt;
&amp;nbsp; bluetooth&lt;br /&gt;
&amp;nbsp; bluetooth_a2dp&lt;br /&gt;
&amp;nbsp; bluetooth_avrcp&lt;br /&gt;
&amp;nbsp; bluetooth_policy&lt;br /&gt;
&amp;nbsp; browser_policy&lt;br /&gt;
&amp;nbsp; clipboard&lt;br /&gt;
&amp;nbsp; clipboardEx&lt;br /&gt;
&amp;nbsp; connectivity&lt;br /&gt;
&amp;nbsp; content&lt;br /&gt;
&amp;nbsp; country_detector&lt;br /&gt;
&amp;nbsp; cpuinfo&lt;br /&gt;
&amp;nbsp; CustomFrequencyManagerService&lt;br /&gt;
&amp;nbsp; date_time_policy&lt;br /&gt;
&amp;nbsp; device_info&lt;br /&gt;
&amp;nbsp; device_policy&lt;br /&gt;
&amp;nbsp; devicestoragemonitor&lt;br /&gt;
&amp;nbsp; DirEncryptService&lt;br /&gt;
&amp;nbsp; diskstats&lt;br /&gt;
&amp;nbsp; drm.drmManager&lt;br /&gt;
&amp;nbsp; dropbox&lt;br /&gt;
&amp;nbsp; eas_account_policy&lt;br /&gt;
&amp;nbsp; email_account_policy&lt;br /&gt;
&amp;nbsp; enterprise_policy&lt;br /&gt;
&amp;nbsp; enterprise_vpn_policy&lt;br /&gt;
&amp;nbsp; entropy&lt;br /&gt;
&amp;nbsp; firewall_policy&lt;br /&gt;
&amp;nbsp; FMPlayer&lt;br /&gt;
&amp;nbsp; gfxinfo&lt;br /&gt;
&amp;nbsp; hardware&lt;br /&gt;
&amp;nbsp; input_method&lt;br /&gt;
&amp;nbsp; iphonesubinfo&lt;br /&gt;
&amp;nbsp; isms&lt;br /&gt;
&amp;nbsp; location&lt;br /&gt;
&amp;nbsp; location_policy&lt;br /&gt;
&amp;nbsp; mdm.remotedesktop&lt;br /&gt;
&amp;nbsp; media.audio_flinger&lt;br /&gt;
&amp;nbsp; media.audio_policy&lt;br /&gt;
&amp;nbsp; media.camera&lt;br /&gt;
&amp;nbsp; media.player&lt;br /&gt;
&amp;nbsp; media.yamahaplayer&lt;br /&gt;
&amp;nbsp; meminfo&lt;br /&gt;
&amp;nbsp; mini_mode_app_manager&lt;br /&gt;
&amp;nbsp; misc_policy&lt;br /&gt;
&amp;nbsp; motion_recognition&lt;br /&gt;
&amp;nbsp; mount&lt;br /&gt;
&amp;nbsp; netpolicy&lt;br /&gt;
&amp;nbsp; netstats&lt;br /&gt;
&amp;nbsp; network_management&lt;br /&gt;
&amp;nbsp; notification&lt;br /&gt;
&amp;nbsp; package&lt;br /&gt;
&amp;nbsp; password_policy&lt;br /&gt;
&amp;nbsp; permission&lt;br /&gt;
&amp;nbsp; phone&lt;br /&gt;
&amp;nbsp; phone_restriction_policy&lt;br /&gt;
&amp;nbsp; phoneext&lt;br /&gt;
&amp;nbsp; power&lt;br /&gt;
&amp;nbsp; remoteinjection&lt;br /&gt;
&amp;nbsp; restriction_policy&lt;br /&gt;
&amp;nbsp; roaming_policy&lt;br /&gt;
&amp;nbsp; samplingprofiler&lt;br /&gt;
&amp;nbsp; search&lt;br /&gt;
&amp;nbsp; SecTVOutService&lt;br /&gt;
&amp;nbsp; security_policy&lt;br /&gt;
&amp;nbsp; sensorservice&lt;br /&gt;
&amp;nbsp; shutdownlogger&lt;br /&gt;
&amp;nbsp; simphonebook&lt;br /&gt;
&amp;nbsp; statusbar&lt;br /&gt;
&amp;nbsp; SurfaceFlinger&lt;br /&gt;
&amp;nbsp; telephony.registry&lt;br /&gt;
&amp;nbsp; textservices&lt;br /&gt;
&amp;nbsp; throttle&lt;br /&gt;
&amp;nbsp; tvoutservice&lt;br /&gt;
&amp;nbsp; TvoutService_C&lt;br /&gt;
&amp;nbsp; uimode&lt;br /&gt;
&amp;nbsp; usagestats&lt;br /&gt;
&amp;nbsp; usb&lt;br /&gt;
&amp;nbsp; vibrator&lt;br /&gt;
&amp;nbsp; voip&lt;br /&gt;
&amp;nbsp; vpn_policy&lt;br /&gt;
&amp;nbsp; wallpaper&lt;br /&gt;
&amp;nbsp; wifi&lt;br /&gt;
&amp;nbsp; wifi_policy&lt;br /&gt;
&amp;nbsp; wifip2p&lt;br /&gt;
&amp;nbsp; window&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In above list, we see that there&#39;re various functional services are running on Android device. When debug engineering is necessary, we could get a lot of useful information from dumpsys for debugging purpose.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
We&#39;ve discussed the MonkeyRunner Control with Jython script in separate article. We can check the testing result by comparing image. However, we always hope to acquire more clues to point out the root cause of problem.&lt;br /&gt;
&lt;br /&gt;
Typically, I illustrate two situations. First one is when the problem is caused by up layer (Framework layer or UI representation), but it&#39;s work normally at lower layer ( E.g. driver). For instance, when trying to switch Bluetooth On, you may observe the icon on UI which remains Off state. But the driver of Bluetooth has been powered on. In another situation we can think about is oppositive to last case&lt;br /&gt;
&lt;br /&gt;
Now we have another choice to make result more accurately. Fortunately, we can monitor both &amp;nbsp;system status&amp;nbsp;by using parameter inspection from outputted information of dumpsys on Android device&amp;nbsp;and UI comparison by using MonkeyRunner manner as the necessary testing criteria. &amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Usage&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
dumpsys [running_service_name]&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
In case nothing is followed by dumpsys, the dumpsys will output all the information of running services.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;What information can be found in Dumpsys ?&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Dumpsys outputs various message to depict system status of an Android device. Let&#39;s talk about some frequent used messages.&amp;nbsp;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
When you need power relative information, you can get them by following information.&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;i&gt;&lt;u&gt;Battery Information from Dumpsys&lt;/u&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Execute the command of &quot;adb shell dumpsys battery&quot;, you may see the following information.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Current Battery Service state:&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; AC powered: false&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; USB powered: true&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; status: 2&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; health: 2&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; present: true&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; level: 100&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; scale: 100&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; voltage:4191&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; temperature: 350&lt;/div&gt;
&lt;div&gt;
&amp;nbsp; technology: Li-ion&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
From above information, you can get the information, including type of power source, battery capacity, measured battery voltage, measured temperature and so on.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
The definitions of&amp;nbsp;each parameter from&amp;nbsp;battery information &amp;nbsp;are as follows,&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
AC powered:false (Power source)&lt;/div&gt;
&lt;div&gt;
USB powered:true (Power source)&lt;/div&gt;
&lt;div&gt;
status:5 (see next section)&lt;/div&gt;
&lt;div&gt;
health:2 (see next section)&lt;/div&gt;
&lt;div&gt;
present:true (indicating whether a battery is present.)&lt;/div&gt;
&lt;div&gt;
level:100 (returns battery level as a percentage)&lt;/div&gt;
&lt;div&gt;
scale:100 (maximum battery level)&lt;/div&gt;
&lt;div&gt;
voltage: 4195 (an integer containing the current battery voltage level)&lt;/div&gt;
&lt;div&gt;
temperature: 380 (an integer containing the current battery temperature)&lt;/div&gt;
&lt;div&gt;
technology: Li-ion (technology of the current battery)&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
With respect to status in battery information, the definition of value is as follows,&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Defined in android.os.BatteryManager&lt;/div&gt;
&lt;div&gt;
BATTERY_STATUS_UNKNOWN (0x00000001)&lt;/div&gt;
&lt;div&gt;
BATTERY_STATUS_CHARGING (0x00000002)&lt;/div&gt;
&lt;div&gt;
BATTERY_STATUS_DISCHARGING (0x00000003)&lt;/div&gt;
&lt;div&gt;
BATTERY_STATUS_NOT_CHARGING (0x00000004)&lt;/div&gt;
&lt;div&gt;
BATTERY_STATUS_FULL (0x00000005)&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
With respect to health in battery information, the definition of value is as follows,&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
Defined in android.os.BatteryManager&lt;/div&gt;
&lt;div&gt;
BATTERY_HEALTH_UNKNOWN (0x00000001)&lt;/div&gt;
&lt;div&gt;
BATTERY_HEALTH_GOOD (0x00000002)&lt;/div&gt;
&lt;div&gt;
BATTERY_HEALTH_OVERHEAT (0x00000003)&lt;/div&gt;
&lt;div&gt;
BATTERY_HEALTH_DEAD (0x00000004)&lt;/div&gt;
&lt;div&gt;
BATTERY_HEALTH_OVER_VOLTAGE (0x00000005)&lt;/div&gt;
&lt;div&gt;
BATTERY_HEALTH_UNSPECIFIED_FAILURE(0x00000006)&lt;/div&gt;
&lt;div&gt;
BATTERY_HEALTH_COLD (0x00000007)&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;br /&gt;
When you need to get the information from Bluetooth you can use following information.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
&lt;i&gt;&lt;u&gt;Bluetooth Information from Dumpsys&lt;/u&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Execute&amp;nbsp;the command of &quot;adb shell dumpsys bluetooth&quot;, you may see the following information.&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
DUMP OF SERVICE bluetooth:&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;mIsAirplaneSensitive = true&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;mIsAirplaneToggleable = true&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Local address = 00:07:0B:16:23:AC&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;Local name = MyBTPhone&lt;/div&gt;
&lt;div&gt;
&amp;nbsp;isDiscovering() = false&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;div&gt;
The definitions of Bluetooth information for each parameter are as follows,&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; style=&quot;border-collapse: collapse; width: 600px;&quot;&gt;
 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 5376; mso-width-source: userset; width: 126pt;&quot; width=&quot;168&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 2720; mso-width-source: userset; width: 64pt;&quot; width=&quot;85&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 8288; mso-width-source: userset; width: 194pt;&quot; width=&quot;259&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;22&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 0.5pt solid rgb(79, 98, 40); color: white; font-family: Calibri; font-size: 12pt; font-weight: 700; height: 16.5pt; text-underline-style: none; width: 126pt;&quot; width=&quot;168&quot;&gt;Parameter&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 0.5pt solid rgb(79, 98, 40); color: white; font-family: Calibri; font-size: 12pt; font-weight: 700; text-underline-style: none; width: 64pt;&quot; width=&quot;85&quot;&gt;Value&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 0.5pt solid rgb(79, 98, 40); color: white; font-family: Calibri; font-size: 12pt; font-weight: 700; text-underline-style: none; width: 194pt;&quot; width=&quot;259&quot;&gt;Definition&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;42&quot; style=&quot;border: 0.5pt solid rgb(79, 98, 40); font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;mIsAirplaneSensitive&lt;/td&gt;
  &lt;td class=&quot;xl69&quot; style=&quot;border-left: none; border-top: none;&quot;&gt;true | false&lt;/td&gt;
  &lt;td class=&quot;xl70&quot; style=&quot;border: 0.5pt solid rgb(79, 98, 40); font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 194pt;&quot; width=&quot;259&quot;&gt;Airplane
  mode can prevent Bluetooth radio from being turned on&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;42&quot; style=&quot;border: 0.5pt solid rgb(79, 98, 40); font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;mIsAirplaneToggleable&lt;/td&gt;
  &lt;td class=&quot;xl69&quot; style=&quot;border-left: none; border-top: none;&quot;&gt;true | false&lt;/td&gt;
  &lt;td class=&quot;xl70&quot; style=&quot;border: 0.5pt solid rgb(79, 98, 40); font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 194pt;&quot; width=&quot;259&quot;&gt;Airplane
  mode can prevent Bluetooth radio from being turned on&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl69&quot; height=&quot;22&quot; style=&quot;border: 0.5pt solid rgb(79, 98, 40); font-family: Calibri; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;Local
  name&lt;/td&gt;
  &lt;td class=&quot;xl69&quot; style=&quot;border-left: none; border-top: none;&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl70&quot; style=&quot;border: 0.5pt solid rgb(79, 98, 40); font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 194pt;&quot; width=&quot;259&quot;&gt;Bluetooth
  device name&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl68&quot; height=&quot;22&quot; style=&quot;border: 0.5pt solid rgb(79, 98, 40); font-family: Calibri; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;Local
  address&lt;/td&gt;
  &lt;td class=&quot;xl69&quot; style=&quot;border-left: none; border-top: none;&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl70&quot; style=&quot;border: 0.5pt solid rgb(79, 98, 40); font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 194pt;&quot; width=&quot;259&quot;&gt;Bluetooth
  Address&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl71&quot; height=&quot;22&quot; style=&quot;border: 0.5pt solid rgb(79, 98, 40); font-family: Calibri; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;isDiscovering&lt;/td&gt;
  &lt;td class=&quot;xl72&quot; style=&quot;border: 0.5pt solid rgb(79, 98, 40); font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;true|false&lt;/td&gt;
  &lt;td class=&quot;xl73&quot; style=&quot;border: 0.5pt solid rgb(79, 98, 40); font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 194pt;&quot; width=&quot;259&quot;&gt;Discoverable
  for Bluetooth&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
The following information will tell you what the status for telecom is.&lt;br /&gt;
&lt;div&gt;
&lt;i&gt;&lt;u&gt;telephony.registry&amp;nbsp;Information from Dumpsys&lt;/u&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Execute&amp;nbsp;the command of &quot;adb shell dumpsys&amp;nbsp;telephony.registry&quot;, you may see the following information.&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
DUMP OF SERVICE telephony.registry:&lt;br /&gt;
last known state:&lt;br /&gt;
&amp;nbsp; mCallState=0&lt;br /&gt;
&amp;nbsp; mCallIncomingNumber=&lt;br /&gt;
&amp;nbsp; mServiceState=0 home TTT TTT 46999 &amp;nbsp;HSDPA:9 CSS not supported -1 -1 RoamInd=-1 DefRoamInd=-1 EmergOnly=false&lt;br /&gt;
&amp;nbsp; mSignalStrength=SignalStrength: 19 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 gsm|lte 4&lt;br /&gt;
&amp;nbsp; mMessageWaiting=false&lt;br /&gt;
&amp;nbsp; mCallForwarding=false&lt;br /&gt;
&amp;nbsp; mDataActivity=0&lt;br /&gt;
&amp;nbsp; mDataConnectionState=0&lt;br /&gt;
&amp;nbsp; mDataConnectionPossible=true&lt;br /&gt;
&amp;nbsp; mDataConnectionReason=dataDisabled&lt;br /&gt;
&amp;nbsp; mDataConnectionApn=&lt;br /&gt;
&amp;nbsp; mDataConnectionLinkProperties=null&lt;br /&gt;
&amp;nbsp; mDataConnectionLinkCapabilities=null&lt;br /&gt;
&amp;nbsp; mCellLocation=Bundle[mParcelledData.dataSize=76]&lt;br /&gt;
registrations: count=8&lt;br /&gt;
&lt;br /&gt;
Note, the information&amp;nbsp;telephony.registry provided is the last know state. It means it may not the state that device is running.&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
The definitions of&amp;nbsp;telephony.registry&amp;nbsp;information for each parameter are as follows,&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; style=&quot;border-collapse: collapse; width: 600px;&quot;&gt;
&lt;tbody&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; dir=&quot;LTR&quot; height=&quot;21&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 0.5pt solid rgb(79, 98, 40); color: white; font-family: Calibri; font-size: 12pt; font-weight: 700; height: 16.5pt; text-underline-style: none; width: 150pt;&quot; width=&quot;150&quot;&gt;Parameter&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 0.5pt solid rgb(79, 98, 40); color: white; font-family: Calibri; font-size: 12pt; font-weight: 700; height: 16.5pt; text-underline-style: none; width: 450pt;&quot; width=&quot;450&quot;&gt;Definition/Value&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;84&quot; style=&quot;height: 63.0pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;84&quot; style=&quot;height: 63.0pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mCallState&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Call
  State&lt;br /&gt;
0 - CALL_STATE_IDLE(No activity.)&lt;br /&gt;
1 - CALL_STATE_RINGING&lt;br /&gt;
2 - CALL_STATE_OFFHOOK&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;21&quot; style=&quot;border-top: none; height: 15.75pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mCallIncomingNumber&lt;/td&gt;
  &lt;td align=&quot;left&quot; class=&quot;xl67&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Last incoming call number&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;231&quot; style=&quot;height: 173.25pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;231&quot; style=&quot;border-top: none; height: 173.25pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mServiceState&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Radio service State&lt;br /&gt;
0 - STATE_IN_SERVICE(Normal operation condition, the phone is registered
  with an operator either in home network or in roaming. )&lt;br /&gt;
1 - STATE_OUT_OF_SERVICE (Phone is not registered with any operator, the
  phone can be currently searching a new operator to register to, or not
  searching to registration at all, or registration is denied, or radio signal
  is not available. ) &lt;br /&gt;
2 - STATE_EMERGENCY_ONLY (The phone is registered and locked. Only
  emergency numbers are allowed. ) &lt;br /&gt;
3 - STATE_POWER_OFF(Radio of telephony is explicitly powered off.)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;21&quot; style=&quot;border-top: none; height: 15.75pt; width: 187pt;&quot; width=&quot;249&quot;&gt;SignalStrength&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Radio Signal Strength (RSSI)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;42&quot; style=&quot;border-top: none; height: 31.5pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mMessageWaiting&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Radio Message Waiting&lt;br /&gt;
true | false&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;42&quot; style=&quot;border-top: none; height: 31.5pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mCallForwarding&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Radio Call Forwarding&lt;br /&gt;
true | false&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;84&quot; style=&quot;height: 63.0pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;84&quot; style=&quot;border-top: none; height: 63.0pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mDataActivity&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;0
  - Radio Data Call Activity: DATA_ACTIVITY_NONE(No traffic.) &lt;br /&gt;
1- DATA_ACTIVITY_IN(Currently receiving IP PPP traffic.) &lt;br /&gt;
2 - DATA_ACTIVITY_OUT(Currently sending IP PPP traffic.) &lt;br /&gt;
3 - DATA_ACTIVITY_INOUT(Currently both sending and receiving IP&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;194&quot; style=&quot;height: 145.5pt; mso-height-source: userset;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;194&quot; style=&quot;border-top: none; height: 145.5pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mDataConnectionState&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Radio
  Data Connection State&lt;br /&gt;
0 - DATA_DISCONNECTED (Disconnected. IP traffic not available. ) &lt;br /&gt;
1- DATA_CONNECTING(Currently setting up a data connection.) &lt;br /&gt;
2 - DATA_CONNECTED (Connected. IP traffic should be available.) &lt;br /&gt;
3 - DATA_SUSPENDED (Suspended. The connection is up, but IP traffic is
  temporarily unavailable. For example, in a 2G network, data activity may be
  suspended when a voice call arrives.)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;147&quot; style=&quot;height: 110.25pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;147&quot; style=&quot;border-top: none; height: 110.25pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mActiveDataConnectionState&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Radio
  Data Connection State&lt;br /&gt;
0 - DATA_DISCONNECTED (Disconnected. IP traffic not available. ) &lt;br /&gt;
1- DATA_CONNECTING(Currently setting up a data connection.) &lt;br /&gt;
2 - DATA_CONNECTED (Connected. IP traffic should be available.) &lt;br /&gt;
3 - DATA_SUSPENDED (Suspended. The connection is up, but IP traffic is
  temporarily unavailable. For example, in a 2G network, data activity may be
  suspended when a voice call arrives.)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;42&quot; style=&quot;border-top: none; height: 31.5pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mDataConnectionPossible&lt;/td&gt;
  &lt;td align=&quot;left&quot; class=&quot;xl69&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Active Radio Data Connection&lt;br /&gt;
true | false&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;21&quot; style=&quot;border-top: none; height: 15.75pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mDataConnectionReason&lt;/td&gt;
  &lt;td align=&quot;left&quot; class=&quot;xl69&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Reason for data Connection&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;21&quot; style=&quot;border-top: none; height: 15.75pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mDataConnectionApn&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;APN Name&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;21&quot; style=&quot;border-top: none; height: 15.75pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mDataConnectionInterfaceName&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Name of data connection interface&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;21&quot; style=&quot;border-top: none; height: 15.75pt; width: 187pt;&quot; width=&quot;249&quot;&gt;mCellLocation&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Information of Cell Location&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;21&quot; style=&quot;border-top: none; height: 15.75pt; width: 187pt;&quot; width=&quot;249&quot;&gt;registrations: count&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 329pt;&quot; width=&quot;439&quot;&gt;Recording count of registration&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
When you want to know the status of WiFi, you can refer to following information.&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;i&gt;&lt;u&gt;WiFi Information from Dumpsys&lt;/u&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Execute&amp;nbsp;the command of &quot;adb shell dumpsys wifi&quot;, you may see the following information.&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;b&gt;&lt;/b&gt;&lt;/div&gt;
DUMP OF SERVICE wifi:&lt;br /&gt;
Wi-Fi is enabled&lt;br /&gt;
Stay-awake conditions: 0&lt;br /&gt;
Internal state:&lt;br /&gt;
current HSM state: ConnectedState&lt;br /&gt;
mLinkProperties InterfaceName: wlan0 LinkAddresses: [1.1.2.3/24 ] Routes: [0.0.0.0/0 -&amp;gt; 1.1.2.6,] DnsAddresses: [1.1.2.1,] HttpProxy: [ProxyProperties.mHost == null]&lt;br /&gt;
mWifiInfo SSID: Google, BSSID: 00:08:0a:02:03:08, MAC: 00:00:00:00:00:80, Supplicant state: COMPLETED, RSSI: -63, Link speed: 13, Net ID: 1, Explicit connect: true&lt;br /&gt;
mDhcpInfoInternal addr: 1.1.2.3/24 mRoutes: 0.0.0.0/0 -&amp;gt; 1.1.2.6 | &amp;nbsp;dns: 1.1.2.6, dhcpServer: 1.1.2.6 leaseDuration: 7200&lt;br /&gt;
mNetworkInfo NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason:(unspecified), extra: (none), roaming: false, failover: false, isAvailable: true&lt;br /&gt;
mLastSignalLevel 3&lt;br /&gt;
mLastBssid 00:00:00:00:00:00&lt;br /&gt;
mLastNetworkId 1&lt;br /&gt;
mReconnectCount 0&lt;br /&gt;
mIsScanMode false&lt;br /&gt;
Supplicant status&lt;br /&gt;
bssid=00:00:00:00:00:00&lt;br /&gt;
ssid=Google&lt;br /&gt;
id=1&lt;br /&gt;
mode=station&lt;br /&gt;
pairwise_cipher=CCMP&lt;br /&gt;
group_cipher=CCMP&lt;br /&gt;
key_mgmt=WPA2-PSK&lt;br /&gt;
wpa_state=COMPLETED&lt;br /&gt;
ip_address=1.1.2.3&lt;br /&gt;
address=00:00:00:00:00:00&lt;br /&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;The definitions of wifi information for each parameter are as follows,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 581px;&quot;&gt;
 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 5792; mso-width-source: userset; width: 136pt;&quot; width=&quot;181&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 5600; mso-width-source: userset; width: 131pt;&quot; width=&quot;175&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 7200; mso-width-source: userset; width: 169pt;&quot; width=&quot;225&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;23&quot; style=&quot;height: 17.25pt;&quot;&gt;
  &lt;td class=&quot;xl69&quot; dir=&quot;LTR&quot; height=&quot;23&quot; style=&quot;background-color: black; background-position: initial initial; background-repeat: initial initial; border-color: white; border-style: solid; border-width: 1pt 1pt 1.5pt; color: white; font-family: Perpetua; font-size: 12pt; font-weight: 700; height: 17.25pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;Parameter&lt;/td&gt;
  &lt;td class=&quot;xl70&quot; dir=&quot;LTR&quot; style=&quot;background-color: black; background-position: initial initial; background-repeat: initial initial; border-color: white; border-style: solid; border-width: 1pt 1pt 1.5pt; color: white; font-family: Perpetua; font-size: 12pt; font-weight: 700; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;Value&lt;/td&gt;
  &lt;td class=&quot;xl71&quot; dir=&quot;LTR&quot; style=&quot;background-color: black; background-position: initial initial; background-repeat: initial initial; border-color: white; border-style: solid; border-width: 1pt 1pt 1.5pt; color: white; font-family: Perpetua; font-size: 12pt; font-weight: 700; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Definition&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl72&quot; dir=&quot;LTR&quot; height=&quot;42&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border-left-color: white; border-left-width: 1pt; border-right-color: white; border-right-width: 1pt; border-style: solid solid none; border-top-color: white; border-top-width: 1.5pt; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 31.5pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;Wi-Fi is&amp;nbsp;&lt;/td&gt;
  &lt;td class=&quot;xl73&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border-left-color: white; border-left-width: 1pt; border-right-color: white; border-right-width: 1pt; border-style: solid solid none; border-top-color: white; border-top-width: 1.5pt; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;disabled|connected&lt;br /&gt;
enabled|disconnected&lt;/td&gt;
  &lt;td class=&quot;xl74&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border-left-color: white; border-left-width: 1pt; border-right-color: white; border-right-width: 1pt; border-style: solid solid none; border-top-color: white; border-top-width: 1.5pt; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Wi-Fi
  Radio State&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;Stay-awake
  conditions&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Stay-awake
  conditions value&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;Internal state&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Internal
  state&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;interface&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Netowrk
  Interface&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;runState&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Run
  State&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;SSID&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Wi-Fi
  AP&#39;s SSID&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;BSSID&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;BSSID
  of Wi-Fi AP&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;MAC&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;MAC
  Address for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;Supplicant state&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Supplicant
  state for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;RSSI&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;RSSI
  for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;Link speed&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Link
  speed for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;Net ID&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Net ID
  for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl82&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border-color: white; border-style: solid; border-width: 1pt 1pt 1.5pt; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;ipaddr&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border-color: white; border-style: solid; border-width: 1pt 1pt 1.5pt; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl83&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border-color: white; border-style: solid; border-width: 1pt 1pt 1.5pt; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Obtained IP Address for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;33&quot; style=&quot;height: 24.75pt;&quot;&gt;
  &lt;td class=&quot;xl77&quot; dir=&quot;LTR&quot; height=&quot;33&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border-color: white; border-style: solid; border-width: 1.5pt 1pt 1pt; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24.75pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;gateway&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border-color: white; border-style: solid; border-width: 1.5pt 1pt 1pt; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl78&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border-color: white; border-style: solid; border-width: 1.5pt 1pt 1pt; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Gateway for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;netmask&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Netmask
  for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;dns1&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Primary
  DNS for WiFi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;dns2&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Secondary
  DNS for WiFi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;DHCP server&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;DHCP
  address for WiFi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;23&quot; style=&quot;height: 17.25pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;23&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 17.25pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;scanModeActive&lt;/td&gt;
  &lt;td class=&quot;xl79&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;true |
  false&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Scan
  Mode Active for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;23&quot; style=&quot;height: 17.25pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;23&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 17.25pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;haveIpAddress&lt;/td&gt;
  &lt;td class=&quot;xl79&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;true |
  false&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Have IP
  Address for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;23&quot; style=&quot;height: 17.25pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;23&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 17.25pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;obtainingIpAddress&lt;/td&gt;
  &lt;td class=&quot;xl79&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;true |
  false&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Obtaining
  Ip Address for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;32&quot; style=&quot;height: 24.0pt;&quot;&gt;
  &lt;td class=&quot;xl75&quot; dir=&quot;LTR&quot; height=&quot;32&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 24pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;lastSignalLevel&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl76&quot; dir=&quot;LTR&quot; style=&quot;background-color: #9bbb59; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Last
  Signal Level for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;31&quot; style=&quot;height: 23.25pt;&quot;&gt;
  &lt;td class=&quot;xl80&quot; dir=&quot;LTR&quot; height=&quot;31&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; height: 23.25pt; text-underline-style: none; width: 136pt;&quot; width=&quot;181&quot;&gt;explicitlyDisabled&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Arial; font-size: 18pt; text-underline-style: none; width: 131pt;&quot; width=&quot;175&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl81&quot; dir=&quot;LTR&quot; style=&quot;background-color: #76933c; background-position: initial initial; background-repeat: initial initial; border: 1pt solid white; color: windowtext; font-family: Perpetua; font-size: 12pt; text-underline-style: none; width: 169pt;&quot; width=&quot;225&quot;&gt;Explicitly
  Disabled for Wi-Fi&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
There&#39;re more information you can get from dumpsys for your purpose. Aforementioned has provided you a good start on how to get them. Now, it&#39;s your turn.&lt;/div&gt;
&lt;br /&gt;
When you want to know what network interface you are using, you can look at following information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;i&gt;&lt;u&gt;Connectivity Information from Dumpsys&lt;/u&gt;&lt;/i&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
Execute&amp;nbsp;the command of &quot;adb shell dumpsys connectivity&quot;, you may see the following information.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
DUMP OF SERVICE connectivity:&lt;br /&gt;
NetworkInfo: type: mobile[UMTS], state: DISCONNECTED/DISCONNECTED, reason: dataDisabled, extra: vivi, roaming: false, failover: false, isAvailable: true&lt;br /&gt;
Mobile data state: DISCONNECTED&lt;br /&gt;
Data enabled: user=true, policy=true&lt;br /&gt;
&lt;br /&gt;
Active network: WIFI&lt;br /&gt;
NetworkInfo: type: WIFI[], state: CONNECTED/CONNECTED, reason: (unspecified), extra: (none), roaming: false, failover: false, isAvailable: true&lt;br /&gt;
android.net.wifi.WifiStateTracker@00000000&lt;br /&gt;
...&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;span style=&quot;font-weight: normal;&quot;&gt;The definitions of connectivity information for each parameter are as follows,&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 600px;&quot;&gt;
 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 6336; mso-width-source: userset; width: 149pt;&quot; width=&quot;198&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 9344; mso-width-source: userset; width: 219pt;&quot; width=&quot;292&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 9504; mso-width-source: userset; width: 223pt;&quot; width=&quot;297&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr bgcolor=&quot;#00ff00&quot; height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; dir=&quot;LTR&quot; height=&quot;22&quot; style=&quot;height: 16.5pt; width: 149pt;&quot; width=&quot;198&quot;&gt;Parameter&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; width: 219pt;&quot; width=&quot;292&quot;&gt;Value&lt;/td&gt;
  &lt;td class=&quot;xl67&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; width: 223pt;&quot; width=&quot;297&quot;&gt;Definition&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;40&quot; style=&quot;height: 30.0pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;40&quot; style=&quot;border-top: none; height: 30.0pt; width: 149pt;&quot; width=&quot;198&quot;&gt;Active network&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 219pt;&quot; width=&quot;292&quot;&gt;WiFi | UMTS&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 223pt;&quot; width=&quot;297&quot;&gt;Check if Active Network is transmitted by WiFi or UMTS&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;40&quot; style=&quot;height: 30.0pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;40&quot; style=&quot;border-top: none; height: 30.0pt; width: 149pt;&quot; width=&quot;198&quot;&gt;NetworkInfo: type: mobile&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;border-left: none; border-top: none; width: 219pt;&quot; width=&quot;292&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 223pt;&quot; width=&quot;297&quot;&gt;NetworkInfo: type for mobile: HSDPA|UMTS&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;66&quot; rowspan=&quot;3&quot; style=&quot;border-top: none; height: 49.5pt; width: 149pt;&quot; width=&quot;198&quot;&gt;state&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 219pt;&quot; width=&quot;292&quot;&gt;UNKNOW / IDEL&amp;nbsp;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; rowspan=&quot;3&quot; style=&quot;border-top: none; width: 223pt;&quot; width=&quot;297&quot;&gt;Radio
  State&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;22&quot; style=&quot;border-left: none; border-top: none; height: 16.5pt; width: 219pt;&quot; width=&quot;292&quot;&gt;CONNECTED|CONNECTED&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;22&quot; style=&quot;border-left: none; border-top: none; height: 16.5pt; width: 219pt;&quot; width=&quot;292&quot;&gt;DISCONNECTED|DISCONNECTED&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;31&quot; style=&quot;height: 23.25pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;31&quot; style=&quot;border-top: none; height: 23.25pt; width: 149pt;&quot; width=&quot;198&quot;&gt;Extra&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;border-left: none; border-top: none; width: 219pt;&quot; width=&quot;292&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 223pt;&quot; width=&quot;297&quot;&gt;NetworkInfo: Carrier Name&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt; width: 149pt;&quot; width=&quot;198&quot;&gt;roaming&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 219pt;&quot; width=&quot;292&quot;&gt;true | false&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 223pt;&quot; width=&quot;297&quot;&gt;Roaming state&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;31&quot; style=&quot;height: 23.25pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;31&quot; style=&quot;border-top: none; height: 23.25pt; width: 149pt;&quot; width=&quot;198&quot;&gt;failover&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 219pt;&quot; width=&quot;292&quot;&gt;true | false&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;border-left: none; border-top: none; width: 223pt;&quot; width=&quot;297&quot;&gt;　&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt; width: 149pt;&quot; width=&quot;198&quot;&gt;isAvailable&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 219pt;&quot; width=&quot;292&quot;&gt;true | false&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; dir=&quot;LTR&quot; style=&quot;border-left: none; border-top: none; width: 223pt;&quot; width=&quot;297&quot;&gt;Check if Mobile network is available&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b style=&quot;font-weight: bold;&quot;&gt;How Jython and MonkeyRunner use these information to do automated testings ?&lt;/b&gt;&lt;br /&gt;
&lt;div style=&quot;font-weight: bold;&quot;&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
Using shell command in MonkeyRunner and executing dumpsys service_name, you can get the particular information from it and parse/filter those information by Jython Script. Hence, you can use these information for your testing or control purpose.&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;b&gt;Reference&lt;/b&gt;&lt;/div&gt;
&lt;div&gt;
Dumpsys,&amp;nbsp;&lt;a href=&quot;http://source.android.com/tech/input/dumpsys.html&quot;&gt;http://source.android.com/tech/input/dumpsys.html&lt;/a&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/7871466878876845994/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/dumpsys-information-android-open-source.html#comment-form' title='32 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7871466878876845994'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7871466878876845994'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/dumpsys-information-android-open-source.html' title='Dumpsys Information - Android Open Source'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>32</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-4502342896805037581</id><published>2012-10-23T00:17:00.000-07:00</published><updated>2013-04-23T00:37:09.851-07:00</updated><title type='text'>A guide to Activity, Service, and Content Provider Testing by JUnit</title><content type='html'>&lt;br /&gt;
Android Develop Team has well introduction on Activity Test by JUnit. Here is the link leads you to explore the testing skill.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://developer.android.com/tools/testing/activity_test.html&quot;&gt;http://developer.android.com/tools/testing/activity_test.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
For Service Testing by JUnit, take a look WEB sit -&amp;nbsp;&lt;a href=&quot;http://developer.android.com/tools/testing/service_testing.html&quot;&gt;http://developer.android.com/tools/testing/service_testing.html&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
For Content provider testing by JUnit, take a look WEB sit -&amp;nbsp;&lt;a href=&quot;http://developer.android.com/tools/testing/contentprovider_testing.html&quot;&gt;http://developer.android.com/tools/testing/contentprovider_testing.html&lt;/a&gt;.&lt;br /&gt;
&lt;br /&gt;
The limitation for this method to do test is that you need to have the source code of Activity you want to test. And you need to compile test case with source code of Activity.&lt;br /&gt;
&lt;br /&gt;
One of strength of using JUnit to test Activity is you can control the particular UI component such as a button, or a textarea. Another good standpoint is that you can use JUnit to manage your test case and test result. There&#39;s another testing tool to test Android Framework called CTS. The CTS uses JUnit for its testing framework as well. With respect to CTS, take a look following WEB Site for more information.&amp;nbsp;&lt;a href=&quot;http://source.android.com/compatibility/cts-development.html&quot;&gt;http://source.android.com/compatibility/cts-development.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/4502342896805037581/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/a-guide-to-activity-test-by-junit.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/4502342896805037581'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/4502342896805037581'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/a-guide-to-activity-test-by-junit.html' title='A guide to Activity, Service, and Content Provider Testing by JUnit'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-2578935657279688541</id><published>2012-10-18T20:35:00.002-07:00</published><updated>2013-04-23T00:38:41.405-07:00</updated><title type='text'>Android / Linux Shell Command List</title><content type='html'>&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Preface&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
We&#39;ve discussed&amp;nbsp;about the Android / Linux Command&amp;nbsp;in separate article. Here, we want to talk about what we can use and where to find the useful commands in Android device. Connect your Android device and launch a command line window in advance. Then you can try to use all these commands by executing command adb shell command_name.&lt;br /&gt;
&lt;br /&gt;
The following commands can be found in the folder &quot;/system/bin/ on Nexus 7.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;table border=&quot;1&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 600px;&quot;&gt;
 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 5760; mso-width-source: userset; width: 135pt;&quot; width=&quot;180&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 14720; mso-width-source: userset; width: 345pt;&quot; width=&quot;460&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;border-bottom-color: rgb(79, 129, 189); border-bottom-width: 0.5pt; border-style: solid none; border-top-color: rgb(79, 129, 189); border-top-width: 0.5pt; color: #366092; font-family: Calibri; font-size: 12pt; font-weight: 700; height: 15.75pt; text-underline-style: none; width: 135pt;&quot; width=&quot;180&quot;&gt;Commands&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;border-bottom-color: rgb(79, 129, 189); border-bottom-width: 0.5pt; border-style: solid none; border-top-color: rgb(79, 129, 189); border-top-width: 0.5pt; color: #366092; font-family: Calibri; font-size: 12pt; font-weight: 700; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Desc.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;adb&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Android
  Debug Bridge&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;am&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Activity Manager&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;105&quot; style=&quot;height: 78.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;105&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 78.75pt; text-underline-style: none;&quot;&gt;app_process&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Execute a
  runtime environment for a dalvik class/Jar file.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;210&quot; style=&quot;height: 157.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;210&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 157.5pt; text-underline-style: none;&quot;&gt;applypatch&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Apply patches to android files.&lt;br /&gt;
usage: applypatch &lt;src-file&gt; &lt;tgt-file&gt; &lt;tgt-sha1&gt;
  &lt;tgt-size&gt; [&lt;src-sha1&gt;:&lt;patch&gt; ...]&lt;br /&gt;
    &amp;nbsp;&amp;nbsp; or&amp;nbsp;
  applypatch -c &lt;file&gt; [&lt;sha1&gt; ...]&lt;br /&gt;
    &amp;nbsp;&amp;nbsp; or&amp;nbsp;
  applypatch -s &lt;bytes&gt;&lt;br /&gt;
    &amp;nbsp;&amp;nbsp; or&amp;nbsp;
  applypatch -l&lt;br /&gt;
    &lt;br /&gt;
    Filenames may be of the form&lt;br /&gt;
    &amp;nbsp;
  MTD:&lt;partition&gt;:&lt;len_1&gt;:&lt;sha1_1&gt;:&lt;len_2&gt;:&lt;sha1_2&gt;:...&lt;br /&gt;
    to specify reading from or writing to an MTD partition.&lt;/sha1_2&gt;&lt;/len_2&gt;&lt;/sha1_1&gt;&lt;/len_1&gt;&lt;/partition&gt;&lt;/bytes&gt;&lt;/sha1&gt;&lt;/file&gt;&lt;/patch&gt;&lt;/src-sha1&gt;&lt;/tgt-size&gt;&lt;/tgt-sha1&gt;&lt;/tgt-file&gt;&lt;/src-file&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;315&quot; style=&quot;height: 236.25pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;315&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 236.25pt; text-underline-style: none;&quot;&gt;atrace&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Trace
  information captured in the folder of /sys/kernel/debug/tracing/&lt;br /&gt;
usage: atrace [options]. Measure the system performance and do the
  analysis. Systrace tool provides more parameters to measure the performance
  than atrace. &lt;br /&gt;
options include:&lt;br /&gt;
&amp;nbsp; -b N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; use a trace buffer size of N
  KB&lt;br /&gt;
&amp;nbsp; -c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace into a circular
  buffer&lt;br /&gt;
&amp;nbsp; -d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace disk I/O&lt;br /&gt;
&amp;nbsp; -f&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace CPU frequency changes&lt;br /&gt;
&amp;nbsp; -l&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace CPU frequency governor
  load&lt;br /&gt;
&amp;nbsp; -s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace the kernel scheduler
  switches&lt;br /&gt;
&amp;nbsp; -t N&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace for N seconds [defualt
  5]&lt;br /&gt;
&amp;nbsp; -w&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; trace the kernel
  workqueue&lt;br /&gt;
&amp;nbsp; -z&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; compress the trace dump&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;294&quot; style=&quot;height: 220.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;294&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 220.5pt; text-underline-style: none;&quot;&gt;bluetoothd&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Bluetooth Debuging Utility&lt;br /&gt;
Usage:&lt;br /&gt;
&amp;nbsp; bluetoothd [OPTION...]&lt;br /&gt;
&lt;br /&gt;
Help Options:&lt;br /&gt;
&amp;nbsp; -?, --help&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Show help options&lt;br /&gt;
&lt;br /&gt;
Application Options:&lt;br /&gt;
&amp;nbsp; -d, --debug=DEBUG&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Specify debug options to
  enable&lt;br /&gt;
&amp;nbsp; -p, --plugin=NAME,..,&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Specify plugins to load&lt;br /&gt;
&amp;nbsp; -P, --noplugin=NAME,...&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Specify plugins not to load&lt;br /&gt;
&amp;nbsp; -n, --nodetach&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Don&#39;t run as daemon in
  background&lt;br /&gt;
&amp;nbsp; -v, --version&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Show version information and
  exit&lt;br /&gt;
&amp;nbsp; -u, --udev&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Run from udev mode of
  operation&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;294&quot; style=&quot;height: 220.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;294&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 220.5pt; text-underline-style: none;&quot;&gt;bmgr&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;bmgr is
  a shell tool you can use to interact with the Backup Manager on Android
  devices.&lt;br /&gt;
usage: bmgr [backup|restore|list|transport|run]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bmgr backup PACKAGE&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bmgr enable BOOL&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bmgr enabled&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bmgr list transports&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bmgr list sets&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bmgr transport WHICH&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bmgr restore TOKEN&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bmgr restore TOKEN
  PACKAGE...&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bmgr restore PACKAGE&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bmgr run&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; bmgr wipe PACKAGE&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;bootanimation&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Show the boot animation.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;231&quot; style=&quot;height: 173.25pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;231&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 173.25pt; text-underline-style: none;&quot;&gt;brcm_patchram_plus&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;This
  program downloads a patchram files in the HCD format to Broadcom Bluetooth
  based silicon and combo chips and and other utility functions.&lt;br /&gt;
It can be invoked from the command line in the form&lt;br /&gt;
&amp;nbsp;&lt;-d&gt; to print a debug
  log&lt;br /&gt;
    &amp;nbsp;&lt;--patchram patchram_file=&quot;patchram_file&quot;&gt;&lt;br /&gt;
    &amp;nbsp;&lt;--baudrate baud_rate=&quot;baud_rate&quot;&gt;&lt;br /&gt;
    &amp;nbsp;&lt;--bd_addr bd_address=&quot;bd_address&quot;&gt;&lt;br /&gt;
    &amp;nbsp;&lt;--enable_lpm&gt;&lt;br /&gt;
    &amp;nbsp;&lt;--enable_hci&gt;&lt;br /&gt;
    &amp;nbsp;uart_device_name&lt;!----enable_hci--&gt;&lt;!----enable_lpm--&gt;&lt;!----bd_addr--&gt;&lt;!----baudrate--&gt;&lt;!----patchram--&gt;&lt;!---d--&gt;&lt;/--enable_hci&gt;&lt;/--enable_lpm&gt;&lt;/--bd_addr&gt;&lt;/--baudrate&gt;&lt;/--patchram&gt;&lt;/-d&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;btmacreader&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Bluetooth MAC Reader.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;189&quot; style=&quot;height: 141.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;189&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 141.75pt; text-underline-style: none;&quot;&gt;bu&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Backup&lt;br /&gt;
Options:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -apk,&amp;nbsp;&amp;nbsp; Save APK&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -noapk,&amp;nbsp; Save no APK&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -shared,&amp;nbsp; Save Shared&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -noshared, Save no Shared&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -system,&amp;nbsp; All Includes System&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -nosystem,&amp;nbsp; Not all Includes System&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -all,&amp;nbsp;&amp;nbsp; Everything&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;bugmailer.sh&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Send Bug Report to Vendor.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;bugreport&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Export all
  the debug message from Android and Linux layer.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;cat -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Concatenate, a tool to print out the content of a file
  continually. It&#39;s the same usage with Linux.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;chmod
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Change the
  mode of file. Usage is the same with Linux.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;chown -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Change the owner of a file/folder. Usage is the same
  with Linux.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;cmp
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Compare the
  file. Usage is the same with Linux.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;546&quot; style=&quot;height: 409.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;546&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 409.5pt; text-underline-style: none;&quot;&gt;content&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Perform operations on particular content&lt;br /&gt;
usage: adb shell content [subcommand] [options]&lt;br /&gt;
usage: adb shell content insert --uri &lt;uri&gt; --bind &lt;binding&gt;
  [--bind &lt;binding&gt;...]&lt;br /&gt;
    &amp;nbsp; &lt;uri&gt; a content provider
  URI.&lt;br /&gt;
    &amp;nbsp; &lt;binding&gt; binds a typed value
  to a column and is formatted:&lt;br /&gt;
    &amp;nbsp;
  &lt;column_name&gt;:&lt;type&gt;:&lt;column_value&gt; where:&lt;br /&gt;
    &amp;nbsp; &lt;type&gt; specifies data type
  such as:&lt;br /&gt;
    &amp;nbsp; b - boolean, s - string, i -
  integer, l - long, f - float, d - double&lt;br /&gt;
    &amp;nbsp; Note: Omit the value for passing an
  empty string, e.g column:s:&lt;br /&gt;
    &amp;nbsp; Example:&lt;br /&gt;
    &amp;nbsp; # Add &quot;new_setting&quot;
  secure setting with value &quot;new_value&quot;.&lt;br /&gt;
    &amp;nbsp; adb shell content insert --uri
  content://settings/secure --bind name:s:new_setting --bind
  value:s:new_value&lt;br /&gt;
    &lt;br /&gt;
    usage: adb shell content update --uri &lt;uri&gt; [--where
  &lt;where&gt;]&lt;br /&gt;
    &amp;nbsp; &lt;where&gt; is a SQL style where
  clause in quotes (You have to escape single quotes - see example
  below).&lt;br /&gt;
    &amp;nbsp; Example:&lt;br /&gt;
    &amp;nbsp; # Change &quot;new_setting&quot;
  secure setting to &quot;newer_value&quot;.&lt;br /&gt;
    &amp;nbsp; adb shell content update --uri
  content://settings/secure --bind value:s:newer_value --where
  &quot;name=&#39;new_setting&#39;&quot;&lt;br /&gt;
    &lt;br /&gt;
    usage: adb shell content delete --uri &lt;uri&gt; --bind &lt;binding&gt;
  [--bind &lt;binding&gt;...] [--where &lt;where&gt;]&lt;br /&gt;
    &amp;nbsp; Example:&lt;br /&gt;
    &amp;nbsp; # Remove &quot;new_setting&quot;
  secure setting.&lt;br /&gt;
    &amp;nbsp; adb shell content delete --uri
  content://settings/secure --where &quot;name=&#39;new_setting&#39;&quot;&lt;br /&gt;
    &lt;br /&gt;
    usage: adb shell content query --uri &lt;uri&gt; [--projection &lt;projection&gt;]
  [--where &lt;where&gt;] [--sort &lt;sort_order&gt;]&lt;br /&gt;
    &amp;nbsp; &lt;projection&gt; is a list of
  colon separated column names and is formatted:&lt;br /&gt;
    &amp;nbsp; &lt;column_name&gt;[:&lt;column_name&gt;...]&lt;br /&gt;
    &amp;nbsp; &lt;sort_oreder&gt; is the order in
  which rows in the result should be sorted.&lt;br /&gt;
    &amp;nbsp; Example:&lt;br /&gt;
    &amp;nbsp; # Select &quot;name&quot; and
  &quot;value&quot; columns from secure settings where &quot;name&quot; is
  equal to &quot;new_setting&quot; and sort the result by name in ascending
  order.&lt;br /&gt;
    &amp;nbsp; adb shell content query --uri
  content://settings/secure --projection name:value --where
  &quot;name=&#39;new_setting&#39;&quot; --sort &quot;name ASC&quot;&lt;/sort_oreder&gt;&lt;/column_name&gt;&lt;/column_name&gt;&lt;/projection&gt;&lt;/sort_order&gt;&lt;/where&gt;&lt;/projection&gt;&lt;/uri&gt;&lt;/where&gt;&lt;/binding&gt;&lt;/binding&gt;&lt;/uri&gt;&lt;/where&gt;&lt;/where&gt;&lt;/uri&gt;&lt;/type&gt;&lt;/column_value&gt;&lt;/type&gt;&lt;/column_name&gt;&lt;/binding&gt;&lt;/uri&gt;&lt;/binding&gt;&lt;/binding&gt;&lt;/uri&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;546&quot; style=&quot;height: 409.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;546&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 409.5pt; text-underline-style: none;&quot;&gt;dalvikvm&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Launch
  the Dalvik VM to run a Java class in DEX format.&lt;br /&gt;
dalvikvm: [options] class [argument ...]&lt;br /&gt;
dalvikvm: [options] -jar file.jar [argument ...]&lt;br /&gt;
&lt;br /&gt;
The following standard options are recognized:&lt;br /&gt;
&amp;nbsp; -classpath classpath&lt;br /&gt;
&amp;nbsp; -Dproperty=value&lt;br /&gt;
&amp;nbsp; -verbose:tag&amp;nbsp; (&#39;gc&#39;, &#39;jni&#39;, or &#39;class&#39;)&lt;br /&gt;
&amp;nbsp; -ea[:&lt;package name=&quot;name&quot;&gt;...
  |:&lt;class name=&quot;name&quot;&gt;]&lt;br /&gt;
    &amp;nbsp; -da[:&lt;package name=&quot;name&quot;&gt;...
  |:&lt;class name=&quot;name&quot;&gt;]&lt;br /&gt;
    &amp;nbsp;&amp;nbsp; (-enableassertions,
  -disableassertions)&lt;br /&gt;
    &amp;nbsp; -esa&lt;br /&gt;
    &amp;nbsp; -dsa&lt;br /&gt;
    &amp;nbsp;&amp;nbsp; (-enablesystemassertions,
  -disablesystemassertions)&lt;br /&gt;
    &amp;nbsp; -showversion&lt;br /&gt;
    &amp;nbsp; -help&lt;br /&gt;
    &lt;br /&gt;
    The following extended options are recognized:&lt;br /&gt;
    &amp;nbsp; -Xrunjdwp:&lt;options&gt;&lt;br /&gt;
    &amp;nbsp; -Xbootclasspath:bootclasspath&lt;br /&gt;
    &amp;nbsp; -Xcheck:tag&amp;nbsp; (e.g. &#39;jni&#39;)&lt;br /&gt;
    &amp;nbsp; -XmsN&amp;nbsp; (min heap, must be multiple of 1K, &amp;gt;=
  1MB)&lt;br /&gt;
    &amp;nbsp; -XmxN&amp;nbsp; (max heap, must be multiple of 1K, &amp;gt;=
  2MB)&lt;br /&gt;
    &amp;nbsp; -XssN&amp;nbsp; (stack size, &amp;gt;= 1KB, &amp;lt;= 256KB)&lt;br /&gt;
    &amp;nbsp; -Xverify:{none,remote,all}&lt;br /&gt;
    &amp;nbsp; -Xrs&lt;br /&gt;
    &amp;nbsp; -Xint&amp;nbsp; (extended to accept &#39;:portable&#39;, &#39;:fast&#39;
  and &#39;:jit&#39;)&lt;br /&gt;
    &lt;br /&gt;
    These are unique to Dalvik:&lt;br /&gt;
    &amp;nbsp; -Xzygote&lt;br /&gt;
    &amp;nbsp;
  -Xdexopt:{none,verified,all,full}&lt;br /&gt;
    &amp;nbsp; -Xnoquithandler&lt;br /&gt;
    &amp;nbsp; -Xjnigreflimit:N&amp;nbsp; (must be multiple of 100, &amp;gt;= 200)&lt;br /&gt;
    &amp;nbsp;
  -Xjniopts:{warnonly,forcecopy}&lt;br /&gt;
    &amp;nbsp; -Xjnitrace:substring (eg
  NativeClass or nativeMethod)&lt;br /&gt;
    &amp;nbsp; -Xstacktracefile:&lt;filename&gt;&lt;br /&gt;
    &amp;nbsp; -Xgc:[no]precise&lt;br /&gt;
    &amp;nbsp; -Xgc:[no]preverify&lt;br /&gt;
    &amp;nbsp; -Xgc:[no]postverify&lt;br /&gt;
    &amp;nbsp; -Xgc:[no]concurrent&lt;br /&gt;
    &amp;nbsp; -Xgc:[no]verifycardtable&lt;br /&gt;
    &amp;nbsp; -XX:+DisableExplicitGC&lt;br /&gt;
    &amp;nbsp; -X[no]genregmap&lt;br /&gt;
    &amp;nbsp; -Xverifyopt:[no]checkmon&lt;br /&gt;
    &amp;nbsp; -Xcheckdexsum&lt;br /&gt;
    &amp;nbsp; -Xincludeselectedop&lt;br /&gt;
    &amp;nbsp;
  -Xjitop:hexopvalue[-endvalue][,hexopvalue[-endvalue]]*&lt;br /&gt;
    &amp;nbsp; -Xincludeselectedmethod&lt;br /&gt;
    &amp;nbsp; -Xjitthreshold:decimalvalue&lt;br /&gt;
    &amp;nbsp; -Xjitblocking&lt;br /&gt;
    &amp;nbsp; -Xjitmethod:signature[,signature]*
  (eg Ljava/lang/String\;replace)&lt;br /&gt;
    &amp;nbsp; -Xjitcheckcg&lt;br /&gt;
    &amp;nbsp; -Xjitverbose&lt;br /&gt;
    &amp;nbsp; -Xjitprofile&lt;br /&gt;
    &amp;nbsp; -Xjitdisableopt&lt;br /&gt;
    &amp;nbsp; -Xjitsuspendpoll&lt;br /&gt;
    &lt;br /&gt;
    Configured with: debugger profiler hprof jit(armv7-a)
  show_exception=1&lt;br /&gt;
    &lt;br /&gt;
    Dalvik VM init failed (check log file)&lt;/filename&gt;&lt;/options&gt;&lt;/class&gt;&lt;/package&gt;&lt;/class&gt;&lt;/package&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;date -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Set date value.&lt;br /&gt;
date -s yyyymmdd, set date on Android&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;273&quot; style=&quot;height: 204.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;273&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 204.75pt; text-underline-style: none;&quot;&gt;dd
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Copy,
  Convert, and Format a file.&lt;br /&gt;
Usage: dd [options]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; bs=BYTES [block size]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; cbs=BYTES [conversion record
  size]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; conv=KEYWORDS [conv option
  disabled]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; count=BLOCKS [block count]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; ibs=BYTES [input block size]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; if=FILE [read file]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; obs=BYTES [output block
  size]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; of=FILE [write file]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; seek=BLOCKS [seek blocks]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; skip=BLOCKS [skip blocks]&lt;br /&gt;
Ex: dd if=/data/local/tmp/1gb bs=64k | dd of=/sdcard/1gb&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;df -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;List free space on disk&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;dmesg
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Output linux
  debug message&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;189&quot; style=&quot;height: 141.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;189&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 141.75pt; text-underline-style: none;&quot;&gt;dumpstate&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Dump system status&lt;br /&gt;
usage: dumpstate [-b soundfile] [-e soundfile] [-o file [-d] [-p] [-z]]
  [-s]&lt;br /&gt;
&amp;nbsp; -o: write to file (instead of
  stdout)&lt;br /&gt;
&amp;nbsp; -d: append date to filename
  (requires -o)&lt;br /&gt;
&amp;nbsp; -z: gzip output (requires -o)&lt;br /&gt;
&amp;nbsp; -p: capture screenshot to
  filename.png (requires -o)&lt;br /&gt;
&amp;nbsp; -s: write output to control socket
  (for init)&lt;br /&gt;
&amp;nbsp; -b: play sound file instead of
  vibrate, at beginning of job&lt;br /&gt;
&amp;nbsp; -e: play sound file instead of
  vibrate, at end of job&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;207&quot; style=&quot;height: 155.25pt; mso-height-source: userset;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;207&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 155.25pt; text-underline-style: none;&quot;&gt;dumpsys&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Dump
  functional state&lt;br /&gt;
dumpsys [options]&lt;br /&gt;
Execute dumpsys will output all the message in case there&#39;s no option
  specified.&lt;br /&gt;
option: &lt;in 7=&quot;7&quot; nexus=&quot;nexus&quot;&gt;&lt;br /&gt;
    &amp;nbsp; accessibility&lt;br /&gt;
    &amp;nbsp; account&lt;br /&gt;
    &amp;nbsp; activity&lt;br /&gt;
    &amp;nbsp; alarm&lt;br /&gt;
    &amp;nbsp; appwidget&lt;br /&gt;
    &amp;nbsp; audio&lt;br /&gt;
    &amp;nbsp; backup&lt;br /&gt;
    &amp;nbsp; battery&lt;br /&gt;
    &amp;nbsp; batteryinfo&lt;br /&gt;
    &amp;nbsp; bluetooth&lt;br /&gt;
    &amp;nbsp; bluetooth_a2dp&lt;br /&gt;
    &amp;nbsp; clipboard&lt;br /&gt;
    &amp;nbsp; commontime_management&lt;br /&gt;
    &amp;nbsp; connectivity&lt;br /&gt;
    &amp;nbsp; content&lt;br /&gt;
    &amp;nbsp; country_detector&lt;br /&gt;
    &amp;nbsp; cpuinfo&lt;br /&gt;
    &amp;nbsp; dbinfo&lt;br /&gt;
    &amp;nbsp; device_policy&lt;br /&gt;
    &amp;nbsp; devicestoragemonitor&lt;br /&gt;
    &amp;nbsp; diskstats&lt;br /&gt;
    &amp;nbsp; drm.drmManager&lt;br /&gt;
    &amp;nbsp; dropbox&lt;br /&gt;
    &amp;nbsp; entropy&lt;br /&gt;
    &amp;nbsp; gfxinfo&lt;br /&gt;
    &amp;nbsp; hardware&lt;br /&gt;
    &amp;nbsp; input&lt;br /&gt;
    &amp;nbsp; input_method&lt;br /&gt;
    &amp;nbsp; iphonesubinfo&lt;br /&gt;
    &amp;nbsp; isms&lt;br /&gt;
    &amp;nbsp; location&lt;br /&gt;
    &amp;nbsp; lock_settings&lt;br /&gt;
    &amp;nbsp; media.audio_flinger&lt;br /&gt;
    &amp;nbsp; media.audio_policy&lt;br /&gt;
    &amp;nbsp; media.camera&lt;br /&gt;
    &amp;nbsp; media.player&lt;br /&gt;
    &amp;nbsp; meminfo&lt;br /&gt;
    &amp;nbsp; mount&lt;br /&gt;
    &amp;nbsp; netpolicy&lt;br /&gt;
    &amp;nbsp; netstats&lt;br /&gt;
    &amp;nbsp; network_management&lt;br /&gt;
    &amp;nbsp; nfc&lt;br /&gt;
    &amp;nbsp; notification&lt;br /&gt;
    &amp;nbsp; package&lt;br /&gt;
    &amp;nbsp; permission&lt;br /&gt;
    &amp;nbsp; phone&lt;br /&gt;
    &amp;nbsp; power&lt;br /&gt;
    &amp;nbsp; samplingprofiler&lt;br /&gt;
    &amp;nbsp; scheduling_policy&lt;br /&gt;
    &amp;nbsp; search&lt;br /&gt;
    &amp;nbsp; sensorservice&lt;br /&gt;
    &amp;nbsp; serial&lt;br /&gt;
    &amp;nbsp; servicediscovery&lt;br /&gt;
    &amp;nbsp; simphonebook&lt;br /&gt;
    &amp;nbsp; sip&lt;br /&gt;
    &amp;nbsp; statusbar&lt;br /&gt;
    &amp;nbsp; SurfaceFlinger&lt;br /&gt;
    &amp;nbsp; telephony.registry&lt;br /&gt;
    &amp;nbsp; textservices&lt;br /&gt;
    &amp;nbsp; throttle&lt;br /&gt;
    &amp;nbsp; uimode&lt;br /&gt;
    &amp;nbsp; updatelock&lt;br /&gt;
    &amp;nbsp; usagestats&lt;br /&gt;
    &amp;nbsp; usb&lt;br /&gt;
    &amp;nbsp; vibrator&lt;br /&gt;
    &amp;nbsp; wallpaper&lt;br /&gt;
    &amp;nbsp; wifi&lt;br /&gt;
    &amp;nbsp; wifip2p&lt;br /&gt;
    &amp;nbsp; window&lt;/in&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;399&quot; style=&quot;height: 299.25pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;399&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 299.25pt; text-underline-style: none;&quot;&gt;getevent -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;The getevent tool runs on the device and provides
  information about input devices and a live dump of kernel input events.&lt;br /&gt;
Usage: getevent [-t] [-n] [-s switchmask] [-S] [-v [mask]] [-d] [-p] [-i]
  [-l] [-q] [-c count] [-r]&lt;br /&gt;
[device]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -t: show time stamps&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -n: don&#39;t print newlines&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -s: print switch states for given
  bits&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -S: print all switch states&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -v: verbosity mask (errs=1,
  dev=2, name=4, info=8, vers=16, pos. events=32, props=64)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -d: show HID descriptor, if
  available&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -p: show possible events (errs,
  dev, name, pos. events)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -i: show all device info and
  possible events&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -l: label event types and names
  in plain text&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -q: quiet (clear verbosity
  mask)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -c: print given number of events
  then exit&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -r: print rate events are
  received&lt;br /&gt;
http://source.android.com/tech/input/getevent.html&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;getprop
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;List some
  property of Android&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;84&quot; style=&quot;height: 63.0pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;84&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 63pt; text-underline-style: none;&quot;&gt;hd -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;To sum up each character in specified file and
  result the summation.&lt;br /&gt;
To do hd command repeatedly and to set delay interval between each
  execution if -r is designated.&lt;br /&gt;
Usage: hd [-b base] [-c count] [-r delay] file&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;id
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Print
  uid, gid, and context&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;84&quot; style=&quot;height: 63.0pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;84&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 63pt; text-underline-style: none;&quot;&gt;ifconfig -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;TCP/IP command. Assign an address to a network
  interface and/or configure network interface parameters. ifconfig is
  typically used at boot time to define the network address of each interface
  on a machine.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;iftop
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Show
  the packet flow for each network interface&lt;br /&gt;
Usage: iftop [ -r repeats] [ -d delay ]&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;84&quot; style=&quot;height: 63.0pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;84&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 63pt; text-underline-style: none;&quot;&gt;input&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Send string or key event to device&lt;br /&gt;
usage: input [text|keyevent]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input text
  &lt;string&gt;&lt;br /&gt;
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; input keyevent
  &lt;event_code&gt;&lt;/event_code&gt;&lt;/string&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;63&quot; style=&quot;height: 47.25pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;63&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 47.25pt; text-underline-style: none;&quot;&gt;insmod
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Load a
  module into the kernel at runtime. The module cannot be used after
  reboot.&lt;br /&gt;
Usage: insmod &lt;module .o=&quot;.o&quot;&gt;&lt;/module&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;147&quot; style=&quot;height: 110.25pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;147&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 110.25pt; text-underline-style: none;&quot;&gt;ioctl -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;IO Control Command between Up and lower
  layer.&lt;br /&gt;
ioctl [-l &lt;length&gt;] [-a &lt;argsize&gt;] [-rdh] &lt;device&gt;
  &lt;ioctlnr&gt;&lt;br /&gt;
    &amp;nbsp; -l &lt;lenght&gt;&amp;nbsp;&amp;nbsp; Length of io buffer&lt;br /&gt;
    &amp;nbsp; -a &lt;argsize&gt;&amp;nbsp; Size of each argument (1-8)&lt;br /&gt;
    &amp;nbsp; -r&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Open device in read only
  mode&lt;br /&gt;
    &amp;nbsp; -d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Direct argument (no
  iobuffer)&lt;br /&gt;
    &amp;nbsp; -h&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Print help&lt;/argsize&gt;&lt;/lenght&gt;&lt;/ioctlnr&gt;&lt;/device&gt;&lt;/argsize&gt;&lt;/length&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;ionice
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Configure
  the Process.&lt;br /&gt;
Usage: ionice &lt;pid&gt; [none|rt|be|idle] [prio]&lt;/pid&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;63&quot; style=&quot;height: 47.25pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;63&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 47.25pt; text-underline-style: none;&quot;&gt;kill -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Kill the process&lt;br /&gt;
usage:&amp;nbsp; kill [-s signame | -signum |
  -signame] { job | pid | pgrp }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; kill -l [exit_status ...]&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;63&quot; style=&quot;height: 47.25pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;63&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 47.25pt; text-underline-style: none;&quot;&gt;ln
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Create
  pseudonyms (links) for files, allowing them to be accessed by different
  names.&lt;br /&gt;
ln [-s] &lt;target&gt; &lt;name&gt;&lt;/name&gt;&lt;/target&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;84&quot; style=&quot;height: 63.0pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;84&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 63pt; text-underline-style: none;&quot;&gt;log -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Display specified log information.&lt;br /&gt;
USAGE: log [-p priorityChar] [-t tag] message&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; priorityChar should be one
  of:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; v,d,i,w,e&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;546&quot; style=&quot;height: 409.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;546&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 409.5pt; text-underline-style: none;&quot;&gt;logcat&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Real
  time Log for all application running on Android System.&lt;br /&gt;
options include:&lt;br /&gt;
&amp;nbsp; -s&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set default filter to
  silent.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Like specifying
  filterspec &#39;*:s&#39;&lt;br /&gt;
&amp;nbsp; -f &lt;filename&gt;&amp;nbsp;&amp;nbsp; Log to file. Default to stdout&lt;br /&gt;
    &amp;nbsp; -r [&lt;kbytes&gt;]&amp;nbsp;&amp;nbsp; Rotate log every kbytes. (16 if
  unspecified). Requires -f&lt;br /&gt;
    &amp;nbsp; -n &lt;count&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sets max number of rotated logs to
  &lt;count&gt;, default 4&lt;br /&gt;
    &amp;nbsp; -v &lt;format&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Sets the log print format, where
  &lt;format&gt; is one of:&lt;br /&gt;
    &lt;br /&gt;
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; brief process tag
  thread raw time threadtime long&lt;br /&gt;
    &lt;br /&gt;
    &amp;nbsp; -c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; clear (flush) the entire log
  and exit&lt;br /&gt;
    &amp;nbsp; -d&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dump the log and then exit
  (don&#39;t block)&lt;br /&gt;
    &amp;nbsp; -t &lt;count&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print only the most recent
  &lt;count&gt; lines (implies -d)&lt;br /&gt;
    &amp;nbsp; -g&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; get the size of the log&#39;s ring
  buffer and exit&lt;br /&gt;
    &amp;nbsp; -b &lt;buffer&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Request alternate ring buffer, &#39;main&#39;,
  &#39;system&#39;, &#39;radio&#39;&lt;br /&gt;
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; or &#39;events&#39;.
  Multiple -b parameters are allowed and the&lt;br /&gt;
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; results are
  interleaved. The default is -b main -b system.&lt;br /&gt;
    &amp;nbsp; -B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; output the log in binary&lt;br /&gt;
    filterspecs are a series of&lt;br /&gt;
    &amp;nbsp; &lt;tag&gt;[:priority]&lt;br /&gt;
    &lt;br /&gt;
    where &lt;tag&gt; is a log component tag (or * for all) and priority
  is:&lt;br /&gt;
    &amp;nbsp; V&amp;nbsp;&amp;nbsp;&amp;nbsp;
  Verbose&lt;br /&gt;
    &amp;nbsp; D&amp;nbsp;&amp;nbsp;&amp;nbsp;
  Debug&lt;br /&gt;
    &amp;nbsp; I&amp;nbsp;&amp;nbsp;&amp;nbsp;
  Info&lt;br /&gt;
    &amp;nbsp; W&amp;nbsp;&amp;nbsp;&amp;nbsp;
  Warn&lt;br /&gt;
    &amp;nbsp; E&amp;nbsp;&amp;nbsp;&amp;nbsp;
  Error&lt;br /&gt;
    &amp;nbsp; F&amp;nbsp;&amp;nbsp;&amp;nbsp;
  Fatal&lt;br /&gt;
    &amp;nbsp; S&amp;nbsp;&amp;nbsp;&amp;nbsp;
  Silent (supress all output)&lt;br /&gt;
    &lt;br /&gt;
    &#39;*&#39; means &#39;*:d&#39; and &lt;tag&gt; by itself means &lt;tag&gt;:v&lt;br /&gt;
    &lt;br /&gt;
    If not specified on the commandline, filterspec is set from
  ANDROID_LOG_TAGS.&lt;br /&gt;
    If no filterspec is found, filter defaults to &#39;*:I&#39;&lt;br /&gt;
    &lt;br /&gt;
    If not specified with -v, format is set from ANDROID_PRINTF_LOG&lt;br /&gt;
    or defaults to &quot;brief&quot;&lt;/tag&gt;&lt;/tag&gt;&lt;/tag&gt;&lt;/tag&gt;&lt;/buffer&gt;&lt;/count&gt;&lt;/count&gt;&lt;/format&gt;&lt;/format&gt;&lt;/count&gt;&lt;/count&gt;&lt;/kbytes&gt;&lt;/filename&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;210&quot; style=&quot;height: 157.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;210&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 157.5pt; text-underline-style: none;&quot;&gt;ls -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;List the file and directory at current or specified
  path.&lt;br /&gt;
Usage: ls &lt;options&gt; &lt;/options&gt;
    -l: LIST_LONG; break;&lt;br /&gt;
-n:LIST_LONG | LIST_LONG_NUMERIC; break;&lt;br /&gt;
-s: LIST_SIZE; break;&lt;br /&gt;
-R:LIST_RECURSIVE; break;&lt;br /&gt;
-d: LIST_DIRECTORIES; break;&lt;br /&gt;
-Z: LIST_MACLABEL; break;&lt;br /&gt;
-a: LIST_ALL; break;&lt;br /&gt;
-F: LIST_CLASSIFY; break; &lt;/td&gt;&lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;lsmod
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;List
  the module in Android device.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;lsof -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;List information in /Proc folder which contains all
  the process information.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;md5
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;MD5
  encription tool&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;mkdir -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Create a folder.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;monkey&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;A automation
  stress test tool which generates random event for Android device.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;mount -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Mount a file structure.&lt;br /&gt;
Usage: mount [-r] [-w] [-o options] [-t type] device directory&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;mv
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Remove
  a file.&lt;br /&gt;
USAGE: mv &lt;source ...=&quot;...&quot;&gt;&lt;/source&gt; &lt;destination&gt;&lt;/destination&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;189&quot; style=&quot;height: 141.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;189&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 141.75pt; text-underline-style: none;&quot;&gt;nandread -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;nandread [-d &lt;dev&gt;] [-f file] [-s sparesize]
  [-vh]&lt;br /&gt;
    &amp;nbsp; -d &lt;dev&gt;&amp;nbsp;&amp;nbsp; Read from &lt;dev&gt;&lt;br /&gt;
    &amp;nbsp; -f &lt;file&gt;&amp;nbsp; Write to &lt;file&gt;&lt;br /&gt;
    &amp;nbsp; -s &lt;size&gt;&amp;nbsp; Number of spare bytes in file (default
  64)&lt;br /&gt;
    &amp;nbsp; -R&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Raw mode&lt;br /&gt;
    &amp;nbsp; -S &lt;start&gt; Start offset
  (default 0)&lt;br /&gt;
    &amp;nbsp; -L &lt;len&gt;&amp;nbsp;&amp;nbsp; Length (default 0)&lt;br /&gt;
    &amp;nbsp; -v&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Print info&lt;br /&gt;
    &amp;nbsp; -h&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Print help&lt;/len&gt;&lt;/start&gt;&lt;/size&gt;&lt;/file&gt;&lt;/file&gt;&lt;/dev&gt;&lt;/dev&gt;&lt;/dev&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;netcfg&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Configure
  network interface&lt;br /&gt;
usage: netcfg [&lt;interface&gt; {dhcp|up|down}]&lt;/interface&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;netstat -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Print net state&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;546&quot; style=&quot;height: 409.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;546&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 409.5pt; text-underline-style: none;&quot;&gt;newfs_msdos
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;New a
  file System with specified format&lt;br /&gt;
usage: newfs_msdos [ -options ] special [disktype]&lt;br /&gt;
where the options are:&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -@ create file system at
  specified offset&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -B get bootstrap from
  file&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -C create image file with
  specified size&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -F FAT type (12, 16, or 32)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -I volume ID&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -L volume label&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -N don&#39;t create file system:
  just print out parameters&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -O OEM string&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -S bytes/sector&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -a sectors/FAT&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -b block size&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -c sectors/cluster&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -e root directory
  entries&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -f standard format&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -h drive heads&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -i file system info
  sector&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -k backup boot sector&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -m media descriptor&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -n number of FATs&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -o hidden sectors&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -r reserved sectors&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -s file system size
  (sectors)&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -u sectors/track&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;ping&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Check if the specified host address is online.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;pm&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Package
  Manager for running Dalvik Class file.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;printenv -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Print Environment Variables and their Values for Android
  Device&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;168&quot; style=&quot;height: 126.0pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;168&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 126pt; text-underline-style: none;&quot;&gt;ps
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Print
  the running process with its state.&lt;br /&gt;
Usage: ps [options]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -t&amp;nbsp;&amp;nbsp; Show threads&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -x&amp;nbsp;&amp;nbsp; Show time&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -Z&amp;nbsp;&amp;nbsp; Show MAC Label&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -P&amp;nbsp;&amp;nbsp; Show Policy&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -p&amp;nbsp;&amp;nbsp; Show Priority&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -c&amp;nbsp;&amp;nbsp; Show CPU&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;reboot -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Reboot Android Device&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;renice
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Change
  the priority of a process.&lt;br /&gt;
USAGE: renice [[-r] priority pids ...] [-g pid]&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;rm -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Remove a file or folder.&lt;br /&gt;
Usage: rm file_name or rm -r folder_name&amp;nbsp;&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;rmdir
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Remove
  the folder.&lt;br /&gt;
Usage: rmdir &lt;directory&gt;&lt;/directory&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;rmmod -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Remove a module&lt;br /&gt;
usage: rmmod &lt;module&gt;&lt;/module&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;route
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Add or
  Remove route&lt;br /&gt;
Ex: route add -net 192.168.1.2 netmask 255.255.255.0 gw 192.168.1.1&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;126&quot; style=&quot;height: 94.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;126&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 94.5pt; text-underline-style: none;&quot;&gt;screencap&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Output Android screen&lt;br /&gt;
usage: screencap [-hp] [FILENAME]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -h: this message&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -p: save the file as a png.&lt;br /&gt;
If FILENAME ends with .png it will be saved as a png.&lt;br /&gt;
If FILENAME is not given, the results will be printed to stdout.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;84&quot; style=&quot;height: 63.0pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;84&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 63pt; text-underline-style: none;&quot;&gt;screenshot&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Output
  Android screen&lt;br /&gt;
usage: screenshot [-s soundfile] filename.png&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -s: play a sound effect to signal
  success&lt;br /&gt;
&amp;nbsp;&amp;nbsp; -i: autoincrement to avoid
  overwriting filename.png&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;63&quot; style=&quot;height: 47.25pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;63&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 47.25pt; text-underline-style: none;&quot;&gt;sendevent -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Send a event trigger to specified device with type,
  code, and value. E.g. Touch, or Key.&lt;br /&gt;
Usage: sendevent [device] [type] [code] [value].&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;168&quot; style=&quot;height: 126.0pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;168&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 126pt; text-underline-style: none;&quot;&gt;service&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Service
  operation&lt;br /&gt;
Usage: service [-h|-?]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; service list&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; service check SERVICE&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; service call SERVICE CODE [i32
  INT | s16 STR] ...&lt;br /&gt;
Options:&lt;br /&gt;
&amp;nbsp;&amp;nbsp; i32: Write the integer INT into
  the send parcel.&lt;br /&gt;
&amp;nbsp;&amp;nbsp; s16: Write the UTF-16 string STR
  into the send parcel.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;210&quot; style=&quot;height: 157.5pt;&quot;&gt;
  &lt;td class=&quot;xl66&quot; height=&quot;210&quot; style=&quot;color: red; font-family: Calibri; font-size: 12pt; height: 157.5pt; text-underline-style: none;&quot;&gt;setconsole -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;setconsole [-d &lt;dev&gt;] [-v &lt;vc&gt;]
  [-gtncpoh]&lt;br /&gt;
    &amp;nbsp; -d &lt;dev&gt;&amp;nbsp;&amp;nbsp; Use &lt;dev&gt; instead of /dev/tty0&lt;br /&gt;
    &amp;nbsp; -v &lt;vc&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Switch to virtual console
  &lt;vc&gt;&lt;br /&gt;
    &amp;nbsp; -g&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Switch to graphics mode&lt;br /&gt;
    &amp;nbsp; -t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Switch to text mode&lt;br /&gt;
    &amp;nbsp; -n&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Create and switch to new virtual
  console&lt;br /&gt;
    &amp;nbsp; -c&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Close unused virtual consoles&lt;br /&gt;
    &amp;nbsp; -p&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Print new virtual console&lt;br /&gt;
    &amp;nbsp; -o&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Print old virtual console&lt;br /&gt;
    &amp;nbsp; -h&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Print help&lt;/vc&gt;&lt;/vc&gt;&lt;/dev&gt;&lt;/dev&gt;&lt;/vc&gt;&lt;/dev&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;setprop
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Set the
  Android property.&lt;br /&gt;
Usage: setprop &lt;key&gt; &lt;value&gt;&lt;/value&gt;&lt;/key&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;sh -&amp;gt; mksh&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Execute a shell script.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;sleep
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Interval of
  next action/command (seconds)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;start -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Start a specified service&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;stop
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Stop a
  specified service&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;189&quot; style=&quot;height: 141.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;189&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 141.75pt; text-underline-style: none;&quot;&gt;sync -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Copy host-&amp;gt;device only if changed. adb sync is a
  tool which may be used to copy files from the computer to the device if the
  files has been changed. By default the command will synchronize /data and
  /system unless one option is specified. For the command to operate properly a
  system variable must be created and defined. ANDROID_PRODUCT_OUT must
  designate the full actual path to the directory containing a file structure
  with system and/or data subfolders containing the files and folders changed.&lt;br /&gt;
Usage: sync [ &lt;directory&gt; ]&lt;/directory&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Check
  if the specified command existed.&lt;br /&gt;
Usage: toolbox command_name&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;189&quot; style=&quot;height: 141.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;189&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 141.75pt; text-underline-style: none;&quot;&gt;top -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Display usage of thread or process.&lt;br /&gt;
Usage: top [ -m max_procs ] [ -n iterations ] [ -d delay ] [ -s sort_column
  ] [ -t ] [ -h ]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -m num&amp;nbsp; Maximum number of processes to
  display.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -n num&amp;nbsp; Updates to show before exiting.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -d num&amp;nbsp; Seconds to wait between updates.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -s col&amp;nbsp; Column to sort by (cpu,vss,rss,thr).&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -t&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Show threads instead of
  processes.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -h&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Display this help screen.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;umount
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Unmount
  the device&lt;br /&gt;
Usage: umount device_path&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;uptime -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;The up time since last boot. The information
  includes up, idle, and sleep time.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;147&quot; style=&quot;height: 110.25pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;147&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 110.25pt; text-underline-style: none;&quot;&gt;vmstat
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Virtual
  Meomory Statistics&lt;br /&gt;
Usage: vmstat [ -h ] [ -n iterations ] [ -d delay ] [ -r header_repeat
  ]&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -n iterations&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; How many rows of data to print.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -d delay&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; How long to sleep between
  rows.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -r header_repeat&amp;nbsp; How many rows to print before
  repeating&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; the
  header.&amp;nbsp; Zero means never repeat.&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; -h&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Displays this help screen.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;21&quot; style=&quot;height: 15.75pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;21&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 15.75pt; text-underline-style: none;&quot;&gt;vold&lt;/td&gt;
  &lt;td class=&quot;xl64&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none;&quot;&gt;Manage the device on Android. The function is similar
  with udev in Linux.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;42&quot; style=&quot;height: 31.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;42&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; height: 31.5pt; text-underline-style: none;&quot;&gt;watchprops
  -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Monitor
  the change of property and list them. The properties can be viewed by
  executing getprop and set by executing setprop.&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;84&quot; style=&quot;height: 63.0pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;84&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; height: 63pt; text-underline-style: none;&quot;&gt;wipe -&amp;gt; toolbox&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Erase the system or data&lt;br /&gt;
Usage: wipe &lt;system all=&quot;all&quot; data=&quot;data&quot;&gt;&lt;br /&gt;
    &amp;nbsp;&amp;nbsp; system means &#39;/system&#39;&lt;br /&gt;
    &amp;nbsp;&amp;nbsp; data means &#39;/data&#39;&lt;/system&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;546&quot; style=&quot;height: 409.5pt;&quot;&gt;
  &lt;td class=&quot;xl64&quot; height=&quot;546&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(79, 129, 189); border-bottom-width: 0.5pt; border-style: none none solid; color: #366092; font-family: Calibri; font-size: 12pt; height: 409.5pt; text-underline-style: none;&quot;&gt;wpa_supplicant&lt;/td&gt;
  &lt;td class=&quot;xl65&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(79, 129, 189); border-bottom-width: 0.5pt; border-style: none none solid; color: #366092; font-family: Calibri; font-size: 12pt; text-underline-style: none; width: 345pt;&quot; width=&quot;460&quot;&gt;Configure
  WLAN&lt;br /&gt;
usage:&lt;br /&gt;
&amp;nbsp; wpa_supplicant [-BddhKLqqstuvW]
  [-P&lt;pid file=&quot;file&quot;&gt;] [-g&lt;global ctrl=&quot;ctrl&quot;&gt;] \&lt;br /&gt;
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; -i&lt;ifname&gt; -c&lt;config file=&quot;file&quot;&gt; [-C&lt;ctrl&gt;] [-D&lt;driver&gt;] [-p&lt;driver_param&gt;] \&lt;br /&gt;
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [-b&lt;br_ifname&gt;]
  [-f&lt;debug file=&quot;file&quot;&gt;] [-e&lt;entropy file=&quot;file&quot;&gt;] \&lt;br /&gt;
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [-o&lt;override driver=&quot;driver&quot;&gt;]
  [-O&lt;override ctrl=&quot;ctrl&quot;&gt;] \&lt;br /&gt;
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [-N -i&lt;ifname&gt;
  -c&lt;conf&gt; [-C&lt;ctrl&gt;] [-D&lt;driver&gt;] \&lt;br /&gt;
    &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; [-p&lt;driver_param&gt;]
  [-b&lt;br_ifname&gt;] ...]&lt;br /&gt;
    &lt;br /&gt;
    drivers:&lt;br /&gt;
    &amp;nbsp; nl80211 = Linux
  nl80211/cfg80211&lt;br /&gt;
    options:&lt;br /&gt;
    &amp;nbsp; -b = optional bridge interface
  name&lt;br /&gt;
    &amp;nbsp; -B = run daemon in the
  background&lt;br /&gt;
    &amp;nbsp; -c = Configuration file&lt;br /&gt;
    &amp;nbsp; -C = ctrl_interface parameter (only
  used if -c is not)&lt;br /&gt;
    &amp;nbsp; -i = interface name&lt;br /&gt;
    &amp;nbsp; -d = increase debugging verbosity
  (-dd even more)&lt;br /&gt;
    &amp;nbsp; -D = driver name (can be multiple
  drivers: nl80211,wext)&lt;br /&gt;
    &amp;nbsp; -e = entropy file&lt;br /&gt;
    &amp;nbsp; -g = global ctrl_interface&lt;br /&gt;
    &amp;nbsp; -K = include keys (passwords, etc.)
  in debug output&lt;br /&gt;
    &amp;nbsp; -t = include timestamp in debug
  messages&lt;br /&gt;
    &amp;nbsp; -h = show this help text&lt;br /&gt;
    &amp;nbsp; -L = show license (GPL and
  BSD)&lt;br /&gt;
    &amp;nbsp; -o = override driver parameter for
  new interfaces&lt;br /&gt;
    &amp;nbsp; -O = override ctrl_interface
  parameter for new interfaces&lt;br /&gt;
    &amp;nbsp; -p = driver parameters&lt;br /&gt;
    &amp;nbsp; -P = PID file&lt;br /&gt;
    &amp;nbsp; -q = decrease debugging verbosity
  (-qq even less)&lt;br /&gt;
    &amp;nbsp; -v = show version&lt;br /&gt;
    &amp;nbsp; -W = wait for a control interface
  monitor before starting&lt;br /&gt;
    &amp;nbsp; -N = start describing new
  interface&lt;br /&gt;
    example:&lt;br /&gt;
    &amp;nbsp; wpa_supplicant -Dwext -iwlan0
  -c/etc/wpa_supplicant.conf&lt;/br_ifname&gt;&lt;/driver_param&gt;&lt;/driver&gt;&lt;/ctrl&gt;&lt;/conf&gt;&lt;/ifname&gt;&lt;/override&gt;&lt;/override&gt;&lt;/entropy&gt;&lt;/debug&gt;&lt;/br_ifname&gt;&lt;/driver_param&gt;&lt;/driver&gt;&lt;/ctrl&gt;&lt;/config&gt;&lt;/ifname&gt;&lt;/global&gt;&lt;/pid&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/2578935657279688541/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-linux-command-list.html#comment-form' title='25 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/2578935657279688541'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/2578935657279688541'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-linux-command-list.html' title='Android / Linux Shell Command List'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>25</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-4294561467592040987</id><published>2012-10-17T22:31:00.001-07:00</published><updated>2013-04-23T00:39:14.627-07:00</updated><title type='text'>網站地圖</title><content type='html'>&lt;br /&gt;
基於開放原始碼精神，Carl決定來這分享由開放原始碼所成就的Android技術。&lt;br /&gt;
&lt;br /&gt;
知道再多的技術不如要知道如何善加利用他。才能物盡其利，事半功倍。大部分的企業開發產品都想要Pull in Schedule and Cost Down。&lt;br /&gt;
&lt;br /&gt;
一個非常複雜尖端科技與技術所完成的產品，並不一定受到市場的歡迎。而要看見與創造市場願意接受的需求，才能創造新的社群。&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;Android測試工程&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-monkeyrunner.html&quot;&gt;Android 自動化操作與測試 - monkeyrunner&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-monkeyrunner-jythan.html&quot;&gt;Android MonkeyRunner 和 Jythan - 從一個簡單的範例開始&lt;/a&gt;&lt;br /&gt;
&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-monkey-automation-test.html&quot;&gt;Android Automation Test for Stability by Monkey 中文版&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Android&lt;/b&gt;&lt;b&gt;控制工程&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://android-test-tw.blogspot.tw/2012/10/android-activity-manager_15.html&quot; target=&quot;_blank&quot;&gt;Android Activity Manager - shell command am&lt;/a&gt;中文版&lt;br /&gt;
&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-linux.html&quot;&gt;Android 與 Linux 的執行命令&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Android&lt;/b&gt;&lt;b&gt;訊息&lt;/b&gt;&lt;b&gt;紀錄&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-log-bugreport.html&quot;&gt;Android Log 訊息 - Bugreport&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;另類相關&lt;/b&gt;&lt;br /&gt;
&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/upgrade-your-nexus-7-to-412-manually.html&quot; target=&quot;_blank&quot;&gt;Upgrade your Nexus 7 to 4.1.2 Manually&lt;/a&gt;&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/4294561467592040987/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/blog-post.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/4294561467592040987'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/4294561467592040987'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/blog-post.html' title='網站地圖'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-6997846563375043513</id><published>2012-10-17T20:54:00.001-07:00</published><updated>2013-04-23T00:39:34.069-07:00</updated><title type='text'>Android MonkeyRunner 和 Jythan - 從一個簡單的範例開始</title><content type='html'>&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-monkeyrunner-with-jythan.html&quot;&gt;English Version&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;序&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
MonkeyRunner是由Google Android開發團隊所提出的控制Android的工具，放置於Android SDK。&lt;br /&gt;
MonkeyRunner 是由一組控制命令並使用Jython的語法來做控制程序的撰寫。Jython是由Java虛擬機器來執行，有別於Python是用C/C++來做執行。利用Jython來作邏輯控制將會更有彈性的控制Android裝置。&lt;br /&gt;
&lt;br /&gt;
在閱讀本篇文章前，你需要對MonkeyRunner的設定環境先行了解。若尚不知怎麼作，可以先閱讀此篇文章&amp;nbsp;&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-automation-test-by-monkeyrunner.html&quot;&gt;http://android-test-tw.blogspot.com/2012/10/android-automation-test-by-monkeyrunner.html&lt;/a&gt;。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jython&lt;/b&gt;&lt;b&gt;簡介&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
在開始介紹如何用Jython來撰寫MonkeyRunner的Script前，我們先來介紹基本的Jython語法。&lt;br /&gt;
&lt;br /&gt;
Jython可使用的變數類別有數字、字串和串列。使用變數不需要宣告，主要是依據指定的值的型態來確認變數的類別。&lt;br /&gt;
&lt;br /&gt;
接下來先來看幾個簡單的範例方便快速了解Jython的使用。你可以複製以下範例到一個文字檔。例如example.py。打開一個cmd的視窗並執行命令 - monkeyrunner.bat example.py 再按下確定(Enter)按鈕。&lt;br /&gt;
&lt;u&gt;&lt;br /&gt;&lt;/u&gt;
&lt;u&gt;&lt;i&gt;設定數字給變數&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
num = 1&lt;br /&gt;
&lt;i&gt;&lt;u&gt;設定字串給變數&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
str = &quot;Hello&quot;&lt;br /&gt;
str = &#39;Hello2&#39;&lt;br /&gt;
&lt;i&gt;&lt;u&gt;設定一個串列給變數&lt;/u&gt;&lt;/i&gt;&lt;br /&gt;
list = [&#39;mail&#39;,&#39;inbox&#39;,100,200]&lt;br /&gt;
&lt;br /&gt;
以下來簡單探討邏輯判斷與迴圈控制&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;使用if的方式如下所示&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;if_stmt ::= &amp;nbsp;&quot;if&quot; expression &quot;:&quot; suite&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;( &quot;elif&quot; expression &quot;:&quot; suite )*&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[&quot;else&quot; &quot;:&quot; suite]&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;範例:&lt;/i&gt;&lt;br /&gt;
if num &amp;lt; 0:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;num = 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;Negative changed to zero&#39;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;elif num == 0:&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;Zero&#39;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;elif num == 1:&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;Single&#39;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;else:&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;More&#39;)&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
&lt;i&gt;使用while的方式如下所示&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;while_stmt ::= &amp;nbsp;&quot;while&quot; expression &quot;:&quot; suite&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [&quot;else&quot; &quot;:&quot; suite]&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;範例:&lt;/i&gt;&lt;br /&gt;
num = 100&lt;br /&gt;
go = True&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;while go:&lt;/i&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; getNum = int(raw_input(&#39;Input a number : &#39;))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if&amp;nbsp;getNum&amp;nbsp;== num:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &#39;That is right.&#39;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; go = False&lt;br /&gt;
&amp;nbsp; &amp;nbsp; else:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &#39;Oh No~&#39;&lt;br /&gt;
&lt;i&gt;else:&lt;/i&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; print &#39;Game over.&#39;&lt;br /&gt;
print &#39;Done&#39;&lt;br /&gt;
&lt;div style=&quot;font-style: italic;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-style: italic;&quot;&gt;
&lt;/div&gt;
&lt;i&gt;使用for的方式如下所示&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;for_stmt ::= &amp;nbsp;&quot;for&quot; target_list &quot;in&quot; expression_list &quot;:&quot; suite&lt;/i&gt;&lt;br /&gt;
&lt;div&gt;
&lt;i&gt;
&lt;/i&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [&quot;else&quot; &quot;:&quot; suite]&lt;/i&gt;&lt;/div&gt;
&lt;i&gt;
&lt;/i&gt;&lt;/div&gt;
範例:&lt;br /&gt;
for i in range(9):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print(i)&lt;br /&gt;
else:&lt;br /&gt;
&amp;nbsp;print &#39;done&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;一個簡單的加入Jython控制的MonkeyRunner範例介紹:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
這個範例中，我們想要驗證執行中的畫面與我們事先設定好的畫面是否一致，以做為測試判斷的結果。在這個範例中，我們會利用Jython增加邏輯敘述到MonkeyRunner。Jython的語法基本上和Python大致相同。因此可以參考Python的語法來做為新添加的元素。&lt;br /&gt;
&lt;br /&gt;
在以下的範例我們會判斷藍牙的開啟狀況，利用使用者介面來做測試結果的判斷。反覆的開關藍芽的電源。當中會需要一個API是官網未提出的。但經實驗證實可以使用。該API為&lt;span style=&quot;color: blue;&quot;&gt;MonkeyRunner.loadImageFromFile(Full_File_Path)。&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
首先必須先取得預設希望得到的預期測試結果的圖像，可利用以下的Script來取得。以下為片段程式碼。使用前還是需要先預載MonkeyRunner相關的類別與設定變數。&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;result = device1.takeSnapshot()&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;result.getSubImage ((133,85,85,28))&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;result.writeToFile(&#39;./capture1.png&#39;,&#39;PNG&#39;)&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
執行前請先把Android裝置的畫面選到設定，並開啟藍芽電源。這個範例使用Android JB模擬器，螢幕解析度為240X432的大小。執行上述Script後會得到以下的圖檔。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLndKD6ScyLCSVj4abf4VJC3EPHBg_Xy37myj-sR-voJjCXVcNOYOMo2chEcsO3HduaZG8SsM_Bxv3LtumH6w1IGoF-VghZdNkzJpCQca8E2DNX_w4AqcjPTEOcksYqtS3VESFvWjKz7E/s1600/capture1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLndKD6ScyLCSVj4abf4VJC3EPHBg_Xy37myj-sR-voJjCXVcNOYOMo2chEcsO3HduaZG8SsM_Bxv3LtumH6w1IGoF-VghZdNkzJpCQca8E2DNX_w4AqcjPTEOcksYqtS3VESFvWjKz7E/s1600/capture1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
capture1.png&lt;/div&gt;
&lt;i&gt;完整範例：&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Import class of MonkeyRunner, MonkeyDevice, and MonkeyImage.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;device1 = MonkeyRunner.waitForConnection(10000,&quot;emulator-5554&quot;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;print &#39;connected&#39;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Connect Android device from computer and assign handler to variable -device1.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;monkeyimage1 = MonkeyRunner.loadImageFromFile(&#39;./capture1.png&#39;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;print &#39;capture1.png loaded&#39;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Load a existing image file by load image API and assign handler to variable - monkeyimage1;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;device1.press(&#39;KEYCODE_HOME&#39;,&#39;DOWN_AND_UP&#39;,&#39; &#39;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;print &#39;home key are triggered&#39;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Send home key event to bring up Launcher&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;MonkeyRunner.sleep(3);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Wait for reaction of Android device&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;device1.press(&#39;KEYCODE_MENU&#39;,&#39;DOWN_AND_UP&#39;,&#39; &#39;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Send menu key event&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;MonkeyRunner.sleep(3);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Wait for reaction of Android device&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;device1.touch ( 95, 417, &quot;DOWN_AND_UP&quot;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Touch system settings in menu list&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;MonkeyRunner.sleep(3);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Wait for reaction of Android device&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;for i in range(1000):&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;device1.touch ( 197, 96, &quot;DOWN_AND_UP&quot;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;#Touch bluetooth On&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;MonkeyRunner.sleep(2);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;monkeyimage2 = device1.takeSnapshot()&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;#Take a screenshot on Android device and assign handler to variable monkeyimage2&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;monkeyimage2 = monkeyimage2.getSubImage ((133,85,85,28))&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;#Get specified rectangle from screenshot got by last step for the result we want to check and assign&amp;nbsp;&lt;/i&gt;&lt;i&gt;handler to variable monkeyimage2 again.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;if monkeyimage2.sameAs ( monkeyimage1, 1 ):&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; print str(i+1)+&#39;:pass&#39;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;else:&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; print str(i+1)+&#39;:fail&#39;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;#Compare the result if both images of pre-loaded and run-time screenshot are the same.&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;device1.touch ( 155, 95, &quot;DOWN_AND_UP&quot;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;#Touch bluetooth Off&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;else:&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;print &#39;done&#39;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
測試結果若都通過，命令列視窗會顯示第幾次測試，結果為何。&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;參考資料:&lt;/b&gt;&lt;/div&gt;
Python Script Language Tutorial,&amp;nbsp;&lt;a href=&quot;http://docs.python.org/tutorial/&quot;&gt;http://docs.python.org/tutorial/&lt;/a&gt;&lt;br /&gt;
Jython Script Lanuage Tutorial,&amp;nbsp;&lt;a href=&quot;http://www.jython.org/docs/index.html&quot;&gt;http://www.jython.org/docs/index.html&lt;/a&gt;&lt;br /&gt;
MonkeyRunner, &lt;a href=&quot;http://developer.android.com/tools/help/monkeyrunner_concepts.html&quot;&gt;http://developer.android.com/tools/help/monkeyrunner_concepts.html&lt;/a&gt;&lt;br /&gt;
Android KeyCode,&amp;nbsp;&lt;a href=&quot;http://developer.android.com/reference/android/view/KeyEvent.html&quot;&gt;http://developer.android.com/reference/android/view/KeyEvent.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/6997846563375043513/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-monkeyrunner-jythan.html#comment-form' title='14 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/6997846563375043513'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/6997846563375043513'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-monkeyrunner-jythan.html' title='Android MonkeyRunner 和 Jythan - 從一個簡單的範例開始'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLndKD6ScyLCSVj4abf4VJC3EPHBg_Xy37myj-sR-voJjCXVcNOYOMo2chEcsO3HduaZG8SsM_Bxv3LtumH6w1IGoF-VghZdNkzJpCQca8E2DNX_w4AqcjPTEOcksYqtS3VESFvWjKz7E/s72-c/capture1.png" height="72" width="72"/><thr:total>14</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-8807167008091350055</id><published>2012-10-17T19:58:00.001-07:00</published><updated>2013-04-23T00:40:03.113-07:00</updated><title type='text'>Android 與 Linux 的執行命令 </title><content type='html'>&lt;br /&gt;
&lt;b&gt;序:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Android的系統架構在Linux上，是一個Java基礎的作業系統。如同以下的圖示，Google提出的架構可了解。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo6kDFLlP0I2amjoUKEHgZC2UtHDAhE7FtkMjH0KCVyfAloQMmc-P9JbR3nUY_SsS6IJ54DED7b79UJAVpoXfnhnvpdzeDWgAJWIE_G3DXbSgb2yuUlnEII68gaM7AA4foXWSI3tCtyxo/s1600/image00.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;278&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo6kDFLlP0I2amjoUKEHgZC2UtHDAhE7FtkMjH0KCVyfAloQMmc-P9JbR3nUY_SsS6IJ54DED7b79UJAVpoXfnhnvpdzeDWgAJWIE_G3DXbSgb2yuUlnEII68gaM7AA4foXWSI3tCtyxo/s400/image00.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://source.android.com/tech/security/#android-platform-security-architecture&quot; target=&quot;_blank&quot;&gt;http://source.android.com/tech/security/#android-platform-security-architecture&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Android的工作區域是在上方圖的淡藍色(Applications&amp;amp;Application Framework)與深綠色(Android Runtime)&amp;nbsp;的部分。Java所設計的程式必須利用深綠色的Android Runtime裡的Dalvik虛擬機器來執行，若需要與Linux這層做溝通，由Android Runtime這部份來做國境遷移(Native Code)的技術來做訊息交遞。Linux的工作區域是位於上方架構圖的淡綠色&amp;nbsp;(Libraries) 與粉紅色 (Linux Kernel)。&lt;br /&gt;
&lt;br /&gt;
這樣的架構可以用在Android系統做參考，但實際的產品會因產品功能不同而有不同的架構物件的增減或是修改。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;介紹&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Android提供一個工具，稱作ADB. ADB的全名是Android Debug Bridge，就是Android除錯橋樑。在Android的裝置內有ADB的伺服端，以供放置於電腦上的ADB用戶端連線。&lt;br /&gt;
&lt;br /&gt;
Android與Linux中有很多好用的執行命令工具可以用來控制Android系統與取得Android系統訊息。使用這些控制命令有個簡單的方法就是透過ADB來執行。&lt;br /&gt;
&lt;br /&gt;
探索Android JB版本的模擬器裡的資料夾，於/system/bin的資料夾就可找到不少可用的執行命令。可使用adb shell &quot;ls /system/bin&quot;去觀察有多少命令在這個資料夾。&lt;br /&gt;
&lt;br /&gt;
Android系統架構於Linux上，Android本身提供一些一些控制命令。在Linux端，其命令有許多是來自於原來的Linux Kernel。但或多或少為了配合嵌入式的裝置，還是有微幅修改。大多的原生Linux命令用法是相當類似的。因此可以先查詢Android系統中的Linux提供多少命令，對照Linux系統的使用方法，就可以獲得許多的資訊。&lt;br /&gt;
&lt;br /&gt;
範例&lt;br /&gt;
&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-activity-manager.html&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;am&lt;/i&gt;&lt;/a&gt; - Activity Manager, Java&amp;nbsp;語言設計的執行命令，可控制Android的四大元件，原始碼可參考&amp;nbsp;&lt;i&gt;platform_frameworks_base/blob/master/cmds/am/src/com/android/commands/am/Am.java&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://android-test-tw.blogspot.tw/2012/10/preface-theres-monkey-existed-in.html&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;monkey&lt;/i&gt;&lt;/a&gt; - 穩定性的工具，工具執行會不斷發出隨機事件，Java&amp;nbsp;語言設計的執行命令，原始碼可參考&amp;nbsp;&lt;i&gt;platform_development/blob/master/cmds/monkey/src/com/android/commands/monkey/Monkey.java&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;pm&lt;/i&gt; - Package Manager 可以對Package做相關的操作，Java&amp;nbsp;設計的執行命令，原始碼可參考&amp;nbsp;&lt;i&gt;platform_frameworks_base/blob/master/cmds/pm/src/com/android/commands/pm/Pm.java&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;dmesg&lt;/i&gt; - Linux Debug Message, 輸出Linux相關的訊息，C語言設計的執行命令,，與原生的Linux系統有相同的用法。原始碼可參考&amp;nbsp;&lt;i&gt;platform_system_core/blob/master/toolbox/dmesg.c&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;ps&lt;/i&gt; - Process State, 輸出程序的id與記憶體使用情形等，C語言設計的執行命令，與原生的Linux系統有相同的用法。原始碼可參考&amp;nbsp;&lt;i&gt;android/platform_system_core/blob/master/toolbox/ps.c&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
以上的範例我們可以看到Android系統的控制命令主要有分為Java語言與C語言生成的控制程式。但基於Linux的強大功能，還能執行例如Python與Perl等語言。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reference&lt;/b&gt;&lt;br /&gt;
Android Architecture,&amp;nbsp;&lt;a href=&quot;http://source.android.com/tech/security/&quot;&gt;http://source.android.com/tech/security/&lt;/a&gt;&lt;br /&gt;
Android Source Code Mirror Site,&amp;nbsp;&lt;a href=&quot;https://github.com/android/&quot;&gt;https://github.com/android/&lt;/a&gt;&lt;br /&gt;
Package Manager,&amp;nbsp;&lt;a href=&quot;http://developer.android.com/reference/android/content/pm/PackageManager.html&quot;&gt;http://developer.android.com/reference/android/content/pm/PackageManager.html&lt;/a&gt;

</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/8807167008091350055/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-linux.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/8807167008091350055'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/8807167008091350055'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-linux.html' title='Android 與 Linux 的執行命令 '/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo6kDFLlP0I2amjoUKEHgZC2UtHDAhE7FtkMjH0KCVyfAloQMmc-P9JbR3nUY_SsS6IJ54DED7b79UJAVpoXfnhnvpdzeDWgAJWIE_G3DXbSgb2yuUlnEII68gaM7AA4foXWSI3tCtyxo/s72-c/image00.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-7508563094476685308</id><published>2012-10-17T18:59:00.002-07:00</published><updated>2013-04-23T00:40:52.429-07:00</updated><title type='text'>Android Log 訊息 - Bugreport</title><content type='html'>&lt;br /&gt;
&lt;b&gt;序&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
當一個人生病去看醫生，會說出症狀，醫生或做一些檢測來確認引起不良反應的原因。對於一個Android的裝置也一樣。在開發過程中，工程開發人員常會發現一些問題。這時候需要檢測裝置的發生原因。因此可以透過Android的內部紀錄訊息來檢測發生甚麼問題導致不良因素。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;從何處下手?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Android 內有提供一個指令，稱為bugreport。可以透過指令adb bugreport &amp;nbsp;adb shell bugreport來取得Bugreport中的資訊。使用這個指令取得Android 4.1的模擬器內的bugreport可得到以下的六十八種紀錄訊息。這些訊息可以用來診斷Android目前的健康情況。&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 600px;&quot;&gt;
 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 21536; mso-width-source: userset; width: 505pt;&quot; width=&quot;673&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none; width: 505pt;&quot; width=&quot;673&quot;&gt;&amp;nbsp;UPTIME (uptime)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;MEMORY INFO
  (/proc/meminfo)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;CPU INFO (top -n 1 -d 1 -m 30 -t)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;PROCRANK
  (procrank)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;VIRTUAL MEMORY STATS (/proc/vmstat)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;VMALLOC INFO
  (/proc/vmallocinfo)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SLAB INFO (/proc/slabinfo)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;ZONEINFO
  (/proc/zoneinfo)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;PAGETYPEINFO (/proc/pagetypeinfo)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BUDDYINFO
  (/proc/buddyinfo)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;KERNEL WAKELOCKS (/proc/wakelocks)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;KERNEL CPUFREQ
  (/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;PROCESSES (ps -P)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;PROCESSES AND
  THREADS (ps -t -p -P)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;LIBRANK (librank)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;KERNEL LOG
  (dmesg)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;LIST OF OPEN FILES (/system/xbin/su root
  lsof)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SMAPS OF ALL
  PROCESSES&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SHOW MAP 1 (/init) (/system/xbin/su root
  showmap 1)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BLOCKED PROCESS
  WAIT-CHANNELS&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SYSTEM LOG (logcat -v threadtime -d
  *:v)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;EVENT LOG
  (logcat -b events -v threadtime -d *:v)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;RADIO LOG (logcat -b radio -v threadtime -d
  *:v)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;VM TRACES JUST
  NOW (/data/anr/traces.txt.bugreport: 2012-10-17 08:21:46)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;VM TRACES AT LAST ANR (/data/anr/traces.txt:
  2012-10-17 08:16:11)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;NETWORK DEV
  INFO (/proc/net/dev)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;QTAGUID NETWORK INTERFACES INFO
  (/proc/net/xt_qtaguid/iface_stat_all)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;QTAGUID NETWORK
  INTERFACES INFO (xt) (/proc/net/xt_qtaguid/iface_stat_fmt)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;QTAGUID CTRL INFO
  (/proc/net/xt_qtaguid/ctrl)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;QTAGUID STATS
  INFO (/proc/net/xt_qtaguid/stats)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;NETWORK ROUTES (/proc/net/route)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;NETWORK ROUTES
  IPV6 (/proc/net/ipv6_route)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;LAST KMSG (/proc/last_kmsg)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;LAST PANIC
  CONSOLE (/data/dontpanic/apanic_console)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;LAST PANIC THREADS
  (/data/dontpanic/apanic_threads)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SYSTEM SETTINGS
  (/system/xbin/su root sqlite3 /data/…&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;NETWORK INTERFACES (/system/xbin/su root
  netcfg)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IP RULES (ip
  rule show)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IP RULES v6 (ip -6 rule show)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;ROUTE TABLE 60
  (ip route show table 60)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;ROUTE TABLE 61 v6 (ip -6 route show table
  60)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;ROUTE TABLE 61
  (ip route show table 61)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;ROUTE TABLE 61 v6 (ip -6 route show table
  61)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;ARP CACHE
  (/proc/net/arp)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IPTABLES (/system/xbin/su root iptables -L
  -nvx)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IP6TABLES
  (/system/xbin/su root ip6tables -L -nvx)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IPTABLE NAT (/system/xbin/su root iptables
  -t nat -L -nvx)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IPTABLE RAW
  (/system/xbin/su root iptables -t raw -L -nvx)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IP6TABLE RAW (/system/xbin/su root ip6tables
  -t raw -L -nvx)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;WIFI NETWORKS
  (/system/xbin/su root wpa_cli list_networks)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SYSTEM PROPERTIES&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;VOLD DUMP (vdc
  dump)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SECURE CONTAINERS (vdc asec list)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;FILESYSTEMS
  &amp;amp; FREE SPACE (/system/xbin/su root df)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;PACKAGE SETTINGS (/system/xbin/su root cat
  /data/system/packages.xml)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;PACKAGE UID
  ERRORS (/data/system/uiderrors.txt: 2012-10-15 02:30:29)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;LAST RADIO LOG (parse_radio_log
  /proc/last_radio_log)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BACKLIGHTS&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BINDER FAILED TRANSACTION LOG
  (/sys/kernel/debug/binder/failed_transaction_log)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BINDER
  TRANSACTION LOG (/sys/kernel/debug/binder/transaction_log)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BINDER TRANSACTIONS
  (/sys/kernel/debug/binder/transactions)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BINDER STATS
  (/sys/kernel/debug/binder/stats)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BINDER STATE
  (/sys/kernel/debug/binder/state)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;DUMP VENDOR RIL
  LOGS (/system/xbin/su root vril-dump)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;DUMPSYS (dumpsys)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;APP ACTIVITIES
  (dumpsys activity all)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;APP SERVICES (dumpsys activity service
  all)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;border-bottom-color: rgb(79, 129, 189); border-bottom-width: 0.5pt; border-style: none none solid; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;APP SERVICES
  (dumpsys activity provider all)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
在這些訊息中包含Android與Linux層的各種訊息，並能取得各種不同類別的訊息。例如，活動與事件、記憶體使用情形、系統狀態、射頻狀態，與網路狀態等。&lt;br /&gt;
&lt;br /&gt;
值得探討的是，若產品是一個Android的手機或附有通訊功能的平板電腦。有些訊息包含電信通訊技術相關的底層訊息。這些訊息是通訊晶片與電信基定台的交換訊息。而在Bugreport的功能中可能無法傳遞這些訊息。需要特定的軟體或裝置去取得這些電信交換的訊息。&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/7508563094476685308/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-log-bugreport.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7508563094476685308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7508563094476685308'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-log-bugreport.html' title='Android Log 訊息 - Bugreport'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-5786883173688296825</id><published>2012-10-17T02:42:00.002-07:00</published><updated>2013-04-23T00:41:03.403-07:00</updated><title type='text'>The log message Android is telling you - Bugreport</title><content type='html'>&lt;br /&gt;
&lt;b&gt;Preface&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
When someone get sick or get hurt and go to see a doctor, he must tell what&#39;s wrong to doctor. What if the Android device got some problems, how to know what wrong is on itself? Certainly, you need to look at the Log message that Android export.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Where to start?&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
There&#39;s a command called bugreport. You can get all information that Android/Linux can tell you. The command is either adb bugreport or adb shell bugreport. In case you try to use the command to get the bug report from Android emulator with JB, you&#39;ll get almost 68 kind of log message as follows.&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 600px;&quot;&gt;
 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 21536; mso-width-source: userset; width: 505pt;&quot; width=&quot;673&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none; width: 505pt;&quot; width=&quot;673&quot;&gt;&amp;nbsp;UPTIME (uptime)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;MEMORY INFO
  (/proc/meminfo)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;CPU INFO (top -n 1 -d 1 -m 30 -t)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;PROCRANK
  (procrank)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;VIRTUAL MEMORY STATS (/proc/vmstat)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;VMALLOC INFO
  (/proc/vmallocinfo)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SLAB INFO (/proc/slabinfo)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;ZONEINFO
  (/proc/zoneinfo)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;PAGETYPEINFO (/proc/pagetypeinfo)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BUDDYINFO
  (/proc/buddyinfo)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;KERNEL WAKELOCKS (/proc/wakelocks)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;KERNEL CPUFREQ
  (/sys/devices/system/cpu/cpu0/cpufreq/stats/time_in_state)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;PROCESSES (ps -P)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;PROCESSES AND
  THREADS (ps -t -p -P)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;LIBRANK (librank)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;KERNEL LOG
  (dmesg)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;LIST OF OPEN FILES (/system/xbin/su root
  lsof)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SMAPS OF ALL
  PROCESSES&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SHOW MAP 1 (/init) (/system/xbin/su root
  showmap 1)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BLOCKED PROCESS
  WAIT-CHANNELS&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SYSTEM LOG (logcat -v threadtime -d
  *:v)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;EVENT LOG
  (logcat -b events -v threadtime -d *:v)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;RADIO LOG (logcat -b radio -v threadtime -d
  *:v)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;VM TRACES JUST
  NOW (/data/anr/traces.txt.bugreport: 2012-10-17 08:21:46)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;VM TRACES AT LAST ANR (/data/anr/traces.txt:
  2012-10-17 08:16:11)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;NETWORK DEV
  INFO (/proc/net/dev)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;QTAGUID NETWORK INTERFACES INFO
  (/proc/net/xt_qtaguid/iface_stat_all)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;QTAGUID NETWORK
  INTERFACES INFO (xt) (/proc/net/xt_qtaguid/iface_stat_fmt)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;QTAGUID CTRL INFO
  (/proc/net/xt_qtaguid/ctrl)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;QTAGUID STATS
  INFO (/proc/net/xt_qtaguid/stats)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;NETWORK ROUTES (/proc/net/route)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;NETWORK ROUTES
  IPV6 (/proc/net/ipv6_route)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;LAST KMSG (/proc/last_kmsg)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;LAST PANIC
  CONSOLE (/data/dontpanic/apanic_console)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;LAST PANIC THREADS
  (/data/dontpanic/apanic_threads)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SYSTEM SETTINGS
  (/system/xbin/su root sqlite3 /data/…&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;NETWORK INTERFACES (/system/xbin/su root
  netcfg)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IP RULES (ip
  rule show)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IP RULES v6 (ip -6 rule show)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;ROUTE TABLE 60
  (ip route show table 60)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;ROUTE TABLE 61 v6 (ip -6 route show table
  60)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;ROUTE TABLE 61
  (ip route show table 61)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;ROUTE TABLE 61 v6 (ip -6 route show table
  61)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;ARP CACHE
  (/proc/net/arp)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IPTABLES (/system/xbin/su root iptables -L
  -nvx)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IP6TABLES
  (/system/xbin/su root ip6tables -L -nvx)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IPTABLE NAT (/system/xbin/su root iptables
  -t nat -L -nvx)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IPTABLE RAW
  (/system/xbin/su root iptables -t raw -L -nvx)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;IP6TABLE RAW (/system/xbin/su root ip6tables
  -t raw -L -nvx)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;WIFI NETWORKS
  (/system/xbin/su root wpa_cli list_networks)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SYSTEM PROPERTIES&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;VOLD DUMP (vdc
  dump)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;SECURE CONTAINERS (vdc asec list)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;FILESYSTEMS
  &amp;amp; FREE SPACE (/system/xbin/su root df)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;PACKAGE SETTINGS (/system/xbin/su root cat
  /data/system/packages.xml)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;PACKAGE UID
  ERRORS (/data/system/uiderrors.txt: 2012-10-15 02:30:29)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;LAST RADIO LOG (parse_radio_log
  /proc/last_radio_log)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BACKLIGHTS&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BINDER FAILED TRANSACTION LOG
  (/sys/kernel/debug/binder/failed_transaction_log)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BINDER
  TRANSACTION LOG (/sys/kernel/debug/binder/transaction_log)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BINDER TRANSACTIONS
  (/sys/kernel/debug/binder/transactions)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BINDER STATS
  (/sys/kernel/debug/binder/stats)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;BINDER STATE
  (/sys/kernel/debug/binder/state)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;DUMP VENDOR RIL
  LOGS (/system/xbin/su root vril-dump)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;DUMPSYS (dumpsys)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;APP ACTIVITIES
  (dumpsys activity all)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;APP SERVICES (dumpsys activity service
  all)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl63&quot; height=&quot;22&quot; style=&quot;border-bottom-color: rgb(79, 129, 189); border-bottom-width: 0.5pt; border-style: none none solid; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none;&quot;&gt;&amp;nbsp;APP SERVICES
  (dumpsys activity provider all)&amp;nbsp;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
These messages include all the information on Android and Linux layer and tell you about various message about Activities Event, Memory, System state, Radio state, Network state and so on.&lt;br /&gt;
&lt;br /&gt;
Note, each Android phone has a modem function. Typically, the modem message contains the transition message between base station and modem chip insider Android phone. This kinda message may not be output from Linux kernel message. Hence, the bugreport function cannot output such a message as well.&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/5786883173688296825/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/the-log-message-android-is-telling-you.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/5786883173688296825'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/5786883173688296825'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/the-log-message-android-is-telling-you.html' title='The log message Android is telling you - Bugreport'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-9176714152531492308</id><published>2012-10-17T00:12:00.004-07:00</published><updated>2013-04-23T00:41:16.450-07:00</updated><title type='text'>手動更新 Nexus 7 到最新版本</title><content type='html'>&lt;br /&gt;
&lt;b&gt;序&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
谷歌已經發行Nexus 7的4.1.2的版本於官方網站。有些人的Nexus裝置可能還沒收到平板電腦的主動通知來做升級。現在可以用本篇文章所介紹的方式來升級你的Google Nexus裝置。&lt;br /&gt;
&lt;br /&gt;
這邊的方法適用於若你把你的Nexus做了其他事情導致作業系統異常。可以試用本篇的方法讓你的Nexus回到最新的工廠出廠版本。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;介紹&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
以下的方法已經實驗過是可行的方式。執行前請先備份你的資料。因為更新會導致你的資料被全數刪除。再使用這個方法前，請確認你的Android裝置有開啟USB偵錯模式，並且能讓你的電腦認到你的Nexus的ADB Interface驅動裝置。&lt;br /&gt;
&lt;br /&gt;
1.&amp;nbsp;使用adb reboot-bootloader的指令，重新開機你的電腦到快速開機(fastboot)模式。&lt;br /&gt;
2. 用fastboot oem unlock的指令對bootloader做解鎖動作。&lt;br /&gt;
　- 使用這個指令會讓你的Nexus出現一個警告訊息。若你能同意這個訊息請選同意。若無法同意請勿執行下列步驟。&lt;br /&gt;
3. 使用聲音的大小按鍵來選擇你的選項，確定選項後，在按下電源按鍵來確定執行同意。&lt;br /&gt;
4. 從網址&lt;a href=&quot;https://dl.google.com/dl/android/aosp/nakasi-jzo54k-factory-973f190e.tgz&quot;&gt;https://dl.google.com/dl/android/aosp/nakasi-jzo54k-factory-973f190e.tgz&lt;/a&gt;下載4.1.2的工廠出廠版本。&lt;br /&gt;
5. 解壓縮下載的檔案到並執行資料夾的flash-all.bat檔案。&lt;br /&gt;
6. 放下你的Nexus，直到更新完成前都不要做任何操作。&lt;br /&gt;
7. 更新完成後，記得執行上鎖bootloader的動作來保護你的Nexus資料安全。使用adb reboot-bootloader讓Nexus重新開機進入快速開機模式後，執行fastboot oem lock的指令於電腦上。&lt;br /&gt;
&lt;br /&gt;
想要找到更多的Nexus裝置的工廠版本可以上&lt;a href=&quot;https://developers.google.com/android/nexus/images?hl=zh-TW&quot;&gt;https://developers.google.com/android/nexus/images?hl=zh-TW&lt;/a&gt;找到更多的訊息。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;參考資料&lt;/b&gt;&lt;br /&gt;
Bootloader unlock,&amp;nbsp;&lt;a href=&quot;https://groups.google.com/forum/?fromgroups=#!msg/android-building/Ld5FoFinN7k/xcZPFBikw0MJ&quot;&gt;https://groups.google.com/forum/?fromgroups=#!msg/android-building/Ld5FoFinN7k/xcZPFBikw0MJ&lt;/a&gt;&lt;br /&gt;
Nexus Factory Image,&amp;nbsp;&lt;a href=&quot;https://developers.google.com/android/nexus/images?hl=zh-TW&quot;&gt;https://developers.google.com/android/nexus/images?hl=zh-TW&lt;/a&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/9176714152531492308/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/nexus-7.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/9176714152531492308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/9176714152531492308'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/nexus-7.html' title='手動更新 Nexus 7 到最新版本'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-2023923878586503321</id><published>2012-10-16T23:08:00.002-07:00</published><updated>2013-04-23T00:41:28.859-07:00</updated><title type='text'>Android / Linux Shell Commands</title><content type='html'>&lt;br /&gt;
&lt;b&gt;Preface:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Android is running on Linux System and a Java based operating system. As you can see on Google Development Site, the architecture is as follows.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo6kDFLlP0I2amjoUKEHgZC2UtHDAhE7FtkMjH0KCVyfAloQMmc-P9JbR3nUY_SsS6IJ54DED7b79UJAVpoXfnhnvpdzeDWgAJWIE_G3DXbSgb2yuUlnEII68gaM7AA4foXWSI3tCtyxo/s1600/image00.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;278&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo6kDFLlP0I2amjoUKEHgZC2UtHDAhE7FtkMjH0KCVyfAloQMmc-P9JbR3nUY_SsS6IJ54DED7b79UJAVpoXfnhnvpdzeDWgAJWIE_G3DXbSgb2yuUlnEII68gaM7AA4foXWSI3tCtyxo/s400/image00.png&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;http://source.android.com/tech/security/#android-platform-security-architecture&quot; target=&quot;_blank&quot;&gt;http://source.android.com/tech/security/#android-platform-security-architecture&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
Android is working on dark green&amp;nbsp;(Android Runtime)&amp;nbsp;and light blue&amp;nbsp;(Applications &amp;amp; Application Framework)&amp;nbsp;portion of above graph. The Dalvik VM is involved in Android Runtime block, which is used to run the Java Based Application or System on Application Framework and Application Layer.&lt;br /&gt;
Linux is working on light green (Libraries) and pink (Linux Kernel) portion of above graph.&lt;br /&gt;
This architecture&amp;nbsp;can be always a reference for any Android powered device. However, there&#39;re something needed to be added or modified in real case.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Android SDK provides a tool - ADB. There&#39;s a ADB server inside the Android powered devices and a ADB client in desktop/NB devices for connecting to ADB server. There&#39;re a lot of useful command in Android or Linux layer we can use for our interesting purpose. One of easy way to use them is to use ADB tool to invoke those commands for our purpose.&lt;br /&gt;
&lt;br /&gt;
Explore the folder in Android emulator with JB build, there&#39;re a lot of command existed in /system/bin. To explore the file list in this folder by using adb shell &quot;ls system/bin&quot;.&lt;br /&gt;
&lt;br /&gt;
For instance,&lt;br /&gt;
&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-activity-manager.html&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;am&lt;/i&gt;&lt;/a&gt; - Activity Manager, Java based command, the source code is located at&amp;nbsp;&lt;i&gt;platform_frameworks_base/blob/master/cmds/am/src/com/android/commands/am/Am.java&lt;/i&gt;&lt;br /&gt;
am is activity manager which can control application components in Android. Look at&amp;nbsp;&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-activity-manager.html&quot; target=&quot;_blank&quot;&gt;am&lt;/a&gt;&amp;nbsp;page for more information&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;http://android-test-tw.blogspot.tw/2012/10/preface-theres-monkey-existed-in.html&quot; target=&quot;_blank&quot;&gt;&lt;i&gt;monkey&lt;/i&gt;&lt;/a&gt; - a stability test tool which generates random events for Android powered device,&amp;nbsp;Java based command. The source code is located at&amp;nbsp;&lt;i&gt;platform_development/blob/master/cmds/monkey/src/com/android/commands/monkey/Monkey.java&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;pm&lt;/i&gt; - Package Manager which can manipulate package relative task,&amp;nbsp;Java based command. The source code is located at&amp;nbsp;&lt;i&gt;platform_frameworks_base/blob/master/cmds/pm/src/com/android/commands/pm/Pm.java&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;dmesg&lt;/i&gt; - Linux Debug Message which can output Linux relative message, a C language based, the same usage with Linux System. The source code is located at&amp;nbsp;&lt;i&gt;platform_system_core/blob/master/toolbox/dmesg.c&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;ps&lt;/i&gt; - Process State, which output the process state with process id (pid), ram usage...etc, a C&amp;nbsp;language based, the same usage with Linux System. The source code is located at&amp;nbsp;&lt;i&gt;android/platform_system_core/blob/master/toolbox/ps.c&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;br /&gt;&lt;/i&gt;
From above examples, we know the commands in Android powered devices can be separated to C and Java language based. Either one can be used on Android. However the layer to execute these commands is different. There&#39;re many other language can be run on Linux such as python, perl, bash...etc. Hence, it&#39;s not only C or Java based executable file but also other languages can be run on Android powered devices.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reference&lt;/b&gt;&lt;br /&gt;
Android Architecture,&amp;nbsp;&lt;a href=&quot;http://source.android.com/tech/security/&quot;&gt;http://source.android.com/tech/security/&lt;/a&gt;&lt;br /&gt;
Android Source Code Mirror Site,&amp;nbsp;&lt;a href=&quot;https://github.com/android/&quot;&gt;https://github.com/android/&lt;/a&gt;&lt;br /&gt;
Package Manager,&amp;nbsp;&lt;a href=&quot;http://developer.android.com/reference/android/content/pm/PackageManager.html&quot;&gt;http://developer.android.com/reference/android/content/pm/PackageManager.html&lt;/a&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/2023923878586503321/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-linux-commands.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/2023923878586503321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/2023923878586503321'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-linux-commands.html' title='Android / Linux Shell Commands'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjo6kDFLlP0I2amjoUKEHgZC2UtHDAhE7FtkMjH0KCVyfAloQMmc-P9JbR3nUY_SsS6IJ54DED7b79UJAVpoXfnhnvpdzeDWgAJWIE_G3DXbSgb2yuUlnEII68gaM7AA4foXWSI3tCtyxo/s72-c/image00.png" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-7368013911133604061</id><published>2012-10-15T22:54:00.004-07:00</published><updated>2013-04-23T00:41:47.217-07:00</updated><title type='text'>Android Activity Manager 中文版</title><content type='html'>&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-activity-manager.html&quot; target=&quot;_blank&quot;&gt;English Version&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;序&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Android的系統主要有四個應用的元件。有以下這四種元件 - 活動(Activities)、服務(Services)、傳播接收器(Broadcast receivers)、與內容提供者(Content providers)。當中只有活動這個元件有使用者介面。&lt;br /&gt;
&lt;br /&gt;
活動管理器 (Activity Manager)是一個可以控制這些元件的一個工具。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;介紹&lt;/b&gt;&lt;br /&gt;
活動管理器必須使用Shell指令&quot;am&quot;。若要了解am有哪些功能與參數可以使用，可以使用指令 &quot;adb shell am&quot;。執行這個指令必須把你的Android裝置連接到電腦並且啟動USB偵錯模式。&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;以下是執行adb shell am的輸出結果:&lt;/i&gt;&lt;br /&gt;
usage: am [subcommand] [options]&lt;br /&gt;
usage: am start [-D] [-W] [-P &lt;file&gt;] [--start-profiler &lt;file&gt;]&lt;/file&gt;&lt;/file&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[--R COUNT] [-S] [--opengl-trace] &lt;intent&gt;&lt;/intent&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am startservice &lt;intent&gt;&lt;/intent&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am force-stop &lt;package&gt;&lt;/package&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am kill &lt;package&gt;&lt;/package&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am kill-all&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am broadcast &lt;intent&gt;&lt;/intent&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am instrument [-r] [-e &lt;name&gt; &lt;value&gt;] [-p &lt;file&gt;] [-w]&lt;/file&gt;&lt;/value&gt;&lt;/name&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[--no-window-animation] &lt;component&gt;&lt;/component&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am profile start &lt;process&gt; &lt;file&gt;&lt;/file&gt;&lt;/process&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am profile stop [&lt;process&gt;]&lt;/process&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am dumpheap [flags] &lt;process&gt; &lt;file&gt;&lt;/file&gt;&lt;/process&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am set-debug-app [-w] [--persistent] &lt;package&gt;&lt;/package&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am clear-debug-app&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am monitor [--gdb &lt;port&gt;]&lt;/port&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am screen-compat [on|off] &lt;package&gt;&lt;/package&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am display-size [reset|MxN]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am to-uri [INTENT]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am to-intent-uri [INTENT]&lt;br /&gt;
&lt;br /&gt;
am start: start an Activity. &amp;nbsp;Options are:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -D: enable debugging&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -W: wait for launch to complete&lt;br /&gt;
&amp;nbsp; &amp;nbsp; --start-profiler &lt;file&gt;: start profiler and send results to &lt;file&gt;&lt;/file&gt;&lt;/file&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -P &lt;file&gt;: like above, but profiling stops when app goes idle&lt;/file&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -R: repeat the activity launch &lt;count&gt; times. &amp;nbsp;Prior to each repeat,&lt;/count&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; the top activity will be finished.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -S: force stop the target app before starting the activity&lt;br /&gt;
&amp;nbsp; &amp;nbsp; --opengl-trace: enable tracing of OpenGL functions&lt;br /&gt;
&lt;br /&gt;
am startservice: start a Service.&lt;br /&gt;
&lt;br /&gt;
am force-stop: force stop everything associated with &lt;package&gt;.&lt;/package&gt;&lt;br /&gt;
&lt;br /&gt;
am kill: Kill all processes associated with &lt;package&gt;. &amp;nbsp;Only kills.&lt;/package&gt;&lt;br /&gt;
&amp;nbsp; processes that are safe to kill -- that is, will not impact the user&lt;br /&gt;
&amp;nbsp; experience.&lt;br /&gt;
&lt;br /&gt;
am kill-all: Kill all background processes.&lt;br /&gt;
&lt;br /&gt;
am broadcast: send a broadcast Intent.&lt;br /&gt;
&lt;br /&gt;
am instrument: start an Instrumentation. &amp;nbsp;Typically this target &lt;component&gt;&lt;/component&gt;&lt;br /&gt;
&amp;nbsp; is the form &lt;test_package&gt;/&lt;runner_class&gt;. &amp;nbsp;Options are:&lt;/runner_class&gt;&lt;/test_package&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT). &amp;nbsp;Use with&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [-e perf true] to generate raw output for performance measurements.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -e &lt;name&gt; &lt;value&gt;: set argument &lt;name&gt; to &lt;value&gt;. &amp;nbsp;For test runners a&lt;/value&gt;&lt;/name&gt;&lt;/value&gt;&lt;/name&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; common form is [-e &lt;testrunner_flag&gt; &lt;value&gt;[,&lt;value&gt;...]].&lt;/value&gt;&lt;/value&gt;&lt;/testrunner_flag&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -p &lt;file&gt;: write profiling data to &lt;file&gt;&lt;/file&gt;&lt;/file&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -w: wait for instrumentation to finish before returning. &amp;nbsp;Required for&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test runners.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; --no-window-animation: turn off window animations will running.&lt;br /&gt;
&lt;br /&gt;
am profile: start and stop profiler on a process.&lt;br /&gt;
&lt;br /&gt;
am dumpheap: dump the heap of a process. &amp;nbsp;Options are:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -n: dump native heap instead of managed heap&lt;br /&gt;
&lt;br /&gt;
am set-debug-app: set application &lt;package&gt; to debug. &amp;nbsp;Options are:&lt;/package&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -w: wait for debugger when application starts&lt;br /&gt;
&amp;nbsp; &amp;nbsp; --persistent: retain this value&lt;br /&gt;
&lt;br /&gt;
am clear-debug-app: clear the previously set-debug-app.&lt;br /&gt;
&lt;br /&gt;
am monitor: start monitoring for crashes or ANRs.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; --gdb: start gdbserv on the given port at crash/ANR&lt;br /&gt;
&lt;br /&gt;
am screen-compat: control screen compatibility mode of &lt;package&gt;.&lt;/package&gt;&lt;br /&gt;
&lt;br /&gt;
am display-size: override display size.&lt;br /&gt;
&lt;br /&gt;
am to-uri: print the given Intent specification as a URI.&lt;br /&gt;
&lt;br /&gt;
am to-intent-uri: print the given Intent specification as an intent: URI.&lt;br /&gt;
&lt;br /&gt;
&lt;intent&gt; specifications include these flags and arguments:&lt;/intent&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [-a &lt;action&gt;] [-d &lt;data_uri&gt;] [-t &lt;mime_type&gt;]&lt;/mime_type&gt;&lt;/data_uri&gt;&lt;/action&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [-c &lt;category&gt; [-c &lt;category&gt;] ...]&lt;/category&gt;&lt;/category&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [-e|--es &lt;extra_key&gt; &lt;extra_string_value&gt; ...]&lt;/extra_string_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--esn &lt;extra_key&gt; ...]&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--ez &lt;extra_key&gt; &lt;extra_boolean_value&gt; ...]&lt;/extra_boolean_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--ei &lt;extra_key&gt; &lt;extra_int_value&gt; ...]&lt;/extra_int_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--el &lt;extra_key&gt; &lt;extra_long_value&gt; ...]&lt;/extra_long_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--ef &lt;extra_key&gt; &lt;extra_float_value&gt; ...]&lt;/extra_float_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--eu &lt;extra_key&gt; &lt;extra_uri_value&gt; ...]&lt;/extra_uri_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--ecn &lt;extra_key&gt; &lt;extra_component_name_value&gt;]&lt;/extra_component_name_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--eia &lt;extra_key&gt; &lt;extra_int_value&gt;[,&lt;extra_int_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&amp;nbsp; &amp;nbsp; [--ela &lt;extra_key&gt; &lt;extra_long_value&gt;[,&lt;extra_long_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&amp;nbsp; &amp;nbsp; [--efa &lt;extra_key&gt; &lt;extra_float_value&gt;[,&lt;extra_float_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&amp;nbsp; &amp;nbsp; [-n &lt;component&gt;] [-f &lt;flags&gt;]&lt;/flags&gt;&lt;/component&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--grant-read-uri-permission] [--grant-write-uri-permission]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--debug-log-resolution] [--exclude-stopped-packages]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--include-stopped-packages]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-brought-to-front] [--activity-clear-top]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-clear-when-task-reset] [--activity-exclude-from-recents]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-launched-from-history] [--activity-multiple-task]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-no-animation] [--activity-no-history]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-no-user-action] [--activity-previous-is-top]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-reorder-to-front] [--activity-reset-task-if-needed]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-single-top] [--activity-clear-task]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-task-on-home]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--receiver-registered-only] [--receiver-replace-pending]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--selector]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [&lt;uri&gt; | &lt;package&gt; | &lt;component&gt;]&lt;/component&gt;&lt;/package&gt;&lt;/uri&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;b&gt;應用範例:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;&lt;i&gt;強制執行某個Package停止工作&lt;/i&gt;&lt;br /&gt;
adb shell &quot;am -force-stop PACKAGE&quot;&lt;br /&gt;例:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;adb shell &quot;am -force-stop com.android.browser&quot;&lt;br /&gt;這個指令會強制停止顯示在畫面上的瀏覽器跳出。使用這個指令來強制停止工作，相關的Package也會同步被強制停止。
&lt;/extra_float_value&gt;&lt;/extra_float_value&gt;&lt;/extra_key&gt;&lt;/extra_long_value&gt;&lt;/extra_long_value&gt;&lt;/extra_key&gt;&lt;/extra_int_value&gt;&lt;/extra_int_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&lt;extra_key&gt;&lt;extra_int_value&gt;&lt;extra_int_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;extra_key&gt;&lt;extra_long_value&gt;&lt;extra_long_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;extra_key&gt;&lt;extra_float_value&gt;&lt;extra_float_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;br /&gt;&lt;i&gt;瀏覽指定網頁&lt;/i&gt;&lt;br /&gt;
adb shell &quot;am start -a&amp;nbsp;android.intent.action.VIEW -d url&quot;&lt;br /&gt;這個指令的參數-a指的是要執行的動作(action)，-d指的是執行動作所需要的資料(Data)。這邊的動作參數的值是
&lt;/extra_float_value&gt;&lt;/extra_float_value&gt;&lt;/extra_key&gt;&lt;/extra_long_value&gt;&lt;/extra_long_value&gt;&lt;/extra_key&gt;&lt;/extra_int_value&gt;&lt;/extra_int_value&gt;&lt;/extra_key&gt;android.intent.action.VIEW，表示要做觀看的動作。-d參數後面的資料是網頁資料。&lt;br /&gt;
&lt;extra_key&gt;&lt;extra_int_value&gt;&lt;extra_int_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;extra_key&gt;&lt;extra_long_value&gt;&lt;extra_long_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;extra_key&gt;&lt;extra_float_value&gt;&lt;extra_float_value ...=&quot;...&quot; p=&quot;p&quot;&gt;例:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;adb shell &quot;am start -a android.intent.action.VIEW -d http://google.com&quot;&lt;br /&gt;這個指令會開啟預設的瀏覽器並且開啟google.com的網頁。&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;撥電話&lt;/i&gt;&lt;br /&gt;
adb shell &quot;am start -a android.intent.action.CALL -d tel:phone_number&quot;&lt;br /&gt;這個指令使用了動作為android.intent.action.CALL，表示要執行呼叫的動作，而其後的資料值為tel:phone_number，其中tel:為撥電話的多媒體型態(MIME Type)，tel:之後為所要撥出的電話號碼。&lt;br /&gt;例:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; am start -a android.intent.action.CALL -d tel:777&lt;br /&gt;這個範例會使手機撥打電話號碼777。&lt;br /&gt;
&lt;br /&gt;&lt;i&gt;呼叫出一個指定的活動(Activity)&lt;/i&gt;&lt;br /&gt;
adb shell &quot;am start -n package/activity_name_or_full_activity_name_with_package&quot;&lt;br /&gt;範例中，-n後面要指定package的名稱與斜線/及activity的名稱呼叫某個Activity被執行。
&lt;/extra_float_value&gt;&lt;/extra_float_value&gt;&lt;/extra_key&gt;&lt;/extra_long_value&gt;&lt;/extra_long_value&gt;&lt;/extra_key&gt;&lt;/extra_int_value&gt;&lt;/extra_int_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&lt;extra_key&gt;&lt;extra_int_value&gt;&lt;extra_int_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;extra_key&gt;&lt;extra_long_value&gt;&lt;extra_long_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;extra_key&gt;&lt;extra_float_value&gt;&lt;extra_float_value ...=&quot;...&quot; p=&quot;p&quot;&gt;例:&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;adb shell &quot;am start -n com.android.settings/com.android.settings.Settings&quot;&lt;br /&gt;這個範例中，設定的使用者介面會被帶到前景。
&lt;/extra_float_value&gt;&lt;/extra_float_value&gt;&lt;/extra_key&gt;&lt;/extra_long_value&gt;&lt;/extra_long_value&gt;&lt;/extra_key&gt;&lt;/extra_int_value&gt;&lt;/extra_int_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&lt;extra_key&gt;&lt;extra_int_value&gt;&lt;extra_int_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;extra_key&gt;&lt;extra_long_value&gt;&lt;extra_long_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;extra_key&gt;&lt;extra_float_value&gt;&lt;extra_float_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;br /&gt;&lt;i&gt;利用am新增一個聯絡人&lt;/i&gt;&lt;br /&gt;
adb shell &quot;am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name &#39;Android Auto&#39; -e phone 1234567890&quot;&lt;br /&gt;這個範例的參數中，動作是
&lt;/extra_float_value&gt;&lt;/extra_float_value&gt;&lt;/extra_key&gt;&lt;/extra_long_value&gt;&lt;/extra_long_value&gt;&lt;/extra_key&gt;&lt;/extra_int_value&gt;&lt;/extra_int_value&gt;&lt;/extra_key&gt;android.intent.action.INSERT，表示要做輸入的動作。-t後面接的值是多媒體的格式。這邊看到的多媒體格式為聯絡人的格式。-e後面接的是輸入欄位的名稱與欄位的值。這個範例輸入兩個欄位，一個是名稱(name)，另一個是電話號碼(phone)。它們的值分別為android與1234567890。這些參數與動作必須在應用程式的Manifest XML中有出現，才能使用他。若使用在不同的應用程式，你可以先確認源碼是否有相關的參數與設定。&lt;br /&gt;
&lt;extra_key&gt;&lt;extra_int_value&gt;&lt;extra_int_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;extra_key&gt;&lt;extra_long_value&gt;&lt;extra_long_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;extra_key&gt;&lt;extra_float_value&gt;&lt;extra_float_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&lt;br /&gt;使用的方法還有很多種，這邊只舉幾個例子讓讀者們啟發，可以做延伸的應用。
&lt;/extra_float_value&gt;&lt;/extra_float_value&gt;&lt;/extra_key&gt;&lt;/extra_long_value&gt;&lt;/extra_long_value&gt;&lt;/extra_key&gt;&lt;/extra_int_value&gt;&lt;/extra_int_value&gt;&lt;/extra_key&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/7368013911133604061/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-activity-manager_15.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7368013911133604061'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7368013911133604061'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-activity-manager_15.html' title='Android Activity Manager 中文版'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-7644850890612746937</id><published>2012-10-15T18:55:00.002-07:00</published><updated>2013-04-23T00:42:07.565-07:00</updated><title type='text'>Upgrade your Nexus 7 (Wi-Fi) to 4.2 Manually</title><content type='html'>&lt;br /&gt;
&lt;b&gt;Preface&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Google has released 4.2 for Nexus 7 on WEB. Maybe someone has not received OTA notification for upgrade. If your device got some problem on your flash OS because of certain reasons, you can also recover your Nexus devices by the image that Google released on WEB.&lt;br /&gt;
&lt;br /&gt;
Note that you can select the image rom for your Nexus device. You need to download the rom code with the same model for your Nexus device and then you can upgrade your Nexus device. For different Nexus model, you can take a look on web site -&amp;nbsp;&lt;a href=&quot;https://developers.google.com/android/nexus/&quot;&gt;https://developers.google.com/android/nexus/&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Instruction&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
You can follow the instruction below to upgrade or restore your Nexus. Note, you need to backup your personal data in advance, because using this instruction would erase all your data.&lt;br /&gt;
&lt;br /&gt;
1. Reboot the device as fastboot mode by command - adb reboot-bootloader.&lt;br /&gt;
2. Unlock your bootloader by command - fastboot oem unlock&lt;br /&gt;
&amp;nbsp; &amp;nbsp; - The warning screen would bring up, please read it and make decision if you agree or not. If you don&#39;t agree, you cannot do the following action.&lt;br /&gt;
3. Using&amp;nbsp;volume&amp;nbsp;up or&amp;nbsp;volume&amp;nbsp;down to navigate the options and press power key to execute the selected option. If you agree the warning shows on screen, move the option to agree or ok or accept and then press power key to confirm the option.&lt;br /&gt;
4. Download the image from Google -&amp;nbsp;&lt;a href=&quot;https://dl.google.com/dl/android/aosp/nakasi-jzo54k-factory-973f190e.tgz&quot;&gt;https://dl.google.com/dl/android/aosp/nakasi-jzo54k-factory-973f190e.tgz&lt;/a&gt;&amp;nbsp;for 4.1 and &amp;nbsp;https://dl.google.com/dl/android/aosp/nakasi-jop40c-factory-6aabb391.tgz for 4.2.&lt;br /&gt;
5. Unzip all the file to the folder and double click&amp;nbsp;flash-all.bat within the folder.&lt;br /&gt;
6. Don&#39;t touch your Nexus 7 until flash is successfully.&lt;br /&gt;
7. After the flash process is done, lock your bootloader to secure your Nexus by command adb reboot-bootloader and then perform fastboot oem lock.&lt;br /&gt;
&lt;br /&gt;
Above instruction may be used to recover your other Nexus device. You can look at web sit&amp;nbsp;&lt;a href=&quot;https://developers.google.com/android/nexus/images?hl=zh-TW&quot;&gt;https://developers.google.com/android/nexus/images?hl=zh-TW&lt;/a&gt;&amp;nbsp;for more information.&lt;br /&gt;
&lt;br /&gt;
In case you don&#39;t receive the OTA upgrade notification, another way to upgrade your Nexus 7 is as follows,&lt;br /&gt;
Google Service Framework stop and&amp;nbsp;Clear Cache. And then press the upgrade check on your Nexus. This is a method I got from someone&#39;s talk. You may be able to try it in case you just want to upgrade your Nexus 7. Why the method can be workable? I guess it&#39;s a bug for Nexus 7 OTA upgrade.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reference&lt;/b&gt;&lt;br /&gt;
Bootloader unlock,&amp;nbsp;&lt;a href=&quot;https://groups.google.com/forum/?fromgroups=#!msg/android-building/Ld5FoFinN7k/xcZPFBikw0MJ&quot;&gt;https://groups.google.com/forum/?fromgroups=#!msg/android-building/Ld5FoFinN7k/xcZPFBikw0MJ&lt;/a&gt;&lt;br /&gt;
Nexus Factory Image,&amp;nbsp;&lt;a href=&quot;https://developers.google.com/android/nexus/images?hl=zh-TW&quot;&gt;https://developers.google.com/android/nexus/images?hl=zh-TW&lt;/a&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/7644850890612746937/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/upgrade-your-nexus-7-to-412-manually.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7644850890612746937'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/7644850890612746937'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/upgrade-your-nexus-7-to-412-manually.html' title='Upgrade your Nexus 7 (Wi-Fi) to 4.2 Manually'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-3665338528476707222</id><published>2012-10-15T00:03:00.001-07:00</published><updated>2013-04-23T00:42:27.228-07:00</updated><title type='text'>Android Activity Manager</title><content type='html'>&lt;a href=&quot;http://android-test-tw.blogspot.tw/2012/10/android-activity-manager_15.html&quot; target=&quot;_blank&quot;&gt;中文版&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;Preface&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There&#39;re four application components in Android. They&#39;re Activities, Services,&amp;nbsp;Broadcast receivers, and Content providers.There&#39;s only one component has User Interface. That&#39;s Activities. &lt;i&gt;Activity Manger&lt;/i&gt; can help you to control the application components in Android. Let&#39;s take a look how to&amp;nbsp;well&amp;nbsp;use the Activity Manager for our work.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Introduction&lt;/b&gt;&lt;br /&gt;
There&#39;s a shell command called am, which performs the task by Activity Manager. The help of am, you can send the adb command - adb shell am when your computer are connect to your Android device.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
usage: am [subcommand] [options]&lt;br /&gt;
usage: am start [-D] [-W] [-P &lt;file&gt;] [--start-profiler &lt;file&gt;]&lt;/file&gt;&lt;/file&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[--R COUNT] [-S] [--opengl-trace] &lt;intent&gt;&lt;/intent&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am startservice &lt;intent&gt;&lt;/intent&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am force-stop &lt;package&gt;&lt;/package&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am kill &lt;package&gt;&lt;/package&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am kill-all&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am broadcast &lt;intent&gt;&lt;/intent&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am instrument [-r] [-e &lt;name&gt; &lt;value&gt;] [-p &lt;file&gt;] [-w]&lt;/file&gt;&lt;/value&gt;&lt;/name&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[--no-window-animation] &lt;component&gt;&lt;/component&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am profile start &lt;process&gt; &lt;file&gt;&lt;/file&gt;&lt;/process&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am profile stop [&lt;process&gt;]&lt;/process&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am dumpheap [flags] &lt;process&gt; &lt;file&gt;&lt;/file&gt;&lt;/process&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am set-debug-app [-w] [--persistent] &lt;package&gt;&lt;/package&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am clear-debug-app&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am monitor [--gdb &lt;port&gt;]&lt;/port&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am screen-compat [on|off] &lt;package&gt;&lt;/package&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am display-size [reset|MxN]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am to-uri [INTENT]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;am to-intent-uri [INTENT]&lt;br /&gt;
&lt;br /&gt;
am start: start an Activity. &amp;nbsp;Options are:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -D: enable debugging&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -W: wait for launch to complete&lt;br /&gt;
&amp;nbsp; &amp;nbsp; --start-profiler &lt;file&gt;: start profiler and send results to &lt;file&gt;&lt;/file&gt;&lt;/file&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -P &lt;file&gt;: like above, but profiling stops when app goes idle&lt;/file&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -R: repeat the activity launch &lt;count&gt; times. &amp;nbsp;Prior to each repeat,&lt;/count&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; the top activity will be finished.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -S: force stop the target app before starting the activity&lt;br /&gt;
&amp;nbsp; &amp;nbsp; --opengl-trace: enable tracing of OpenGL functions&lt;br /&gt;
&lt;br /&gt;
am startservice: start a Service.&lt;br /&gt;
&lt;br /&gt;
am force-stop: force stop everything associated with &lt;package&gt;.&lt;/package&gt;&lt;br /&gt;
&lt;br /&gt;
am kill: Kill all processes associated with &lt;package&gt;. &amp;nbsp;Only kills.&lt;/package&gt;&lt;br /&gt;
&amp;nbsp; processes that are safe to kill -- that is, will not impact the user&lt;br /&gt;
&amp;nbsp; experience.&lt;br /&gt;
&lt;br /&gt;
am kill-all: Kill all background processes.&lt;br /&gt;
&lt;br /&gt;
am broadcast: send a broadcast Intent.&lt;br /&gt;
&lt;br /&gt;
am instrument: start an Instrumentation. &amp;nbsp;Typically this target &lt;component&gt;&lt;/component&gt;&lt;br /&gt;
&amp;nbsp; is the form &lt;test_package&gt;/&lt;runner_class&gt;. &amp;nbsp;Options are:&lt;/runner_class&gt;&lt;/test_package&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -r: print raw results (otherwise decode REPORT_KEY_STREAMRESULT). &amp;nbsp;Use with&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [-e perf true] to generate raw output for performance measurements.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -e &lt;name&gt; &lt;value&gt;: set argument &lt;name&gt; to &lt;value&gt;. &amp;nbsp;For test runners a&lt;/value&gt;&lt;/name&gt;&lt;/value&gt;&lt;/name&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; common form is [-e &lt;testrunner_flag&gt; &lt;value&gt;[,&lt;value&gt;...]].&lt;/value&gt;&lt;/value&gt;&lt;/testrunner_flag&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -p &lt;file&gt;: write profiling data to &lt;file&gt;&lt;/file&gt;&lt;/file&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -w: wait for instrumentation to finish before returning. &amp;nbsp;Required for&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; test runners.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; --no-window-animation: turn off window animations will running.&lt;br /&gt;
&lt;br /&gt;
am profile: start and stop profiler on a process.&lt;br /&gt;
&lt;br /&gt;
am dumpheap: dump the heap of a process. &amp;nbsp;Options are:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -n: dump native heap instead of managed heap&lt;br /&gt;
&lt;br /&gt;
am set-debug-app: set application &lt;package&gt; to debug. &amp;nbsp;Options are:&lt;/package&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; -w: wait for debugger when application starts&lt;br /&gt;
&amp;nbsp; &amp;nbsp; --persistent: retain this value&lt;br /&gt;
&lt;br /&gt;
am clear-debug-app: clear the previously set-debug-app.&lt;br /&gt;
&lt;br /&gt;
am monitor: start monitoring for crashes or ANRs.&lt;br /&gt;
&amp;nbsp; &amp;nbsp; --gdb: start gdbserv on the given port at crash/ANR&lt;br /&gt;
&lt;br /&gt;
am screen-compat: control screen compatibility mode of &lt;package&gt;.&lt;/package&gt;&lt;br /&gt;
&lt;br /&gt;
am display-size: override display size.&lt;br /&gt;
&lt;br /&gt;
am to-uri: print the given Intent specification as a URI.&lt;br /&gt;
&lt;br /&gt;
am to-intent-uri: print the given Intent specification as an intent: URI.&lt;br /&gt;
&lt;br /&gt;
&lt;intent&gt; specifications include these flags and arguments:&lt;/intent&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [-a &lt;action&gt;] [-d &lt;data_uri&gt;] [-t &lt;mime_type&gt;]&lt;/mime_type&gt;&lt;/data_uri&gt;&lt;/action&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [-c &lt;category&gt; [-c &lt;category&gt;] ...]&lt;/category&gt;&lt;/category&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [-e|--es &lt;extra_key&gt; &lt;extra_string_value&gt; ...]&lt;/extra_string_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--esn &lt;extra_key&gt; ...]&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--ez &lt;extra_key&gt; &lt;extra_boolean_value&gt; ...]&lt;/extra_boolean_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--ei &lt;extra_key&gt; &lt;extra_int_value&gt; ...]&lt;/extra_int_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--el &lt;extra_key&gt; &lt;extra_long_value&gt; ...]&lt;/extra_long_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--ef &lt;extra_key&gt; &lt;extra_float_value&gt; ...]&lt;/extra_float_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--eu &lt;extra_key&gt; &lt;extra_uri_value&gt; ...]&lt;/extra_uri_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--ecn &lt;extra_key&gt; &lt;extra_component_name_value&gt;]&lt;/extra_component_name_value&gt;&lt;/extra_key&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--eia &lt;extra_key&gt; &lt;extra_int_value&gt;[,&lt;extra_int_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&amp;nbsp; &amp;nbsp; [--ela &lt;extra_key&gt; &lt;extra_long_value&gt;[,&lt;extra_long_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&amp;nbsp; &amp;nbsp; [--efa &lt;extra_key&gt; &lt;extra_float_value&gt;[,&lt;extra_float_value ...=&quot;...&quot; p=&quot;p&quot;&gt;&amp;nbsp; &amp;nbsp; [-n &lt;component&gt;] [-f &lt;flags&gt;]&lt;/flags&gt;&lt;/component&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--grant-read-uri-permission] [--grant-write-uri-permission]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--debug-log-resolution] [--exclude-stopped-packages]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--include-stopped-packages]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-brought-to-front] [--activity-clear-top]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-clear-when-task-reset] [--activity-exclude-from-recents]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-launched-from-history] [--activity-multiple-task]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-no-animation] [--activity-no-history]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-no-user-action] [--activity-previous-is-top]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-reorder-to-front] [--activity-reset-task-if-needed]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-single-top] [--activity-clear-task]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--activity-task-on-home]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--receiver-registered-only] [--receiver-replace-pending]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [--selector]&lt;br /&gt;
&amp;nbsp; &amp;nbsp; [&lt;uri&gt; | &lt;package&gt; | &lt;component&gt;]&lt;/component&gt;&lt;/package&gt;&lt;/uri&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Sample applications:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Force to stop working for specified package,&lt;/i&gt;&lt;br /&gt;
adb shell &quot;am -force-stop PACKAGE&quot;&lt;br /&gt;
Ex:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;adb shell &quot;am -force-stop com.android.browser&quot;&lt;br /&gt;
In this case, if the browser is in the foreground, the browser would be stopped working and dismissed.&lt;br /&gt;
Note, the relative package would also be forced to stop working.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Trigger Android device to bring up the broswer and open a specified URL&lt;/i&gt;&lt;br /&gt;
adb shell &quot;am start -a&amp;nbsp;android.intent.action.VIEW -d url&quot;&lt;br /&gt;
Within this command, start stands for doing something, -a stands for action, and -d stands for the data of action required.&lt;br /&gt;
Ex:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp;adb shell &quot;am start -a android.intent.action.VIEW -d http://google.com&quot;&lt;br /&gt;
This example represents a view action for opening a url.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Make a phone call&lt;/i&gt;&lt;br /&gt;
adb shell &quot;am start -a android.intent.action.CALL -d tel:phone_number&quot;&lt;br /&gt;
Within this command, action is to make a call - android.intent.action.CALL, and action data is tel:phone_number.&lt;br /&gt;
Ex:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; am start -a android.intent.action.CALL -d tel:777&lt;br /&gt;
In this example, Android device would make a phone call with number 777.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Launch an activity with specified package name&lt;/i&gt;&lt;br /&gt;
adb shell &quot;am start -n package/activity_name_or_full_activity_name_with_package&quot;&lt;br /&gt;
Within this example, -n is followed by component name and the component would be launched by executing this command.&lt;br /&gt;
Ex:&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;adb shell &quot;am start -n com.android.settings/com.android.settings.Settings&quot;&lt;br /&gt;
In this example, the settings activity would be brought up to top screen.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Create a new contact by am&lt;/i&gt;&lt;br /&gt;
adb shell &quot;am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/contact -e name &#39;Android Auto&#39; -e phone 1234567890&quot;&lt;br /&gt;
Within the command, action is insertion, -t stands for MIME type of inserting data in contact, -e stands for extra key that is defined in Manifest XML file, the name is followed by -e &amp;nbsp;for the extra key to be used for contact, and the value of extra key - name is followed by extra key - name. The parameters for -e phone 1234567890 has identical usage with -e name &#39;Anddroid Auto&#39;. Contract app would fill the field of assigning extra keys for new contact in Android after executing above command. With respecting to action - android.intent.action.INSERT, it&#39;s&amp;nbsp;necessary&amp;nbsp;to have this configuration in Manifest XML. Or Android would do nothing for this command. That means in case you want to use this command on another activity, you need to check if this configuration&#39;s existed in Manifest XML file of the App you want to control.&lt;br /&gt;
&lt;br /&gt;
There&#39;re a lot of parameters you can use for controlling Android. Above examples provided you some idea to extend your usage for your work&lt;br /&gt;
&lt;br /&gt;
&lt;/extra_float_value&gt;&lt;/extra_float_value&gt;&lt;/extra_key&gt;&lt;/extra_long_value&gt;&lt;/extra_long_value&gt;&lt;/extra_key&gt;&lt;/extra_int_value&gt;&lt;/extra_int_value&gt;&lt;/extra_key&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/3665338528476707222/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-activity-manager.html#comment-form' title='13 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/3665338528476707222'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/3665338528476707222'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-activity-manager.html' title='Android Activity Manager'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>13</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-212283245534008613</id><published>2012-10-14T20:09:00.002-07:00</published><updated>2013-04-23T00:42:42.322-07:00</updated><title type='text'>Android MonkeyRunner with Jythan - A simple example to get start</title><content type='html'>&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-monkeyrunner-jythan.html&quot;&gt;中文版&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;Preface&lt;/b&gt;&lt;br /&gt;
The MonkeyRunner is a tool provided by Google Android Development Team and released with Android SDK. The MonkeyRunner is consisted of a set of command and use Jython script as its interpreting program language. The Jython script is process by Java VM rather than C/C++. We can add some logic statement into the script for more flexible control by &amp;nbsp;Jython script.&lt;br /&gt;
&lt;br /&gt;
Before you start to read this article, you need to know how to set up the environment of monkeyrunner. If you don&#39;t know how to do it, you can read my another article at &lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-automation-test-by-monkeyrunner.html&quot;&gt;http://android-test-tw.blogspot.com/2012/10/android-automation-test-by-monkeyrunner.html&lt;/a&gt; in this blog in advance.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Brief Jython:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Let&#39;s brief Jython Script for monkeyrunner below before we go over next section.&lt;br /&gt;
&lt;br /&gt;
The variable for Jython language, it can&amp;nbsp;manipulate&amp;nbsp;several type of variable such as Number, String, and List. The variable in Jython doesn&#39;t need to be declared. All you have to do is to assign to value to it.&lt;br /&gt;
&lt;br /&gt;
Let&#39;s take a look some simple example and description below. You can copy the script to a text file and save &amp;nbsp;it to a file named example.py (file name can be any valid file name in your system). Open a cmd window and type monkeyrunner.bat example.py and press enter key on your computer.&lt;br /&gt;
&lt;u&gt;&lt;br /&gt;&lt;/u&gt;
&lt;u&gt;&lt;i&gt;Assign a number to a variable.&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
num = 1&lt;br /&gt;
&lt;u&gt;&lt;i&gt;Assign a string to a variable.&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
str = &quot;Hello&quot;&lt;br /&gt;
str = &#39;Hello2&#39;&lt;br /&gt;
&lt;u&gt;&lt;i&gt;Assign a list to a variable.&lt;/i&gt;&lt;/u&gt;&lt;br /&gt;
list = [&#39;mail&#39;,&#39;inbox&#39;,100,200]&lt;br /&gt;
&lt;br /&gt;
The logic statement and loop control are described as follows,&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;The if statement in Jython is as follows,&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;if_stmt ::= &amp;nbsp;&quot;if&quot; expression &quot;:&quot; suite&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;( &quot;elif&quot; expression &quot;:&quot; suite )*&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;[&quot;else&quot; &quot;:&quot; suite]&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Ex:&lt;/i&gt;&lt;br /&gt;
if num &amp;lt; 0:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;num = 0&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;Negative changed to zero&#39;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;elif num == 0:&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;Zero&#39;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;elif num == 1:&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;Single&#39;)&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp;else:&lt;br /&gt;
&amp;nbsp; &amp;nbsp;&amp;nbsp; &amp;nbsp; &amp;nbsp; print(&#39;More&#39;)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;The while statement in Jython is as follows,&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;while_stmt ::= &amp;nbsp;&quot;while&quot; expression &quot;:&quot; suite&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [&quot;else&quot; &quot;:&quot; suite]&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Ex:&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
num = 100&lt;br /&gt;
go = True&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;while go:&lt;/i&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; getNum = int(raw_input(&#39;Input a number : &#39;))&lt;br /&gt;
&amp;nbsp; &amp;nbsp; if&amp;nbsp;getNum&amp;nbsp;== num:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &#39;That is right.&#39;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; go = False&lt;br /&gt;
&amp;nbsp; &amp;nbsp; else:&lt;br /&gt;
&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print &#39;Oh No~&#39;&lt;br /&gt;
&lt;i&gt;else:&lt;/i&gt;&lt;br /&gt;
&amp;nbsp; &amp;nbsp; print &#39;Game over.&#39;&lt;br /&gt;
print &#39;Done&#39;&lt;br /&gt;
&lt;div style=&quot;font-style: italic;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-style: italic;&quot;&gt;
&lt;/div&gt;
&lt;i&gt;The for statement in Jython is as follows,&lt;/i&gt;&lt;br /&gt;
&lt;div&gt;
&lt;i&gt;for_stmt ::= &amp;nbsp;&quot;for&quot; target_list &quot;in&quot; expression_list &quot;:&quot; suite&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;
&lt;/i&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; [&quot;else&quot; &quot;:&quot; suite]&lt;/i&gt;&lt;/div&gt;
&lt;i&gt;
&lt;/i&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div style=&quot;font-style: italic;&quot;&gt;
Ex:&lt;/div&gt;
&lt;br /&gt;
for i in range(9):&lt;br /&gt;
&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt; &lt;/span&gt;print(i)&lt;br /&gt;
else:&lt;br /&gt;
&amp;nbsp;print &#39;done&#39;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;A simple example:&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
First, you need to bring up a cmd window on windows operation system and attach your Android device to computer and check if the computer can detect you ADB interface of Android powered device.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6SgZyirUIjBPEBtyDIUizWitKwnzQEpswUP_qKqdCJAfNJtbR4eMozqqrs9Gfvs7qJxF2SxKODrIthy2nhBsx6puxIOza7H1z8ZVPfFwUYY0CwF1qz9KFSgi3Hlfsqktp-AP0KACmlfI/s1600/adb_devices2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6SgZyirUIjBPEBtyDIUizWitKwnzQEpswUP_qKqdCJAfNJtbR4eMozqqrs9Gfvs7qJxF2SxKODrIthy2nhBsx6puxIOza7H1z8ZVPfFwUYY0CwF1qz9KFSgi3Hlfsqktp-AP0KACmlfI/s1600/adb_devices2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
In this example we want to verify the result of run-time image and make decision for next action. At this case, we need to add logic statement in monkeyrunner. The logic script refers Jython Script. However we can refer to Python script tutorial for writing statement because Jython uses the same script with Python. Note, not all the Python script and components/class you can use on monkeyrunner. However you can try to use it.&lt;br /&gt;
&lt;br /&gt;
Following example shows you how to turn on Bluetooth radio on your Android device and check the UI (user interface) if Radio icon has set to Bluetooth On. And turn off Bluetooth radio. The goal is to perform turn on and off Bluetooth Radio repeatedly and check the result by UI.&lt;br /&gt;
&lt;br /&gt;
In this case we need to use a method of&amp;nbsp;MonkeyRunner class&amp;nbsp;that official web site doesn&#39;t mention. That&#39;s a API -&amp;nbsp;&lt;span style=&quot;color: blue;&quot;&gt;MonkeyRunner.loadImageFromFile(Full_File_Path)&lt;/span&gt;;&lt;br /&gt;
&lt;span style=&quot;color: blue;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
In order to compare the screenshot for the testing result, we need to get a screenshot for pass criteria. We can use MonkeyRunner to get the screenshot by Jython script. The piece of script is as follows.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;result = device1.takeSnapshot()&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;result.getSubImage ((133,85,85,28))&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;result.writeToFile(&#39;./capture1.png&#39;,&#39;PNG&#39;)&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
The screenshot of Bluetooth On below was captured at settings/wireless screen on Android device and ran the above script. Note, the screen resolution is 240x432 and OS version is 4.1 in emulator.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLndKD6ScyLCSVj4abf4VJC3EPHBg_Xy37myj-sR-voJjCXVcNOYOMo2chEcsO3HduaZG8SsM_Bxv3LtumH6w1IGoF-VghZdNkzJpCQca8E2DNX_w4AqcjPTEOcksYqtS3VESFvWjKz7E/s1600/capture1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhLndKD6ScyLCSVj4abf4VJC3EPHBg_Xy37myj-sR-voJjCXVcNOYOMo2chEcsO3HduaZG8SsM_Bxv3LtumH6w1IGoF-VghZdNkzJpCQca8E2DNX_w4AqcjPTEOcksYqtS3VESFvWjKz7E/s1600/capture1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
capture1.png&lt;/div&gt;
&lt;i&gt;Ex:&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;from com.android.monkeyrunner import MonkeyRunner, MonkeyDevice, MonkeyImage&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Import class of MonkeyRunner, MonkeyDevice, and MonkeyImage.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;device1 = MonkeyRunner.waitForConnection(10000,&quot;emulator-5554&quot;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;print &#39;connected&#39;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Connect Android device from computer and assign handler to variable -device1.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;monkeyimage1 = MonkeyRunner.loadImageFromFile(&#39;./capture1.png&#39;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;print &#39;capture1.png loaded&#39;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Load a existing image file by load image API and assign handler to variable - monkeyimage1;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;device1.press(&#39;KEYCODE_HOME&#39;,&#39;DOWN_AND_UP&#39;,&#39; &#39;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;print &#39;home key are triggered&#39;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Send home key event to bring up Launcher&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;MonkeyRunner.sleep(3);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Wait for reaction of Android device&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;device1.press(&#39;KEYCODE_MENU&#39;,&#39;DOWN_AND_UP&#39;,&#39; &#39;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Send menu key event&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;MonkeyRunner.sleep(3);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Wait for reaction of Android device&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;device1.touch ( 95, 417, &quot;DOWN_AND_UP&quot;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Touch system settings in menu list&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;MonkeyRunner.sleep(3);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;#Wait for reaction of Android device&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;for i in range(1000):&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;device1.touch ( 197, 96, &quot;DOWN_AND_UP&quot;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;#Touch bluetooth On&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;MonkeyRunner.sleep(2);&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;monkeyimage2 = device1.takeSnapshot()&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;#Take a screenshot on Android device and assign handler to variable monkeyimage2&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;monkeyimage2 = monkeyimage2.getSubImage ((133,85,85,28))&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;#Get specified rectangle from screenshot got by last step for the result we want to check and assign&amp;nbsp;&lt;/i&gt;&lt;i&gt;handler to variable monkeyimage2 again.&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;if monkeyimage2.sameAs ( monkeyimage1, 1 ):&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; print str(i+1)+&#39;:pass&#39;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;else:&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; print str(i+1)+&#39;:fail&#39;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;#Compare the result if both images of pre-loaded and run-time screenshot are the same.&amp;nbsp;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;device1.touch ( 155, 95, &quot;DOWN_AND_UP&quot;)&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;#Touch bluetooth Off&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;else:&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&amp;nbsp; &amp;nbsp;print &#39;done&#39;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;b&gt;Reference:&lt;/b&gt;&lt;/div&gt;
Python Script Language Tutorial,&amp;nbsp;&lt;a href=&quot;http://docs.python.org/tutorial/&quot;&gt;http://docs.python.org/tutorial/&lt;/a&gt;&lt;br /&gt;
Jython Script Lanuage Tutorial,&amp;nbsp;&lt;a href=&quot;http://www.jython.org/docs/index.html&quot;&gt;http://www.jython.org/docs/index.html&lt;/a&gt;&lt;br /&gt;
MonkeyRunner, &lt;a href=&quot;http://developer.android.com/tools/help/monkeyrunner_concepts.html&quot;&gt;http://developer.android.com/tools/help/monkeyrunner_concepts.html&lt;/a&gt;&lt;br /&gt;
Android KeyCode,&amp;nbsp;&lt;a href=&quot;http://developer.android.com/reference/android/view/KeyEvent.html&quot;&gt;http://developer.android.com/reference/android/view/KeyEvent.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/212283245534008613/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-monkeyrunner-with-jythan.html#comment-form' title='25 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/212283245534008613'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/212283245534008613'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-monkeyrunner-with-jythan.html' title='Android MonkeyRunner with Jythan - A simple example to get start'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6SgZyirUIjBPEBtyDIUizWitKwnzQEpswUP_qKqdCJAfNJtbR4eMozqqrs9Gfvs7qJxF2SxKODrIthy2nhBsx6puxIOza7H1z8ZVPfFwUYY0CwF1qz9KFSgi3Hlfsqktp-AP0KACmlfI/s72-c/adb_devices2.jpg" height="72" width="72"/><thr:total>25</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-542048531750881558</id><published>2012-10-10T23:47:00.001-07:00</published><updated>2013-04-23T00:42:58.376-07:00</updated><title type='text'>Android Automation Test by Monkeyrunner</title><content type='html'>&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-monkeyrunner.html&quot; target=&quot;_blank&quot;&gt;中文版&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;Preface&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There&#39;re a lot of brand company used Android as their product operation system around the world in 2012. Every company add their value added feature and competition into the Android powered device. Since they&#39;ve identical system base, they can be controlled by the same tool. That is monkeyrunner. The powerful tool - monkeyrunner is developed by Google Android team. Utilize the tool, you can save your cost on equipment and quantity of testing resource. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What does monkeyrunner stand for?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
The monkeyrunner provide a set of command to control your Android device. The user can send the control command to Android powered device by computer such as touch screen, key pressed/hold, install/uninstall your App, limited Linux shell script, wake your device, inputing text message, reboot, sliding your screen, and save your device screen to image file on PNG or bitmap format...etc.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Where can we start to play it?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
You need a Android emulator or Android powered device.&lt;br /&gt;
&lt;br /&gt;
Install J2SDK into your computer. Either version 6 or 7 is applicable. Get it from following url in case you don&#39;t have it.&lt;br /&gt;
&lt;a href=&quot;http://www.oracle.com/technetwork/java/javase/downloads/index.html&quot;&gt;http://www.oracle.com/technetwork/java/javase/downloads/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Install Android SDK.&amp;nbsp;Get it from following url in case you don&#39;t have it.&lt;/i&gt;&lt;br /&gt;
&lt;a href=&quot;http://developer.android.com/sdk/index.html&quot;&gt;http://developer.android.com/sdk/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Google provides 3 kind of OS platform forAndroid SDK&lt;/i&gt;&lt;br /&gt;
1. Microsoft Windows&lt;br /&gt;
2. Linux (i386) (Ubuntu is Linux system and the best choice)&lt;br /&gt;
3. Mac OS X (intel)&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Configure you ADB USB Driver&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
I&#39;ll introduce the content by using Microsoft Windows OS. Install your usb and adb interface driver by usb driver provided by Google Android SDK or Brand company&#39;s web site.&lt;br /&gt;
&lt;br /&gt;
In case you are using Unbutu operation system for your Android device, you don&#39;t need a USB driver for ADB Interface.&lt;br /&gt;
&lt;br /&gt;
I&#39;ll suggest add the path of folders of tools and platform-tools in Android SDK into environment variable - path.That&#39;s&amp;nbsp;convenient when you open a command line windows and execute the commands for Android controlled.&lt;br /&gt;
&lt;br /&gt;
Last step is to enable USB debug mode for Android device. Typically, this option is in Settings-&amp;gt;Development-&amp;gt;USB Debug&lt;br /&gt;
&lt;br /&gt;
Finally, Check your computer recognize your Android powered device by command of adb devices as follows. The serial number of Android device is followed by words &quot;device&quot;. That means Android device is connected to your computer and work properly.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEvO5leJTmzBTYNRqTTI-vy_eIzQtYO9PyIA9daRO6APgPJ7NIvbavfpn78QLWVa7Yo_O69TSiwvK6NaxgzMCU0y2rL2IaWqzxSiAhE9jRHQBhbkQw0vs4TUNpC3mNyfMJZsZFJraOF6k/s1600/adb_devices.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEvO5leJTmzBTYNRqTTI-vy_eIzQtYO9PyIA9daRO6APgPJ7NIvbavfpn78QLWVa7Yo_O69TSiwvK6NaxgzMCU0y2rL2IaWqzxSiAhE9jRHQBhbkQw0vs4TUNpC3mNyfMJZsZFJraOF6k/s1600/adb_devices.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
After configuration is done, you can start to use monkeyrunner for controlling your Android powered devices.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Foundamental practice&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
The monkeyrunner command should be sent by computer and use adb connection. Let&#39;s have a basic example as follows.&lt;br /&gt;
&lt;br /&gt;
Open a command window by command cmd at start-&amp;gt;run on your computer and type monkeyrunner.bat.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOAIEIRHc_Azg89nbNEV90pKF2UwKbjpbAcXmUIDhE7UisH7F8_f2KoUbzMuHRXfDiHv03UUfi8Ron6AbMjmwaFAUsaPM3JcE9dEklxeoYnbKgATtZwxdCakqNxpm7plXAO_-MDV5N9_E/s1600/monkeyrunner.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOAIEIRHc_Azg89nbNEV90pKF2UwKbjpbAcXmUIDhE7UisH7F8_f2KoUbzMuHRXfDiHv03UUfi8Ron6AbMjmwaFAUsaPM3JcE9dEklxeoYnbKgATtZwxdCakqNxpm7plXAO_-MDV5N9_E/s1600/monkeyrunner.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
At this moment, your can open another command window to check if your Android device is connected to computer successfully.&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6SgZyirUIjBPEBtyDIUizWitKwnzQEpswUP_qKqdCJAfNJtbR4eMozqqrs9Gfvs7qJxF2SxKODrIthy2nhBsx6puxIOza7H1z8ZVPfFwUYY0CwF1qz9KFSgi3Hlfsqktp-AP0KACmlfI/s1600/adb_devices2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6SgZyirUIjBPEBtyDIUizWitKwnzQEpswUP_qKqdCJAfNJtbR4eMozqqrs9Gfvs7qJxF2SxKODrIthy2nhBsx6puxIOza7H1z8ZVPfFwUYY0CwF1qz9KFSgi3Hlfsqktp-AP0KACmlfI/s1600/adb_devices2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: start;&quot;&gt;
Type the following script to your monkeyrunner.bat command window. Note, you need to be careful for case sensitivity. The&amp;nbsp;words can be different in meaning based on different use of uppercase and lowercase letters.&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6EXMeiGqMhV3Amb2-_2TMQOv29lgIK87pkHfsrE9HBwlsXocsc80PQTaBokqAZ0EKaccLschzcpzqxmz75fkiGk7cIYzf58IRKTlV_r6jtUsU2NWu3NrhDU0rkWiMIUvq9jyYH_DVIiA/s1600/monkeyrunner-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6EXMeiGqMhV3Amb2-_2TMQOv29lgIK87pkHfsrE9HBwlsXocsc80PQTaBokqAZ0EKaccLschzcpzqxmz75fkiGk7cIYzf58IRKTlV_r6jtUsU2NWu3NrhDU0rkWiMIUvq9jyYH_DVIiA/s1600/monkeyrunner-1.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
First line, the command of &quot;from com.android.monkeyrunner import ...&quot; is to loaded relative API from monkeyrunner.&lt;br /&gt;
Second line, assign the handler of Android device to variable - device.&lt;br /&gt;
Third line, send the menu key event to Android device.&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUuzhPJPbFIiLsrBSDH8JBVX-fNuk-Yg-4VkVU7qrijAkHEplMlpo0bMiBAdC87qQMOPOT1pf4DYHx-7ZhFsUBdp602F7qEt25AYAr-ChnOZhghhRChzVyHUB8cWPCEklKg3cNd5p1Jrc/s1600/emulator-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;293&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUuzhPJPbFIiLsrBSDH8JBVX-fNuk-Yg-4VkVU7qrijAkHEplMlpo0bMiBAdC87qQMOPOT1pf4DYHx-7ZhFsUBdp602F7qEt25AYAr-ChnOZhghhRChzVyHUB8cWPCEklKg3cNd5p1Jrc/s320/emulator-1.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
Before sending press command.&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGWwEVrOHzsLbQT0aex5L6trmw4-CVx8ujFjl18P_tJ0bKofvnbx_doT0RtY1WHgnADbYtfL9u8LlRoSF-GwB9acjrlG2skslK6Yq8DPw5slU4eHvwRnFZgT2AIAUoTXcd9AAr8A3jXBo/s1600/emulator-2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;294&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGWwEVrOHzsLbQT0aex5L6trmw4-CVx8ujFjl18P_tJ0bKofvnbx_doT0RtY1WHgnADbYtfL9u8LlRoSF-GwB9acjrlG2skslK6Yq8DPw5slU4eHvwRnFZgT2AIAUoTXcd9AAr8A3jXBo/s320/emulator-2.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
After sending press command.&lt;/div&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;More benefit for you by monkeyrunner&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Take a look on official Android development web site, monkeyrunner can help you to perform multiple Android device control, functional test, regression test, and extended automation. To be clear, monkeyrunner can help you to do the repeated operation or test and mitigate your requirement on human resource.&lt;br /&gt;
&lt;br /&gt;
As we&#39;ve talk about the benefit aforementioned, monkeyrunner can help you to touch screen, slide screen, monitor the variation of screen...etc. You can utilize monkeyrunner to record the scenario of specified operations and playback them for your testing purpose on Android powered device.&lt;br /&gt;
&lt;br /&gt;
The monkeyrunner can help you to do the test over day and night without any complain. The tool is very &amp;nbsp;helpful for the product to meet the&amp;nbsp;schedule of&amp;nbsp;Time To Market.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Advanced practice&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Let&#39;s have a example with more scenario for using monkeyrunner below. I&#39;d like to introduce a test for Bluetooth on/off.&lt;br /&gt;
&lt;br /&gt;
Let your Android powered device go into Launcher in advance and run the following script.&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 448px;&quot;&gt;
 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 1280; mso-width-source: userset; width: 30pt;&quot; width=&quot;40&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 13056; mso-width-source: userset; width: 306pt;&quot; width=&quot;408&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl70&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(79, 129, 189); border-bottom-width: 0.5pt; border-left-color: rgb(64, 64, 64); border-left-width: 0.5pt; border-style: solid none solid solid; border-top-color: rgb(64, 64, 64); border-top-width: 0.5pt; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none; width: 30pt;&quot; width=&quot;40&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl71&quot; style=&quot;background-color: #dce6f1; border-bottom-color: rgb(79, 129, 189); border-bottom-width: 0.5pt; border-right-color: rgb(64, 64, 64); border-right-width: 0.5pt; border-style: solid solid solid none; border-top-color: rgb(64, 64, 64); border-top-width: 0.5pt; font-family: 新細明體; font-size: 12pt; text-underline-style: none; width: 306pt;&quot; width=&quot;408&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;monkeyrunner script&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot;&gt;device1.press(&#39;KEYCODE_MENU&#39;,&#39;DOWN_AND_UP&#39;,&#39; &#39;)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-top: none;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;Send menu key event, as figure-m2&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-top: none;&quot;&gt;device1.touch ( 95, 417,
  &quot;DOWN_AND_UP&quot;)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-top: none;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;Touch settings in menu list&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;, as figure-&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;m-3&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-top: none;&quot;&gt;device1.touch ( 197, 96,
  &quot;DOWN_AND_UP&quot;)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-top: none;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;Touch bluetooth On&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;, as figure-&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;m-4&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-top: none;&quot;&gt;device1.touch ( 155, 95,
  &quot;DOWN_AND_UP&quot;)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl69&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-top: none;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;Touch bluetooth Off&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;, as figure-&lt;/span&gt;&lt;span style=&quot;color: #666666;&quot;&gt;m-5&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxFqmn6BIxa7eXounaq-LfSJtI9oG-RAr8z3IdJ01BDEF6m7JPJvSZWWNT0gJ1nuV_MUmpZ7tRXjYzDE4suqbioNb3OQ_VVi-e9_lFi3C4ntvZJrNxtGornYjgvE5Jc3Mmk1hsXxGXJr0/s1600/stpe0.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxFqmn6BIxa7eXounaq-LfSJtI9oG-RAr8z3IdJ01BDEF6m7JPJvSZWWNT0gJ1nuV_MUmpZ7tRXjYzDE4suqbioNb3OQ_VVi-e9_lFi3C4ntvZJrNxtGornYjgvE5Jc3Mmk1hsXxGXJr0/s320/stpe0.jpg&quot; width=&quot;181&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&amp;nbsp;figure-m1&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHILk-enYiPzYF_6zWLiuMrgU_WP5pvCQb2rBhzZnL62v_4vQV6dAE-lIoS2Kx7cdYFn0tHkcz4xvZMEemSTBMo9TLbcbW0Hkh4blxwlVUqc7pslMYCyYO-asz9Q5bAKfAaivO3ONeXb4/s1600/stpe1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHILk-enYiPzYF_6zWLiuMrgU_WP5pvCQb2rBhzZnL62v_4vQV6dAE-lIoS2Kx7cdYFn0tHkcz4xvZMEemSTBMo9TLbcbW0Hkh4blxwlVUqc7pslMYCyYO-asz9Q5bAKfAaivO3ONeXb4/s320/stpe1.jpg&quot; width=&quot;183&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&amp;nbsp;figure-m2&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPWg_q605n4qQoLhQBkKRrLLI4JiQLEjMS7zJ6vdzDVlPW6s1-lexrdMZSs45SpQ9ftSClLIelClrvZx4Z9MSYrYwb-spc3W7V2mzNw__SUr6MU9pIISWtGxAHdry3GSjvtDghkZbehIQ/s1600/stpe2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPWg_q605n4qQoLhQBkKRrLLI4JiQLEjMS7zJ6vdzDVlPW6s1-lexrdMZSs45SpQ9ftSClLIelClrvZx4Z9MSYrYwb-spc3W7V2mzNw__SUr6MU9pIISWtGxAHdry3GSjvtDghkZbehIQ/s320/stpe2.jpg&quot; width=&quot;181&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&amp;nbsp;figure-m3&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht_6FHQjtvnHYZEfAgcn7QI6GfhsgqVozTDbpAsY1BhwCNzoKXILExtLtbzpOw3-XlijVTIpGkbttExtM-rNQlT9Lls2coGureM-vjVIgCZQ6MIaNwyfTa1yaQEWIeT8fxZCU2S0y8r0U/s1600/stpe3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht_6FHQjtvnHYZEfAgcn7QI6GfhsgqVozTDbpAsY1BhwCNzoKXILExtLtbzpOw3-XlijVTIpGkbttExtM-rNQlT9Lls2coGureM-vjVIgCZQ6MIaNwyfTa1yaQEWIeT8fxZCU2S0y8r0U/s320/stpe3.jpg&quot; width=&quot;182&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&amp;nbsp;figure-m4&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1fFgucj6TDyRjNubPyslvH7u5j-5yibdf_dKdzsoKIaDY_j2eCNjLmvHiRG1OKLxWtJPkGSXrkQJYjt63h6jW8VQgV6FIZh3YsUhK8EnfOgRjW76egYJ5XRyhOpdtGy8kBdlePHSII-Y/s1600/stpe4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1fFgucj6TDyRjNubPyslvH7u5j-5yibdf_dKdzsoKIaDY_j2eCNjLmvHiRG1OKLxWtJPkGSXrkQJYjt63h6jW8VQgV6FIZh3YsUhK8EnfOgRjW76egYJ5XRyhOpdtGy8kBdlePHSII-Y/s320/stpe4.jpg&quot; width=&quot;183&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
figure-m5&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
I&#39;ll list more useful examples for monkeyrunner to control Android device. Welcome to visit my blog again for the latest information in the future.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reference&lt;/b&gt;&lt;br /&gt;
monkeyrunner,&amp;nbsp;&lt;a href=&quot;http://developer.android.com/tools/help/monkeyrunner_concepts.html&quot;&gt;http://developer.android.com/tools/help/monkeyrunner_concepts.html&lt;/a&gt;&amp;nbsp;, published by Google Inc.
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/542048531750881558/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-automation-test-by-monkeyrunner.html#comment-form' title='15 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/542048531750881558'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/542048531750881558'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-automation-test-by-monkeyrunner.html' title='Android Automation Test by Monkeyrunner'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEvO5leJTmzBTYNRqTTI-vy_eIzQtYO9PyIA9daRO6APgPJ7NIvbavfpn78QLWVa7Yo_O69TSiwvK6NaxgzMCU0y2rL2IaWqzxSiAhE9jRHQBhbkQw0vs4TUNpC3mNyfMJZsZFJraOF6k/s72-c/adb_devices.jpg" height="72" width="72"/><thr:total>15</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-6423000081606502833</id><published>2012-10-10T20:21:00.003-07:00</published><updated>2013-04-23T00:43:31.524-07:00</updated><title type='text'>Android Automation Test for Stability by Monkey</title><content type='html'>&lt;b&gt;&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-monkey-automation-test.html&quot; target=&quot;_blank&quot;&gt;中文版&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;Preface&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There&#39;s a Monkey existed in Android OS. Android device would do the things randomly once you launch the Monkey program in Android device.&lt;br /&gt;
&lt;br /&gt;
Typically, we used Monkey to do the stability test against Android device. Although it&#39;s not predictable for running action by Monkey program, we still can limit some actions for Monkey program under particular&amp;nbsp;condition(s). Let&#39;s look how Monkey benefit the quality of Android device. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;What does Money stand for?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
There&#39;are two kind of Monkey program in Android. However they&#39;re totally different for the purpose. They&#39;re monkeyrunner and Money program. For the former one, Android device can be controlled by pre-defined scenario/action. For the poster one, it generates random events for Android device.&lt;br /&gt;
By different purpose, we often used monkeyrunner to do the functional test and used Monkey to do the stability test against Android device.&lt;br /&gt;
I&#39;ve a separate page to talk about monkeyrunner. We are going to talk about the Monkey here.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Why do we use monkey to test our product?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
It&#39;s hardly to predict each user how to use their Android device. Hence, utilize a good tool to help our work is a important matter. A good qualified product should be not lockup or&amp;nbsp;reboot&amp;nbsp;occurred even the device is operated by arbitrary operations. This is the reason why we used Monkey to help find the quality issue early. &lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;How to use Monkey program?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
Monkey is existed in Android devices. When you want to launch Monkey program, you need to use shell command by ADB tool on computer.&lt;br /&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
&lt;div style=&quot;background-color: #f7f7f7; border: 2px rgb(210, 210, 210);&quot;&gt;
adb shell monkey -v 500&lt;event -count=&quot;-count&quot;&gt;&lt;/event&gt;&lt;/div&gt;
&lt;br /&gt;
The&amp;nbsp;above&amp;nbsp;command &amp;nbsp;shows you an example that monkey would generate 500 events randomly against Android.&lt;br /&gt;
&lt;br /&gt;
Here are the options you can use for Monkey program and announce on official Android Dev Site.&lt;br /&gt;
&lt;table style=&quot;background-color: #f7f7f7; border-collapse: collapse; border-spacing: 0px; border: 0px; color: #222222; font-family: Roboto, sans-serif; font-size: 13.63636302947998px; line-height: 18.984848022460938px; margin: 0.5em 1em 1em 0px; text-align: start; width: 759.0908813476563px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th style=&quot;background-color: #999999; border: 1px solid rgb(221, 221, 221); color: white; font-weight: normal; padding: 4px 12px; vertical-align: top;&quot;&gt;Category&lt;/th&gt;&lt;th style=&quot;background-color: #999999; border: 1px solid rgb(221, 221, 221); color: white; font-weight: normal; padding: 4px 12px; vertical-align: top;&quot;&gt;Option&lt;/th&gt;&lt;th style=&quot;background-color: #999999; border: 1px solid rgb(221, 221, 221); color: white; font-weight: normal; padding: 4px 12px; vertical-align: top;&quot;&gt;Description&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td rowspan=&quot;2&quot; style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;General&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--help&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Prints a simple usage guide.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;-v&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Each -v on the command line will increment the verbosity level. Level 0 (the default) provides little information beyond startup notification, test completion, and final results. Level 1 provides more details about the test as it runs, such as individual events being sent to your activities. Level 2 provides more detailed setup information such as activities selected or not selected for testing.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td rowspan=&quot;10&quot; style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Events&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;-s &lt;seed&gt;&lt;/seed&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Seed value for pseudo-random number generator. If you re-run the Monkey with the same seed value, it will generate the same sequence of events.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--throttle &lt;milliseconds&gt;&lt;/milliseconds&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Inserts a fixed delay between events. You can use this option to slow down the Monkey. If not specified, there is no delay and the events are generated as rapidly as possible.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-touch &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Adjust percentage of touch events. (Touch events are a down-up event in a single place on the screen.)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-motion &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Adjust percentage of motion events. (Motion events consist of a down event somewhere on the screen, a series of pseudo-random movements, and an up event.)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-trackball &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Adjust percentage of trackball events. (Trackball events consist of one or more random movements, sometimes followed by a click.)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-nav &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Adjust percentage of &quot;basic&quot; navigation events. (Navigation events consist of up/down/left/right, as input from a directional input device.)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-majornav &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Adjust percentage of &quot;major&quot; navigation events. (These are navigation events that will typically cause actions within your UI, such as the center button in a 5-way pad, the back key, or the menu key.)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-syskeys &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Adjust percentage of &quot;system&quot; key events. (These are keys that are generally reserved for use by the system, such as Home, Back, Start Call, End Call, or Volume controls.)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-appswitch &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Adjust percentage of activity launches. At random intervals, the Monkey will issue a startActivity() call, as a way of maximizing coverage of all activities within your package.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-anyevent &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Adjust percentage of other types of events. This is a catch-all for all other types of events such as keypresses, other less-used buttons on the device, and so forth.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td rowspan=&quot;2&quot; style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Constraints&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;-p &lt;allowed -package-name=&quot;-package-name&quot;&gt;&lt;/allowed&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;If you specify one or more packages this way, the Monkey will&amp;nbsp;&lt;i&gt;only&lt;/i&gt;&amp;nbsp;allow the system to visit activities within those packages. If your application requires access to activities in other packages (e.g. to select a contact) you&#39;ll need to specify those packages as well. If you don&#39;t specify any packages, the Monkey will allow the system to launch activities in all packages. To specify multiple packages, use the -p option multiple times — one -p option per package.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;-c &lt;main -category=&quot;-category&quot;&gt;&lt;/main&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;If you specify one or more categories this way, the Monkey will&amp;nbsp;&lt;i&gt;only&lt;/i&gt;&amp;nbsp;allow the system to visit activities that are listed with one of the specified categories. If you don&#39;t specify any categories, the Monkey will select activities listed with the category Intent.CATEGORY_LAUNCHER or Intent.CATEGORY_MONKEY. To specify multiple categories, use the -c option multiple times — one -c option per category.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td rowspan=&quot;8&quot; style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Debugging&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--dbg-no-events&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;When specified, the Monkey will perform the initial launch into a test activity, but will not generate any further events. For best results, combine with -v, one or more package constraints, and a non-zero throttle to keep the Monkey running for 30 seconds or more. This provides an environment in which you can monitor package transitions invoked by your application.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--hprof&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;If set, this option will generate profiling reports immediately before and after the Monkey event sequence. This will generate large (~5Mb) files in data/misc, so use with care. See&amp;nbsp;&lt;a href=&quot;http://developer.android.com/tools/debugging/debugging-tracing.html&quot; style=&quot;color: #258aaf; text-decoration: none;&quot; title=&quot;traceview&quot;&gt;Traceview&lt;/a&gt;&amp;nbsp;for more information on trace files.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--ignore-crashes&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Normally, the Monkey will stop when the application crashes or experiences any type of unhandled exception. If you specify this option, the Monkey will continue to send events to the system, until the count is completed.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--ignore-timeouts&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Normally, the Monkey will stop when the application experiences any type of timeout error such as a &quot;Application Not Responding&quot; dialog. If you specify this option, the Monkey will continue to send events to the system, until the count is completed.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--ignore-security-exceptions&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Normally, the Monkey will stop when the application experiences any type of permissions error, for example if it attempts to launch an activity that requires certain permissions. If you specify this option, the Monkey will continue to send events to the system, until the count is completed.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--kill-process-after-error&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Normally, when the Monkey stops due to an error, the application that failed will be left running. When this option is set, it will signal the system to stop the process in which the error occurred. Note, under a normal (successful) completion, the launched process(es) are not stopped, and the device is simply left in the last state after the final event.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--monitor-native-crashes&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Watches for and reports crashes occurring in the Android system native code. If --kill-process-after-error is set, the system will stop.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--wait-dbg&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Stops the Monkey from executing until a debugger is attached to it.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
ex:&lt;br /&gt;
adb shell &quot;monkey -s 1 --throttle 100 -v -v -v --ignore-crashes --ignore-timeouts --ignore-security-exceptions 99999999&quot;&lt;br /&gt;
&lt;br /&gt;
In this case, we expect to see if any operation would cause the system reboot or lockup and ignore the factors that would cause the Monkey program stopped. Take a look on the description&amp;nbsp;aforementioned&amp;nbsp;for the condition that command used in this example.&lt;br /&gt;
&lt;br /&gt;
There&#39;re two options we cannot see the description on official web site. However they can be found on help description when you send the command adb shell monkey to Android device. Let&#39;s take a look on them below.&lt;br /&gt;
&lt;br /&gt;
&lt;table style=&quot;background-color: #f7f7f7; border-collapse: collapse; border-spacing: 0px; border: 0px; color: #222222; font-family: Roboto, sans-serif; font-size: 13.63636302947998px; line-height: 18.984848022460938px; margin: 0.5em 1em 1em 0px; text-align: start; width: 759.0908813476563px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td rowspan=&quot;2&quot; style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Constraints&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: small; line-height: normal;&quot;&gt;--pkg-blacklist-file&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Set a blacklist for the package that are not going to do the test by Monkey. This option are followed by a text file. The text file contain a list of packages. Note, each package can only be listed on one line.&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: small; line-height: normal;&quot;&gt;--pkg-whitelist-file&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;Set a whitelist for the package that are going to do the test by Monkey. The random event would only be generated by specified package name in whiltelist. This option are followed by a text file. The text file contain a list of packages. Note, each package can only be listed on one line.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
Ex:&lt;br /&gt;
adb shell &quot;monkey -v --&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;pkg-blacklist-file&amp;nbsp;&lt;/span&gt;/data/local/tmp/&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;blacklist.txt 500&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;The content of blacklist.txt is as follows,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;com.google.android.apps.maps&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;com.android.launcher&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;In this case, Monkey would not do anything for Google Map and Launcher. It&#39;s also a special case because we set Launcher in blacklist. You may only see the lock screen and unknow what the Monkey is doing. You can check logcat log to see if any action that Monkey does. If you remove the com.android.launcher from blacklist.txt, the Monkey would not do the things for Google Map only.&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Reference&lt;/b&gt;&lt;br /&gt;
UI/Application Exerciser Monkey,&amp;nbsp;&lt;a href=&quot;http://developer.android.com/tools/help/monkey.html&quot;&gt;http://developer.android.com/tools/help/monkey.html&lt;/a&gt;
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/6423000081606502833/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/preface-theres-monkey-existed-in.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/6423000081606502833'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/6423000081606502833'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/preface-theres-monkey-existed-in.html' title='Android Automation Test for Stability by Monkey'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-6227461983994324322</id><published>2012-10-09T02:48:00.002-07:00</published><updated>2012-10-23T01:47:12.837-07:00</updated><title type='text'>Android Automation Test for Stability by Monkey 中文版</title><content type='html'>&lt;b&gt;&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/preface-theres-monkey-existed-in.html&quot; target=&quot;_blank&quot;&gt;English Version&lt;/a&gt;&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;序&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
在Android的作業系統中，有一隻猴子 (Monkey) 的程式。這個程式啟動後就會讓你的Android裝置像猴子一樣的活蹦亂跳，到處亂跑。&lt;br /&gt;
&lt;br /&gt;
這樣的猴子特性剛好可以讓我們來對Android裝置做穩定性測試。事實上，這個猴子程式亂跑的範圍 (Scope) 與活力 (Interval) 及方向 (Event) 還是可以被規範的．以下讓我們來看看如何駕馭這隻猴子程式，讓這個猴子來幫助我們的產品開發。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;猴子程式是甚麼 ?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
在Android的官方自動化測試領域有兩隻猴子，一個稱做猴子跑步 (&lt;a href=&quot;http://android-test-tw.blogspot.tw/2012/10/android-monkeyrunner.html&quot; rel=&quot;nofollow&quot; target=&quot;_blank&quot;&gt;monkeyrunner&lt;/a&gt;)，另一個就是我們在這要談的猴子 (Monkey)。這兩者的區別是，前者可以精準的控制Android裝置的行為。後者是藉由亂數產生的事件來對Android裝置做隨意且不可預期的操作。在目的上，monkeyrunner能用來做功能性驗證，與指定行為的穩定度測試。不同於monkeyrunner，Monkey可用於隨意的大量性操作來測試Android手機的整個性統或是指定應用程式(App)的穩定度。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;為什麼用猴子來測試我們的產品 ?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
每當我們完成一個產品，我們很希望能快點分享出去。但面對千千萬萬的使用者，無法了解每個人的操作習慣。在許多年輕的工程師，累積除錯的經驗尚未成熟前，又面臨產品計畫的時間壓力，常會忽略一些小細節。又或者是一個協同開發的大型複雜專案，整合管理出現漏洞時，但沒有人發現。這時候利用猴子程式來幫忙抓出可能性的錯誤是一個挺有效率的方式。&lt;br /&gt;
&lt;br /&gt;
一個好品質的應用程式 (App)或是產品 (Android 裝置)即使在&lt;span style=&quot;color: red;&quot;&gt;隨便亂操作&lt;/span&gt;的情況下，應該要能做出所有的防錯處理。程式崩潰 (Crash) 或是當機 (Lock up or Reboot)不應該出現。基於這樣的理由，使用monkey能讓我們所開發的產品能快速的讓潛在的問題浮現。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;如何駕馭猴子(Monkey)程式&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
Monkey內存在Android裝置內，因此我們要使用猴子程式，可以透過ADB的方式對手機下Shell程式的指令。&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;background-color: #f7f7f7; border: 2px rgb(210, 210, 210);&quot;&gt;
adb shell monkey -v 500&lt;event -count=&quot;-count&quot;&gt;&lt;/event&gt;&lt;/div&gt;
&lt;br /&gt;
以上這個指令會對Android裝置下達500個連續指令做隨意的操作。&lt;br /&gt;
&lt;br /&gt;
以下表格說明使用參數去規範Monkey:&lt;br /&gt;
&lt;br /&gt;
&lt;table style=&quot;background-color: #f7f7f7; border-collapse: collapse; border-spacing: 0px; border: 0px; color: #222222; font-family: Roboto, sans-serif; font-size: 13.63636302947998px; line-height: 18.984848022460938px; margin: 0.5em 1em 1em 0px; text-align: start; width: 759.0908813476563px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;th style=&quot;background-color: #999999; border: 1px solid rgb(221, 221, 221); color: white; font-weight: normal; padding: 4px 12px; vertical-align: top;&quot;&gt;類別&lt;/th&gt;&lt;th style=&quot;background-color: #999999; border: 1px solid rgb(221, 221, 221); color: white; font-weight: normal; padding: 4px 12px; vertical-align: top;&quot;&gt;參數選項&lt;/th&gt;&lt;th style=&quot;background-color: #999999; border: 1px solid rgb(221, 221, 221); color: white; font-weight: normal; padding: 4px 12px; vertical-align: top;&quot;&gt;說明&lt;/th&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td rowspan=&quot;2&quot; style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;一般&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--help&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;顯示Monkey的相關用法。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;-v&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;每一個 -v 的參數在adb shell monkey之後，會增加&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;執行中&lt;/span&gt;的&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;資訊。&lt;/span&gt;&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;&lt;br /&gt;&lt;/span&gt;只有一個-v的Monkey執行會提供少量的資訊。若有兩個-v (E.g. adb shell monkey -v -v)，執行中會堤供較多的訊息，諸如獨自被傳送到你的App (Activity)的事件. 若有三個 -v ，執行中會提供更多像是設定的資訊等的訊息。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td rowspan=&quot;10&quot; style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;事件&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;-s &lt;seed&gt;&lt;/seed&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;亂數種子。用來產生亂數事件使用。若使用相同的亂數來執行monkey測試，他會產生相同的程序的事件。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--throttle &lt;milliseconds&gt;&lt;/milliseconds&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;在每個事件執行後與下個事件產生的間隔時間。若不設定，每個事件無間隔時間。這個設定可用來緩和測試以避免系統硬體的效能不佳時，排除硬體效能因素所產生的問題。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-touch &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;調整觸碰事件產生的發生率&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;百分比。(觸碰事件是一個按壓下去與放開於螢幕同一個點的事件)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-motion &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;調整移動的事件觸發發生率&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;百分比。(這個事件是由一個點按壓下螢幕中的一個點並隨意滑動到另外一個座標位置再放開的事件)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-trackball &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;調整軌跡球觸發事件。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-nav &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;調整基本方向按鍵事件的發生率百分比。(方向事件包含上下左右)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-majornav &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;調整主要的方向按鍵事件的發生百分比。(這些方向的事件一般都是在你的使用者介面有影響，例如五個方向按鍵、返回按鍵(Back)、或是選單按鍵等(Menu)&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-syskeys &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;調整系統按鍵觸發事件的發生率百分比。(例如家按鍵(Home、返回按鍵(Back)、發話按鍵(Start Call),斷話鍵(End Call), 或是聲音鍵(Volumn up/down)&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;)&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-appswitch &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;調整App (Activity)啟動的發生率百分比。(Monkey會透過startActivity()這個API呼叫Activity做為最大化測試涵蓋率到你要測試的包裝(package)的方法)&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--pct-anyevent &lt;percent&gt;&lt;/percent&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;調整其他型態的類別事件發生率的百分比。這是一個可以抓住所有其他型態的如按鍵壓下的事件，其他比較少使用在裝置上的事件等。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td rowspan=&quot;2&quot; style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;限制&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;-p &lt;allowed -package-name=&quot;-package-name&quot;&gt;&lt;/allowed&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;限制monkey只測試指定的Packages. 若你要測試的Package會與其他的Package有關連，你必須一起指定這些Package來執行這項參數．若你無使用這個參數，Monkey會測試系統內所有的Package。要指定多個Package必須下達多個 -p，每個 -p 後面只能放一個Package。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;-c &lt;main -category=&quot;-category&quot;&gt;&lt;/main&gt;&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;若你指定一個或多個分類(categories&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;)，Monkey將會只允許系統去探訪你所指定的分類的活動 ( Activity )。若你沒有指定分類，monkey會選取所有列在分類為&amp;nbsp;&lt;/span&gt;Intent.CATEGORY_LAUNCHER 或&amp;nbsp;Intent.CATEGORY_MONKEY&amp;nbsp;&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;的活動( activities )。指定多個分類要多次使用 -c 參數，每一個參數只能指定一個分類。&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td rowspan=&quot;8&quot; style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;除錯&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--dbg-no-events&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;當指定這個參數，Monkey將操作測試活動 ( activity ) 初始化執行，但將不會產生任何進一步的事件。最佳的結果是與 -v 參數結合使用一個或多個包裝( Package )的限制與一個非零值的&amp;nbsp;throttle&amp;nbsp;參數以保持Monkey持續執行超過30秒。這提供一個可以觀察被應用程式呼叫的包裝 ( Package ) 的資訊交換 ( Package ) 的環境&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--hprof&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;若設定了這個參數，將會於Monkey事件程序的前與後立即產生問題發生特徵的報告，這將會產生近5Mb的檔案於Android裝置內的data/misc資料夾。必須小心使用。可查詢&lt;a href=&quot;http://developer.android.com/tools/debugging/debugging-tracing.html&quot; style=&quot;color: #258aaf; text-decoration: none;&quot; title=&quot;traceview&quot;&gt;Traceview&lt;/a&gt;取得更多的資訊。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--ignore-crashes&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;一般來說，當應用程式遭遇到任何類型的應用程式崩潰( Crash )或無法掌控的例外(&amp;nbsp;unhandled exception&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;&amp;nbsp;)問題&lt;/span&gt;，&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;monkey會停下來。這些錯誤像是應用程式無回應&lt;/span&gt;&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;(&amp;nbsp;&lt;/span&gt;&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;Application Not Responding)&lt;/span&gt;&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;的對話框。&lt;/span&gt;&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;若你使用了這個參數，Monkey會持續的傳送事件直到你所設定的參數數量完成。&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--ignore-timeouts&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;一般來說，當應用程式遭遇到任何類型的到期(timeout)問題，&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;monkey會停下來。這些錯誤像是應用程式無回應(&amp;nbsp;Application Not Responding)&lt;/span&gt;&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;的對話框。&lt;/span&gt;&lt;span style=&quot;background-color: inherit; font-size: 13.63636302947998px; line-height: 18.984848022460938px;&quot;&gt;若你使用了這個參數，Monkey會持續的傳送事件直到你所設定的參數數量完成。&lt;/span&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--ignore-security-exceptions&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;一般來說，當應用程式遭遇到任何類型的權限問題monkey會停下來。舉例來說，如果你嘗試去喚起一個需要某些權限的活動( Activity )就會遇到這樣的情形。若你使用了這個參數，Monkey會持續的傳送事件直到你所設定的參數數量完成。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--kill-process-after-error&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;一般來說，當Monkey因為錯誤(Error)停止，應用程式的錯誤會留在畫面上。若這個參數被設定於monkey中，牠會發出信號去停止有問題的程序( Process&amp;nbsp;)。注意，一個正常的或成功的完成，被執行的程序不會被停止，裝置只是簡單的留在最後一個事件發生後的狀態。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--monitor-native-crashes&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;等待並且報告Android系統的native源碼損毀發生。若有設定&amp;nbsp;--kill-process-after-error 參數，系統將會停止monkey測試。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;code style=&quot;color: #006600; font-family: &#39;courier new&#39;, courier, monospace; font-weight: bold; line-height: 1.5;&quot;&gt;--wait-dbg&lt;/code&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;重執行中停止monkey直到除錯器(debugger)連接到裝置。&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
範例：&lt;br /&gt;
&lt;br /&gt;
adb shell &quot;monkey -s 1 --throttle 100 -v -v -v --ignore-crashes --ignore-timeouts --ignore-security-exceptions 99999999&quot;&lt;br /&gt;
在這個例子中，主要是希望能夠發現有甚麼方法會造成手機當機或重新開機的現象。設定為亂數種子為1，每個事件發生的間隔時間為100毫秒，忽略App的損毀 ( Crash )問題，忽略ANR的問題，忽略因為應用程式權限不足導致跳出Monkey的問題，執行99999999個事件。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
在Android官網上還有兩個參數我們看不到說明，以下我對這兩個參數做說明：&lt;br /&gt;
&lt;br /&gt;
&lt;table style=&quot;background-color: #f7f7f7; border-collapse: collapse; border-spacing: 0px; border: 0px; color: #222222; font-family: Roboto, sans-serif; font-size: 13.63636302947998px; line-height: 18.984848022460938px; margin: 0.5em 1em 1em 0px; text-align: start; width: 759.0908813476563px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td rowspan=&quot;2&quot; style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;限制&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: small; line-height: normal;&quot;&gt;--pkg-blacklist-file&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;限制monkey不測試紀錄於文字檔案內的Packages，若你無使用這個參數，Monkey會測試系統內所有的Package。要指定多個Package不被執行必須在文字檔案內紀錄所有不要測試的Packages名稱，文字檔案內每一行只能放一個Package。&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;&lt;span style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: small; line-height: normal;&quot;&gt;--pkg-whitelist-file&lt;/span&gt;&lt;/td&gt;&lt;td style=&quot;background-color: inherit; border: 1px solid rgb(221, 221, 221); padding: 4px 12px; vertical-align: top;&quot;&gt;限制monkey只測試於指向的文字檔案的指定的Packages. 若你要測試的Package會與其他的Package有關連，你必須一起指定這些Package來執行這項參數．若你無使用這個參數，Monkey會測試系統內所有的Package。要指定多個Package必須在文字檔案內紀錄所有要測試的Packages名稱，文字檔案內每一行只能放一個Package。&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
範例：&lt;br /&gt;
adb shell &quot;monkey -v --&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;pkg-blacklist-file&amp;nbsp;&lt;/span&gt;/data/local/tmp/&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;blacklist.txt 500&quot;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;其中blacklist.txt的內容為&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;com.google.android.apps.maps&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;com.android.launcher&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;background-color: #f7f7f7;&quot;&gt;&lt;br /&gt;&lt;/span&gt;
在這個範例中，monkey的執行不會執行Google Map與Launcher。特別的是，因為我們設定Launcher在黑名單中 ( blacklist.txt ) ，畫面有可能會持續停留在上鎖的畫面且持續的進行monkey測試。直到500個事件發生完畢，monkey才會停止。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;參考資料&lt;/b&gt;&lt;br /&gt;
UI/Application Exerciser Monkey,&amp;nbsp;&lt;a href=&quot;http://developer.android.com/tools/help/monkey.html&quot;&gt;http://developer.android.com/tools/help/monkey.html&lt;/a&gt;
&lt;iframe width=&quot;1&quot; height=&quot;1&quot; border=&quot;0&quot; src=&quot;http://carl.comeze.com/visitor.php?fname=android_automation_test_for_stability_by_monkey_Chinese&quot;&gt;&lt;/iframe&gt;</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/6227461983994324322/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-monkey-automation-test.html#comment-form' title='12 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/6227461983994324322'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/6227461983994324322'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-monkey-automation-test.html' title='Android Automation Test for Stability by Monkey 中文版'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>12</thr:total></entry><entry><id>tag:blogger.com,1999:blog-6506852281250910408.post-6601458017521455773</id><published>2012-10-08T02:22:00.001-07:00</published><updated>2013-04-23T00:43:49.154-07:00</updated><title type='text'>Android 自動化操作與測試 - monkeyrunner</title><content type='html'>&lt;a href=&quot;http://android-test-tw.blogspot.com/2012/10/android-automation-test-by-monkeyrunner.html&quot; target=&quot;_blank&quot;&gt;English Version&lt;/a&gt;&lt;br /&gt;
&lt;b&gt;序&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
在2012這個年代，Android大軍已經在各家品牌廠與中國的白牌廠商等硬體廠商遍地開花。各式各樣的品牌，琳瑯滿目。不過在這個一個Android大軍的共同點，大家都是系出同門。來自谷歌大門。因此，我們有幸得以使用相同的開發或控制資源於不同廠牌的Android手機或機器人。&lt;br /&gt;
&lt;br /&gt;
對於一些軟體或硬體開發廠商來說，要確保自己的產品能夠有足夠的品質，必須投資相當多的測試資源。在測試過程中，最昂貴的投資不外乎是設備與人。但谷歌在開發Android時，已經貼心的幫後續使用Android OS的廠商們提供一個操控Android機器人可溝通的語言。他就是猴子跑步 － &lt;b style=&quot;font-style: italic;&quot;&gt;monkeyrunner&lt;/b&gt;。利用這個套件可以不需要購買額外特別昂貴的軟體設備．同時也可以協助人力成本的運用。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;猴子跑步 (monkeyrunner) 是甚麼 ?&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
monkeyrunner是谷歌的Android開發團隊提供的一套工具，這套工具題供一組指令集，讓使用者可以發送控制命令給Android手機、平板電腦或Android驅動的電子設備。&lt;br /&gt;
&lt;br /&gt;
monkeyrunner工具所提供的指令包含發送按鍵(Key/Button)控制事件、拉滑(Drag/Slide)螢幕控制事件、觸控(Touch)螢幕控制、儲存即時螢幕畫面成為圖檔(為PNG或BMP格式)、傳回選定圖片檔案與即時Android畫面比較的結果、輸入一段文字、執行Shell命令、顯示提示訊息、喚醒螢幕、安裝APP、移除APP、設定重新開機與取得系統資訊等功能。&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;該從哪開始 ?&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
首先你需要一個Android的裝置，若有實際的Android硬體裝置比較好。但若沒有，又想跟monkeyrunner玩耍，Android SDK內建的Emulator也是一個選擇。&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;你的電腦需要安裝Oracle的J2SDK，6或7版本皆可&lt;/i&gt;。&lt;i&gt;可於下方網址取得&lt;/i&gt;。&lt;br /&gt;
&lt;a href=&quot;http://www.oracle.com/technetwork/java/javase/downloads/index.html&quot;&gt;http://www.oracle.com/technetwork/java/javase/downloads/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;你需要下載Android SDK，可於下方網址取得&lt;/i&gt;。&lt;br /&gt;
&lt;a href=&quot;http://developer.android.com/sdk/index.html&quot;&gt;http://developer.android.com/sdk/index.html&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;Android SDK可於以下三種作業系統使用&lt;/i&gt;&lt;br /&gt;
1. Microsoft Windows&lt;br /&gt;
2. Linux (i386) (Ubuntu 是Linux&amp;nbsp;系統中開發Android程式比較好的選擇)&lt;br /&gt;
3. Mac OS X (intel)&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;設定ADB USB Driver&lt;/i&gt;&lt;br /&gt;
以Microsoft Windows作業系統為例，插入USB線到手機與電腦後，第一次連線電腦通常需要安裝ADB USB Driver，於Windows作業系統會要求安裝不明裝置的USB Driver。關於Google Nexus的裝置，你可用Android SDK中的USB Driver (置於SDK_目錄\extras\google\usb_driver)來安裝ADB Interface Driver。若您的裝置不是Nexus，你則需要安裝手機品牌廠的ADB USB Driver。例如HTC的手機，你需要到HTC的官網去下載。&lt;br /&gt;
&lt;br /&gt;
以Unbutu作業系統與在各系統的Emulator為例，不需要安裝USB Driver。&lt;br /&gt;
&lt;br /&gt;
通常我會建議大家把Android SDK的tools與platform-tools兩個資料夾的路徑加在系統環境變數的path中. 這樣可以讓你在執行過程中呼叫adb與monkeyrunner的環境更加的便利。&lt;br /&gt;
&lt;br /&gt;
最後一個步驟就是設定Android裝置進入USB Debug Mode。這個選項在大部分的Android裝置會放在設定-&amp;gt;開發人員選項-&amp;gt;USB偵錯。&lt;br /&gt;
&lt;br /&gt;
最後確認一下，喚出cmd視窗，使用adb devices的指令，確認電腦有認到Android裝置，如下畫面。&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEvO5leJTmzBTYNRqTTI-vy_eIzQtYO9PyIA9daRO6APgPJ7NIvbavfpn78QLWVa7Yo_O69TSiwvK6NaxgzMCU0y2rL2IaWqzxSiAhE9jRHQBhbkQw0vs4TUNpC3mNyfMJZsZFJraOF6k/s1600/adb_devices.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEvO5leJTmzBTYNRqTTI-vy_eIzQtYO9PyIA9daRO6APgPJ7NIvbavfpn78QLWVa7Yo_O69TSiwvK6NaxgzMCU0y2rL2IaWqzxSiAhE9jRHQBhbkQw0vs4TUNpC3mNyfMJZsZFJraOF6k/s1600/adb_devices.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
執行adb devices後，會出現目前已連接上你的電腦USB的Android裝置的機器序號，在序號後必須是顯示device才能算是連線成功。&lt;br /&gt;
&lt;br /&gt;
以上設置需求完成後，就可以來跟猴子跑步玩耍。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;基礎練習&lt;/b&gt;&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
monkeyrunner的執行方式必須由電腦端發起，並且透過adb連線來對Android裝置下命令。現在讓我們來用一個最簡單的範例帶您進入monkeyrunner的控制。&lt;br /&gt;
&lt;br /&gt;
以下的範例以Microsoft Windows 7的方式呈現. Windows XP或Vista的行為應該與Windows 7大同小異。&lt;br /&gt;
&lt;br /&gt;
打開Android SDK的資料夾，資料夾內有個tools的資料夾，執行內部有個monkeyrunner.bat的批次檔。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOAIEIRHc_Azg89nbNEV90pKF2UwKbjpbAcXmUIDhE7UisH7F8_f2KoUbzMuHRXfDiHv03UUfi8Ron6AbMjmwaFAUsaPM3JcE9dEklxeoYnbKgATtZwxdCakqNxpm7plXAO_-MDV5N9_E/s1600/monkeyrunner.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOAIEIRHc_Azg89nbNEV90pKF2UwKbjpbAcXmUIDhE7UisH7F8_f2KoUbzMuHRXfDiHv03UUfi8Ron6AbMjmwaFAUsaPM3JcE9dEklxeoYnbKgATtZwxdCakqNxpm7plXAO_-MDV5N9_E/s1600/monkeyrunner.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
開啟另一個cmd視窗，確認你的Android device的序號(Serial Number)後面顯示device。&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6SgZyirUIjBPEBtyDIUizWitKwnzQEpswUP_qKqdCJAfNJtbR4eMozqqrs9Gfvs7qJxF2SxKODrIthy2nhBsx6puxIOza7H1z8ZVPfFwUYY0CwF1qz9KFSgi3Hlfsqktp-AP0KACmlfI/s1600/adb_devices2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh6SgZyirUIjBPEBtyDIUizWitKwnzQEpswUP_qKqdCJAfNJtbR4eMozqqrs9Gfvs7qJxF2SxKODrIthy2nhBsx6puxIOza7H1z8ZVPfFwUYY0CwF1qz9KFSgi3Hlfsqktp-AP0KACmlfI/s1600/adb_devices2.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;br /&gt;
在已開啟的monkeyrunner視窗中輸入如下的內容:&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6EXMeiGqMhV3Amb2-_2TMQOv29lgIK87pkHfsrE9HBwlsXocsc80PQTaBokqAZ0EKaccLschzcpzqxmz75fkiGk7cIYzf58IRKTlV_r6jtUsU2NWu3NrhDU0rkWiMIUvq9jyYH_DVIiA/s1600/monkeyrunner-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj6EXMeiGqMhV3Amb2-_2TMQOv29lgIK87pkHfsrE9HBwlsXocsc80PQTaBokqAZ0EKaccLschzcpzqxmz75fkiGk7cIYzf58IRKTlV_r6jtUsU2NWu3NrhDU0rkWiMIUvq9jyYH_DVIiA/s1600/monkeyrunner-1.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
monkeyrunner命令中，大小寫的字母視為相異，務必確認大小寫一致。&lt;br /&gt;
&lt;br /&gt;
第一個命令＜from com.android.monkeyrunner import ...＞ 是把monkeyrunner相關的class預載進來執行環境。&lt;br /&gt;
第二個命令是進行Android device與電腦的monkeyrunner建立連線，並且把連線的掌控權交給device這個變數。若電腦同時接到多台Android裝置，需要在waitForConnection的括號中輸入指定的Android裝置序號，例如(&quot;emulator-5554&quot;)。&lt;br /&gt;
第三個命令是利用第二個命令已經設定好的並擁有控制權的變數device來下指令。這邊下的指令是按壓選單鍵控制。因此可以看到以下Android裝置的圖片一為下press指令前，第二張圖片為下press指令後，主畫面的選單跳出來。&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUuzhPJPbFIiLsrBSDH8JBVX-fNuk-Yg-4VkVU7qrijAkHEplMlpo0bMiBAdC87qQMOPOT1pf4DYHx-7ZhFsUBdp602F7qEt25AYAr-ChnOZhghhRChzVyHUB8cWPCEklKg3cNd5p1Jrc/s1600/emulator-1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;293&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUuzhPJPbFIiLsrBSDH8JBVX-fNuk-Yg-4VkVU7qrijAkHEplMlpo0bMiBAdC87qQMOPOT1pf4DYHx-7ZhFsUBdp602F7qEt25AYAr-ChnOZhghhRChzVyHUB8cWPCEklKg3cNd5p1Jrc/s320/emulator-1.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
下press指令前&lt;/div&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGWwEVrOHzsLbQT0aex5L6trmw4-CVx8ujFjl18P_tJ0bKofvnbx_doT0RtY1WHgnADbYtfL9u8LlRoSF-GwB9acjrlG2skslK6Yq8DPw5slU4eHvwRnFZgT2AIAUoTXcd9AAr8A3jXBo/s1600/emulator-2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;294&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgGWwEVrOHzsLbQT0aex5L6trmw4-CVx8ujFjl18P_tJ0bKofvnbx_doT0RtY1WHgnADbYtfL9u8LlRoSF-GwB9acjrlG2skslK6Yq8DPw5slU4eHvwRnFZgT2AIAUoTXcd9AAr8A3jXBo/s320/emulator-2.jpg&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
下press指令後&lt;/div&gt;
&lt;br /&gt;
&lt;b&gt;猴子能協助你跑那些地方&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
在Google的官方網頁中提到，monkeyrunner可以做幾個用途，這些用途有多個Android裝置控制、功能測試、回歸測試、與延伸自動化。其實說得明白些，monkeyrunner可以讓你取代人工操作螢幕上可執行的動作。如前文所提，monkeyrunner可以幫你觸碰螢幕、拉滑畫面、觀察螢幕上圖像的變化。只要讓adb與monkeyrunner環境可以順利執行，就可以用&lt;span style=&quot;color: blue;&quot;&gt;預先錄製下來的一連串行動 (Scenario)&lt;/span&gt;，對Android裝置做控制。&lt;br /&gt;
&lt;br /&gt;
以一般使用者想做的事，最可能會有反覆性的動作應該會是玩Android遊戲時要練功。若是反覆性行為就可以利用monkeyrunner來達成。&lt;br /&gt;
&lt;br /&gt;
以軟體或硬體開發商而言，想要開發一個有品質的產品，除了優良的設計流程管理，也不能漏掉最重要的驗收階段。對於每一個產品功能 (Feature)，要有反覆性的驗證，對於穩定度測試，monkeyrunner更能24小時，日以繼夜，任勞任怨的為你工作。除了操控用的電腦當機情形外，基本上他不會罷工。&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;進階練習&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
介紹到這，我們可以來舉個稍微多點情境的例子。若我們想要做一個Bluetooth開啟與關閉測試，我們可以利用monkeyrunner來幫我們達成。&lt;br /&gt;
&lt;br /&gt;
首先我們讓手機進到主畫面(Launcher)，然後執行下列的動作：&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot; style=&quot;border-collapse: collapse; width: 448px;&quot;&gt;
 &lt;colgroup&gt;&lt;col style=&quot;mso-width-alt: 1280; mso-width-source: userset; width: 30pt;&quot; width=&quot;40&quot;&gt;&lt;/col&gt;
 &lt;col style=&quot;mso-width-alt: 13056; mso-width-source: userset; width: 306pt;&quot; width=&quot;408&quot;&gt;&lt;/col&gt;
 &lt;/colgroup&gt;&lt;tbody&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl70&quot; height=&quot;22&quot; style=&quot;background-color: #dce6f1; background-position: initial initial; background-repeat: initial initial; border-bottom-color: rgb(79, 129, 189); border-bottom-width: 0.5pt; border-left-color: rgb(64, 64, 64); border-left-width: 0.5pt; border-style: solid none solid solid; border-top-color: rgb(64, 64, 64); border-top-width: 0.5pt; color: #366092; font-family: 新細明體; font-size: 12pt; height: 16.5pt; text-underline-style: none; width: 30pt;&quot; width=&quot;40&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl71&quot; style=&quot;background-color: #dce6f1; border-bottom-color: rgb(79, 129, 189); border-bottom-width: 0.5pt; border-right-color: rgb(64, 64, 64); border-right-width: 0.5pt; border-style: solid solid solid none; border-top-color: rgb(64, 64, 64); border-top-width: 0.5pt; font-family: 新細明體; font-size: 12pt; text-underline-style: none; width: 306pt;&quot; width=&quot;408&quot;&gt;&lt;b&gt;&lt;span style=&quot;color: blue;&quot;&gt;monkeyrunner 指令&lt;/span&gt;&lt;/b&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot;&gt;device1.press(&#39;KEYCODE_MENU&#39;,&#39;DOWN_AND_UP&#39;,&#39; &#39;)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-top: none;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;觸發Menu按鍵，呼叫選單，如圖m-2&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-top: none;&quot;&gt;device1.touch ( 95, 417,
  &quot;DOWN_AND_UP&quot;)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-top: none;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;觸發觸碰Menu清單的Settings選項，如圖m-3&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-top: none;&quot;&gt;device1.touch ( 197, 96,
  &quot;DOWN_AND_UP&quot;)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl65&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl66&quot; style=&quot;border-top: none;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;觸發觸碰Bluetooth Off的螢幕位子，如圖m-4&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl67&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;&amp;gt;&amp;gt;&amp;gt;&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-top: none;&quot;&gt;device1.touch ( 155, 95,
  &quot;DOWN_AND_UP&quot;)&lt;/td&gt;
 &lt;/tr&gt;
&lt;tr height=&quot;22&quot; style=&quot;height: 16.5pt;&quot;&gt;
  &lt;td class=&quot;xl69&quot; height=&quot;22&quot; style=&quot;border-top: none; height: 16.5pt;&quot;&gt;　&lt;/td&gt;
  &lt;td class=&quot;xl68&quot; style=&quot;border-top: none;&quot;&gt;&lt;span style=&quot;color: #666666;&quot;&gt;觸發觸碰Bluetooth On的螢幕位子，如圖m-5&lt;/span&gt;&lt;/td&gt;
 &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxFqmn6BIxa7eXounaq-LfSJtI9oG-RAr8z3IdJ01BDEF6m7JPJvSZWWNT0gJ1nuV_MUmpZ7tRXjYzDE4suqbioNb3OQ_VVi-e9_lFi3C4ntvZJrNxtGornYjgvE5Jc3Mmk1hsXxGXJr0/s1600/stpe0.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxFqmn6BIxa7eXounaq-LfSJtI9oG-RAr8z3IdJ01BDEF6m7JPJvSZWWNT0gJ1nuV_MUmpZ7tRXjYzDE4suqbioNb3OQ_VVi-e9_lFi3C4ntvZJrNxtGornYjgvE5Jc3Mmk1hsXxGXJr0/s320/stpe0.jpg&quot; width=&quot;181&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&amp;nbsp;圖-m1&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHILk-enYiPzYF_6zWLiuMrgU_WP5pvCQb2rBhzZnL62v_4vQV6dAE-lIoS2Kx7cdYFn0tHkcz4xvZMEemSTBMo9TLbcbW0Hkh4blxwlVUqc7pslMYCyYO-asz9Q5bAKfAaivO3ONeXb4/s1600/stpe1.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHILk-enYiPzYF_6zWLiuMrgU_WP5pvCQb2rBhzZnL62v_4vQV6dAE-lIoS2Kx7cdYFn0tHkcz4xvZMEemSTBMo9TLbcbW0Hkh4blxwlVUqc7pslMYCyYO-asz9Q5bAKfAaivO3ONeXb4/s320/stpe1.jpg&quot; width=&quot;183&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&amp;nbsp;圖-m2&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPWg_q605n4qQoLhQBkKRrLLI4JiQLEjMS7zJ6vdzDVlPW6s1-lexrdMZSs45SpQ9ftSClLIelClrvZx4Z9MSYrYwb-spc3W7V2mzNw__SUr6MU9pIISWtGxAHdry3GSjvtDghkZbehIQ/s1600/stpe2.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiPWg_q605n4qQoLhQBkKRrLLI4JiQLEjMS7zJ6vdzDVlPW6s1-lexrdMZSs45SpQ9ftSClLIelClrvZx4Z9MSYrYwb-spc3W7V2mzNw__SUr6MU9pIISWtGxAHdry3GSjvtDghkZbehIQ/s320/stpe2.jpg&quot; width=&quot;181&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&amp;nbsp;圖-m3&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht_6FHQjtvnHYZEfAgcn7QI6GfhsgqVozTDbpAsY1BhwCNzoKXILExtLtbzpOw3-XlijVTIpGkbttExtM-rNQlT9Lls2coGureM-vjVIgCZQ6MIaNwyfTa1yaQEWIeT8fxZCU2S0y8r0U/s1600/stpe3.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEht_6FHQjtvnHYZEfAgcn7QI6GfhsgqVozTDbpAsY1BhwCNzoKXILExtLtbzpOw3-XlijVTIpGkbttExtM-rNQlT9Lls2coGureM-vjVIgCZQ6MIaNwyfTa1yaQEWIeT8fxZCU2S0y8r0U/s320/stpe3.jpg&quot; width=&quot;182&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&amp;nbsp;&lt;span style=&quot;text-align: center;&quot;&gt;圖-m4&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1fFgucj6TDyRjNubPyslvH7u5j-5yibdf_dKdzsoKIaDY_j2eCNjLmvHiRG1OKLxWtJPkGSXrkQJYjt63h6jW8VQgV6FIZh3YsUhK8EnfOgRjW76egYJ5XRyhOpdtGy8kBdlePHSII-Y/s1600/stpe4.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj1fFgucj6TDyRjNubPyslvH7u5j-5yibdf_dKdzsoKIaDY_j2eCNjLmvHiRG1OKLxWtJPkGSXrkQJYjt63h6jW8VQgV6FIZh3YsUhK8EnfOgRjW76egYJ5XRyhOpdtGy8kBdlePHSII-Y/s320/stpe4.jpg&quot; width=&quot;183&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
圖-m5&lt;/div&gt;
&lt;div style=&quot;text-align: center;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;b&gt;後語&lt;/b&gt;&lt;br /&gt;
我們談完基本的monkeyrunner的用法，這些基本的方法可以很快的延伸到我們所想要的多種情景操作．但monkeyrunner可以做更多，才能達到我們所想要的結果．在別篇文章我們會再介紹monkeyrunner的強大用途．&lt;br /&gt;
&lt;b&gt;&lt;br /&gt;&lt;/b&gt;
&lt;b&gt;參考資料&lt;/b&gt;&lt;br /&gt;
monkeyrunner,&amp;nbsp;&lt;a href=&quot;http://developer.android.com/tools/help/monkeyrunner_concepts.html&quot;&gt;http://developer.android.com/tools/help/monkeyrunner_concepts.html&lt;/a&gt;&amp;nbsp;, published by Google Inc.
</content><link rel='replies' type='application/atom+xml' href='http://android-test-tw.blogspot.com/feeds/6601458017521455773/comments/default' title='張貼留言'/><link rel='replies' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-monkeyrunner.html#comment-form' title='0 個意見'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/6601458017521455773'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/6506852281250910408/posts/default/6601458017521455773'/><link rel='alternate' type='text/html' href='http://android-test-tw.blogspot.com/2012/10/android-monkeyrunner.html' title='Android 自動化操作與測試 - monkeyrunner'/><author><name>Carl Chen at New Taipei City</name><uri>http://www.blogger.com/profile/04941355866455574780</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjEvO5leJTmzBTYNRqTTI-vy_eIzQtYO9PyIA9daRO6APgPJ7NIvbavfpn78QLWVa7Yo_O69TSiwvK6NaxgzMCU0y2rL2IaWqzxSiAhE9jRHQBhbkQw0vs4TUNpC3mNyfMJZsZFJraOF6k/s72-c/adb_devices.jpg" height="72" width="72"/><thr:total>0</thr:total></entry></feed>