monkey 測試 adb shell monkey

來源:互聯網
上載者:User

標籤:

adb shell monkey

  -p com.android.recorder

  --throttle 360

  --ignore-crashes

  --monitor-native-crashes

  --ignore-security-exceptions

  --ignore-timeouts

  --ignore-native-crashes

  --pct-syskeys 10

  --pct-nav 20

  --pct-majornav 20

  --pct-touch 40

  --pct-appswitch 10

  -v -v -v 20000

 

*#*#3646633#*#* mtklogger

 

[email protected]:~/mp_mtk$  adb shell monkey --help** Error: Unknown option: --helpusage: monkey [-p ALLOWED_PACKAGE [-p ALLOWED_PACKAGE] ...]              [-c MAIN_CATEGORY [-c MAIN_CATEGORY] ...]              [--ignore-crashes] [--ignore-timeouts]              [--ignore-security-exceptions]              [--monitor-native-crashes] [--ignore-native-crashes]              [--kill-process-after-error] [--hprof]              [--pct-touch PERCENT] [--pct-motion PERCENT]              [--pct-trackball PERCENT] [--pct-syskeys PERCENT]              [--pct-nav PERCENT] [--pct-majornav PERCENT]              [--pct-appswitch PERCENT] [--pct-flip PERCENT]              [--pct-anyevent PERCENT] [--pct-pinchzoom PERCENT]              [--pkg-blacklist-file PACKAGE_BLACKLIST_FILE]              [--pkg-whitelist-file PACKAGE_WHITELIST_FILE]              [--wait-dbg] [--dbg-no-events]              [--setup scriptfile] [-f scriptfile [-f scriptfile] ...]              [--port port]              [-s SEED] [-v [-v] ...]              [--throttle MILLISEC] [--randomize-throttle]              [--profile-wait MILLISEC]              [--device-sleep-time MILLISEC]              [--randomize-script]              [--script-log]              [--bugreport]              [--periodic-bugreport]              COUNT[email protected]:~/mp_mtk$ 

 

adb shell monkey     -p com.letv.android.recorder     --throttle 360     --ignore-crashes     --monitor-native-crashes     --ignore-security-exceptions     --ignore-timeouts     --ignore-native-crashes     --pct-syskeys 10     --pct-nav 20     --pct-majornav 20     --pct-touch 40     --pct-appswitch 10     -v -v -v 20000adb shell monkey -p com.letv.android.recorder --throttle 360 --ignore-crashes --monitor-native-crashes --ignore-security-exceptions --ignore-timeouts --ignore-native-crashes --pct-syskeys 10 --pct-nav 20 --pct-majornav 20 --pct-touch 40 --pct-appswitch 10 -v -v -v 20000
Category Option Description
General --help Prints a simple usage guide.
-v

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.

命令列的每一個-v將增加反饋資訊的層級。Level 0(預設值)除啟動提示、測試完成和最終結果之外,提供較少資訊。Level 1提供較為詳細的測試資訊,如逐個發送到Activity的事件。Level 2提供更加詳細的設定資訊,如測試中被選中的或未被選中的Activity。

 

Events -s <seed>

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.

產生隨機事件的種子,相同的值產生相同的事件序列

--throttle <milliseconds>

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.

設定兩次事件之間的事件間隔.通過這個參數降低速度,如果不指定該參數,系統會儘可能快的發送事件

--pct-touch <percent>

Adjust percentage of touch events. (Touch events are a down-up event in a single place on the screen.)

調整設定觸摸事件的百分比

--pct-motion <percent>

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.)

調整設定滑動事件的百分比

--pct-trackball <percent>

Adjust percentage of trackball events. (Trackball events consist of one or more random movements, sometimes followed by a click.)

調整設定軌跡球事件的百分比

--pct-nav <percent>

Adjust percentage of "basic" navigation events. (Navigation events consist of up/down/left/right, as input from a directional input device.)

調整設定導航事件 up/down/left/right)百分比

--pct-majornav <percent>

Adjust percentage of "major" 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.)

調整設定(主要導航事件 back key 、 menu key)百分比

--pct-syskeys <percent>

Adjust percentage of "system" 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.)

調整設定系統按鍵事件 Home 、Back 、startCall 、 endCall 、 volumeControl)百分比

--pct-appswitch <percent>

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.

調整設定(activity之間的切換)百分比

--pct-anyevent <percent>

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.

調整設定 (  任意事件)百分比

Constraints -p <allowed-package-name>

If you specify one or more packages this way, the Monkey will only 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‘ll need to specify those packages as well. If you don‘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.

指定有效package(如不指定,則對系統中所有package有效),一個-p 對應一個有效package, 如:-p com.ckt -p com.ckt.asura;可以指定多個

-c <main-category>

If you specify one or more categories this way, the Monkey will only allow the system to visit activities that are listed with one of the specified categories. If you don‘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.

activity必須至少包含一個指定的category,才能被啟動,否則啟動不了;

Debugging --dbg-no-events

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.

設定此選項,Monkey將執行初始啟動,進入到一個測試Activity,然後不會再進一步建置事件。為了得到最佳結果,把它與-v、一個或幾個包約 束、以及一個保持Monkey運行30秒或更長時間的非零值聯合起來,從而提供一個環境,可以監視應用程式所調用的包之間的轉換。

 

--hprof

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 Traceview for more information on trace files.

設定此選項,將在Monkey事件序列之前和之後立即產生profiling報告。這將會在data/misc中產生大檔案(~5Mb),所以要小心使用它。

--ignore-crashes

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.

通常,當應用程式崩潰或發生任何失控異常時,Monkey將停止運行。如果設定此選項,Monkey將繼續向系統發送事件,直到計數完成。

--ignore-timeouts

Normally, the Monkey will stop when the application experiences any type of timeout error such as a "Application Not Responding" dialog. If you specify this option, the Monkey will continue to send events to the system, until the count is completed.

通常,當應用程式發生任何逾時錯誤(如“Application Not Responding”對話方塊)時,Monkey將停止運行。如果設定此選項,Monkey將繼續向系統發送事件,直到計數完成。

--ignore-security-exceptions

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.

通常,當應用程式發生許可錯誤(如啟動一個需要某些許可的Activity)時,Monkey將停止運行。如果設定了此選項,Monkey將繼續向系統發送事件,直到計數完成。

--kill-process-after-error

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.

通常,當Monkey由於一個錯誤而停止時,出錯的應用程式將繼續處於運行狀態。當設定了此選項時,將會通知系統停止發生錯誤的進程。注意,正常的(成功的)結束,並沒有停止啟動的進程,裝置只是在結束事件之後,簡單地保持在最後的狀態。

--monitor-native-crashes

Watches for and reports crashes occurring in the Android system native code. If --kill-process-after-error is set, the system will stop.

監視並報告Android系統中本地代碼的崩潰事件。如果設定了--kill-process-after-error,系統將停止運行。

--wait-dbg

Stops the Monkey from executing until a debugger is attached to it.

停止執行中的Monkey,直到有調試器和它相串連

 

monkey 測試 adb shell monkey

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.