android-emulator-runner
android-emulator-runner copied to clipboard
Simple access to logcat entries while emulator is running
This does not add a new feature, as we can do this work in the script tag, but it would reduce boilerplate in github workflow configurations.
I've seen in a number of examples things like this:
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
script: |
adb logcat -c
adb logcat > temporary-file & /or/ adb logcat &
./gradlew <actual script here>
And then the temporary file is printed or pushed into a github action artifact, or printed inline the build.
this feels like this could be better expressed as config like:
- name: run tests
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: 29
logcat-to: ./logs
script: ./gradlew connectedCheck
Such that if configured, the action would:
- launch the emulator
- clear the logcat ring buffer with -c
- keep all logcat logs from the emulator in a local file, by running adb logcat in the background, or by polling or by doing Something Useful to make sure the logs go to the right place.
- move that completed file into the named location after the script completes
If running with orchestrator may need to get all the logs from outputs and put together.
I could see this being somewhat useful, but devil's advocate says that it may add unnecessary bloat to the action.
I'll label this as help-wanted though