How to use Android Test Orchestrator in command line?

1.4k views Asked by At

Am seeing crashes while running tests from CI. Read this article(https://developer.android.com/training/testing/junit-runner#ato-gradle) about using Android Test Orchestrator. Am using adb to run my tests from CI. want to know how do I install orchestrator. apk in command line ?

2

There are 2 answers

1
j4kk1 On

If using orchestrator, you need the test service apk too.

  1. Get the apk:s from web repo, or you local machine. Local path is somethin like:

    <your cache dir>\.gradle\caches\modules-2\files-2.1\androidx.test\orchestrator\1.4.0-alpha05\ffa651bbb898f0f2bc93c8e9f1296ed5e77768f5\orchestrator-1.4.0-alpha05.apk

    <your cache dir>\.gradle\caches\modules-2\files-2.1\androidx.test.services\test-services\1.4.0-alpha05\2a8f8a5c3f033d0c33e0faf35c6151713a9b0f9d\test-services-1.4.0-alpha05.apk

  2. Put them somewhere, where accessible from cmd line.

  3. Run these lines from that location:

    adb install -g -r --force-queryable orchestrator-1.4.0-alpha05.apk

    adb install -g -r --force-queryable test-services-1.4.0-alpha05.apk

1
Varun RTR On

I am also struggling but this --force-queryable solve my problem. Thanks #nilzor