24

I have a failing test in my suite and now I am using the Android Orchestrator, but all I get is this message:

Test instrumentation process crashed. Check com.something.something_detail.SomeActivityTest#testAddSucceeds_activityIsFinished.txt for details

I don't know how to access that file. Any help?

ProgrammerPer
  • 1,125
  • 1
  • 11
  • 26
Leandro Borges Ferreira
  • 12,422
  • 10
  • 53
  • 73

8 Answers8

24

You'll find them on the device under /data/data/android.support.test.orchestrator/files/.

To get them off the device via ADB (requires debugging enabled and either a rooted device or an emulator so you have root):

adb root
adb pull /data/data/android.support.test.orchestrator/files/

Non-root, AndroidX users can use:

adb shell run-as androidx.test.orchestrator cat /data/user_de/0/androidx.test.orchestrator/files/com.pkg.name#testName.txt
Benoit Duffez
  • 11,839
  • 12
  • 77
  • 125
Turnsole
  • 3,422
  • 5
  • 30
  • 52
8

My results show something slightly different than the other answers floating around SO.

Using Android Studio IDE

It seems that stock emulator images are basically rooted by default, except for images that support the Google Play Store. So try to run the failing test on a normal emulator and after you get the error I've been able to find the txt file through Android Studio's Device File Explorer tool.

Open the tool window and browse to /data/user_de/0/android.support.test.orchestrator/files/ and find your .txt file.

From here you can open the file or right-click to download it. No need to for any terminal adb root commands, etc.

Alternate method (command line)

If you insist on using adb and the command line then you must first:

adb root
adb pull /data/user_de/0/android.support.test.orchestrator/files/ [directory to save to]
adb unroot (optional)

Thoughts

Unfortunately if you were hoping for a stack trace or something useful in the .txt file you might be highly disappointed. All I found in my experience was something like:

INSTRUMENTATION_RESULT: shortMsg=Process crashed.
INSTRUMENTATION_CODE: 0

which of course is quite useless for debugging. :(

I'm also not sure if the file location differs for actual devices since all the other answers out there say the file is located at /data/data/... instead of /data/user_de/... which is what I have found for emulators.

Tony Chan
  • 8,017
  • 4
  • 50
  • 49
  • On one of my emulaters they were under `/data/user_de/0/androidx.test.orchestrator/files`. But like you said pretty useless for debuggin. – zabson Nov 02 '18 at 21:42
  • I had to use this path as well. Thank you. Not sure why it varies – Mark Han Nov 20 '18 at 17:03
  • Also, I still have no idea why the process is crashing. Have you had any luck with debugging? – Mark Han Nov 20 '18 at 18:36
5

In my case the file was useless as it only had

INSTRUMENTATION_RESULT: shortMsg=Process crashed.
INSTRUMENTATION_CODE: 0

On the plus side, this informed me that my testing application crashed. Looking in the logcat showed the stack trace as to why it crashed.

Adeel Ahmad
  • 939
  • 1
  • 10
  • 20
1

For anyone who still stumbles upon this, this Stack Overflow answer was helpful. Pulling the files off of the emulator I was running required running adb as root first.

adb root

and then

adb pull /data/data/android.support.test.orchestrator/files/
jmcker
  • 387
  • 4
  • 18
  • What does this add that @Tumsole 's answer doesn't provide? – tir38 Jun 04 '18 at 20:40
  • @tir38 The use of `adb root` before attempting to pull the files. I couldn't figure out why I kept getting a permission denied until I found the other post. I don't have enough reputation to just comment on @Turnsole 's post or I would have. – jmcker Jun 04 '18 at 22:12
0

For anyone using AndroidX Test Orchestrator, the path would change to

adb pull /data/data/androidx.test.orchestrator/files/

but, this command also found 0 files so I had to use

adb pull /data/user_de/0/androidx.test.orchestrator/

Mark Han
  • 2,785
  • 2
  • 16
  • 31
0

I was facing the same error and when I checked the txt file on the device, I did not find meaningful logs. Then, I changed the "Build Variant" in my Android Studio and the setup started working.

Amit Jathar
  • 319
  • 3
  • 14
0

You need to have rooted device to achieve this, so create emulator with system without google play services (they are rooted by default). In the emulator with this kind of system you will find txt files in path:

data/user_de/0/android.test.orchestrator/files

But I also did not find any useful info there.

0

For me, running instrumentation tests using the Android Test Orchestrator on emulators always resulted in the mysterious "Test instrumentation process crashed" failure. I switched over to using a 64 bit emulator instead, and now the tests run. https://github.com/android/android-test/issues/352

Android Studio AVD Manager select system image

prfarlow
  • 3,624
  • 2
  • 15
  • 24