How to get trace files during "adb am instrument" in Android

Viewed 115

we need your help.
We are collecting trace logs during Android UI tests (espresso) to use for academic research. To obtain trace files, we used "adb am instrument" with "-p" option, referencing this page (https://developer.android.com/studio/command-line/adb#am). The command created a trace file but it includes no logs about the target apps.

We tried the following things:

  • Command:
    adb shell 'CLASSPATH=$(pm path androidx.test.services) app_process / androidx.test.services.shellexecutor.ShellMain am instrument -p ./output.log -r -w -e targetInstrumentation com.beemdevelopment.aegis.debug.test/com.beemdevelopment.aegis.AegisTestRunner -e clearPackageData true -e package com.beemdevelopment.aegis -e debug false androidx.test.orchestrator/androidx.test.orchestrator.AndroidTestOrchestrator'

  • Modify the above command:
    -e debug true
    (the app become no longer work showing white screen)

  • Modify the Gradle file:
    testHandleProfiling true (in defaultConfig)
    debuggable true (in buildTypes.debug)

0 Answers
Related