Google is committed to advancing racial equity for Black communities. See how.
This page was translated by the Cloud Translation API.
Switch to English

從現有的APK運行儀器測試

這些說明假定您具有本地可用的Trade Federation軟件包;如果不是,請按照下載說明進行獲取。

然後,使用以下命令安裝工具測試的APK,執行測試並顯示正在運行的測試:

./tradefed.sh run instrumentations --apk-path <path of your apk>

輸出類似:

07-17 10:55:32 D/InvocationToJUnitResultForwarder: Starting test: android.animation.cts.ValueAnimatorTest#testOfArgb
07-17 10:55:33 D/InvocationToJUnitResultForwarder: Starting test: android.animation.cts.ValueAnimatorTest#testIsRunning
07-17 10:55:34 D/InvocationToJUnitResultForwarder: Starting test: android.animation.cts.ValueAnimatorTest#testGetCurrentPlayTime
07-17 10:55:35 D/InvocationToJUnitResultForwarder: Starting test: android.animation.cts.ValueAnimatorTest#testStartDelay
07-17 10:55:35 I/InvocationToJUnitResultForwarder: Run ended in 2m 20s

您可以選擇指定--serial <device serial number>來針對給定的設備運行。您可以使用adb devices的序列號。

有關Tradefed執行的更多詳細信息,請參見“ 通過Tradefed進行測試”部分