Exécuter des tests d'instrumentation à partir d'APK existants

Ces instructions supposent que le package de fédération du commerce est disponible. à l'échelle locale ; si ce n'est pas le cas, suivre les instructions de téléchargement pour l'obtenir.

Exécutez ensuite la commande suivante pour installer l'APK des tests d'instrumentation : exécuter les tests et afficher ceux en cours d'exécution:

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

Avec un résultat semblable à celui-ci:

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

Vous pouvez éventuellement spécifier --serial <device serial number> pour exécuter sur un appareil donné. Le numéro de série de votre appareil peut être obtenu avec adb devices.

Consultez le Tester via la section Tradefed pour en savoir plus sur les exécutions Tradefed.