W tych instrukcjach przyjęto, że masz pakiet Trade Federation dostępny lokalnie. Jeśli nie, postępuj zgodnie z instrukcjami pobierania, aby go uzyskać.
Następnie użyj tego polecenia, aby zainstalować plik APK testów instrumentacji, uruchomić testy i wyświetlić testy, które są uruchomione:
./tradefed.sh run instrumentations --apk-path <path of your apk>
Dane wyjściowe będą podobne do tych:
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
Opcjonalnie możesz określić --serial <device serial number>
, aby uruchomić test na danym urządzeniu. Numer seryjny urządzenia można uzyskać za pomocą adb devices
.
Więcej informacji o wykonywaniu testów za pomocą Tradefed znajdziesz w sekcji poświęconej testowaniu za pomocą Tradefed.