Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: Pull files/directories from emulated image before terminating emulator #421

Open
Futsch1 opened this issue Dec 29, 2024 · 0 comments

Comments

@Futsch1
Copy link

Futsch1 commented Dec 29, 2024

A very common use case for the android-emulator-runner is to run Android tests using Espresso. Per default, Espresso creates a dump of the view hierarchy and a screenshot when a test fails. These files are very helpful when debugging failed tests.

However, getting them from the emulator was somewhat tricky: Since the script execution of a script is stopped on an error (and a failed test is an error), the files cannot be pulled easily. If the failed test error is suppressed, the action will run as passed and not show the failed test immediately. It would be possible to save the snapshot of the AVD and start it again in a second step, but this does not seem to be very efficient.

I came up with this solution, but I do not like it a lot:

EXIT_CODE=0 && ./gradlew connectedCheck || EXIT_CODE=$? && (adb pull /sdcard/googletest/test_outputfiles app/build/outputs/androidTest-results/ || true) && exit $EXIT_CODE

Is there an easier way to do it? If not, I would like to have either the possibility to use a tear-down script that can be run before the emulator is shut down or be able to indicate a list of folders/files to be pulled from the AVD after executing the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant