久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

運行 connectedAndroidTest 并跳過卸載

Run connectedAndroidTest and skip uninstall(運行 connectedAndroidTest 并跳過卸載)
本文介紹了運行 connectedAndroidTest 并跳過卸載的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

限時送ChatGPT賬號..

有沒有辦法調用connectedAndroidTest任務并在進程結束時跳過卸載任務?

Is there a way to call the task connectedAndroidTest and skip the uninstall task at the end of the process ?

在測試執行結束時,應用程序從設備上卸載,但我想將應用程序保留在設備上.

At the end of the test execution, the app is uninstalled from the device, but I would like to keep the app on the device.

來自 http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Running-tests:

如前所述,需要連接設備的檢查是使用名為 connectedCheck 的錨任務啟動的.這取決于任務 connectedDebugAndroidTest ,因此將運行它.此任務執行以下操作:

As mentioned previously, checks requiring a connected device are launched with the anchor task called connectedCheck. This depends on the task connectedDebugAndroidTest and therefore will run it. This task does the following:

  • 確保已構建應用和測試應用(取決于 assembleDebug 和 assembleDebugAndroidTest).
  • 安裝這兩個應用.
  • 運行測試.
  • 卸載這兩個應用程序.

推薦答案

看gradle插件的源頭,沒有辦法防止在測試任務結束時卸載app.您可以在 android gradle 插件的 SimpleTestCallable 類中檢查.

Looking at the sorce of gradle plugin there is no way to prevent uninstalling app at the end of test task. You can check that in SimpleTestCallable class of android gradle plugin.

據我所知,有兩種選擇可以滿足您的需求.

From what i see there are two options to acchive what you want.

第一個是在完成連接檢查后重新安裝應用程序.執行此操作的命令看起來像這樣../gradlew connectedCheck installDebug installDebugAndroidTest 這將在設備上執行測試并從中刪除應用程序.但之后它將重新安裝應用程序并測試應用程序.所以應用程序仍然會被刪除然后安裝,這意味著一些開銷,但至少應用程序不會被重新編譯兩次,因為您正在執行相同的 gradle 執行.

First one is to reinstall app after your connected check is done. Command to do that would look something like this. ./gradlew connectedCheck installDebug installDebugAndroidTest This will execute test on device and delete apps from it. But after that it will reinstall app and test app. So app will still be removed and then installed which means a bit of owerhead but at least apps will not be recompiled twice since you are executing in same gradle execution.

第二個選項是不使用 gradle 來執行測試,而是使用 adb.為此,您首先需要通過 gradle 安裝應用程序和測試應用程序../gradlew installDebug installDebugAndroidTest

Second option is to not use gradle for executing tests but use adb instead. To do this you first need to install app and test app through gradle. ./gradlew installDebug installDebugAndroidTest

之后,您可以通過 adb 執行測試.通過調用 adb shell am instrument -w com.example.test/android.support.test.runner.AndroidJUnitRunner.

After that you can execute tests through adb. by caling adb shell am instrument -w com.example.test/android.support.test.runner.AndroidJUnitRunner.

完成后,您可以運行 cli 測試,因為應用程序和測試應用程序都已安裝.

When this is done you can run your cli tests since both app and test app are still installed.

使用第二種方法,您將失去使用 gradle 執行測試的所有好處.比如代碼覆蓋和多進程執行等.

With second approach you would lose all the benefits of executing test wit gradle. Such as code coverage and executing in multiple proceses, etc.

這篇關于運行 connectedAndroidTest 并跳過卸載的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Cut, copy, paste in android(在android中剪切、復制、粘貼)
android EditText blends into background(android EditText 融入背景)
Change Line Color of EditText - Android(更改 EditText 的線條顏色 - Android)
EditText showing numbers with 2 decimals at all times(EditText 始終顯示帶 2 位小數的數字)
Changing where cursor starts in an expanded EditText(更改光標在展開的 EditText 中的開始位置)
EditText, adjustPan, ScrollView issue in android(android中的EditText,adjustPan,ScrollView問題)
主站蜘蛛池模板: 一二三在线视频 | 天堂免费 | 综合久久av | 精品久久久久久久久久久久久久久久久 | 国产精品毛片一区二区三区 | 亚洲成年人免费网站 | 免费在线一区二区 | 在线免费观看日本视频 | 在线观看中文字幕 | 蜜桃特黄a∨片免费观看 | 亚洲麻豆 | 爱草视频 | 亚洲精品福利视频 | 亚洲天堂成人在线视频 | 成人免费毛片在线观看 | 在线婷婷| 国产精品久久久久无码av | 性高朝久久久久久久3小时 av一区二区三区四区 | 天堂综合| 久久久久久影院 | 国产在线视频一区二区 | 在线视频一区二区三区 | 国产不卡在线播放 | 亚洲久久在线 | 九九爱这里只有精品 | 久久婷婷av | 国产成人在线视频播放 | 国产福利在线小视频 | 亚洲欧美精 | 羞羞的视频免费在线观看 | 欧美久久一级特黄毛片 | 国产乱码久久久 | 国产精品成人一区二区三区夜夜夜 | 最新一级毛片 | 波多野结衣精品在线 | 午夜电影网 | 中文字幕av第一页 | 爱爱免费视频 | 欧美日韩不卡在线 | 亚洲风情在线观看 | 亚洲黄色在线免费观看 |