Skip to content

implement automatic screenshot generation #2

implement automatic screenshot generation

implement automatic screenshot generation #2

Workflow file for this run

on:
push:
branches:
- '*'
name: Generate Screenshots
jobs:
screenshot:
name: Generate screenshots
runs-on: macos-latest
strategy:
matrix:
api-level: [ 34 ]
steps:
- name: Check out code
uses: actions/checkout@v4
- name: AVD cache
uses: actions/cache@v3
id: avd-cache
with:
path: |
~/.android/avd/*
~/.android/adb*
key: avd-${{ matrix.api-level }}
- name: create AVD and generate snapshot for caching
if: steps.avd-cache.outputs.cache-hit != 'true'
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: playstore
arch: x86_64
profile: Pixel 4
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: echo "Generated AVD snapshot for caching."
- name: Set up Java environment
uses: actions/setup-java@v3
with:
java-version: 17
distribution: 'zulu'
cache: 'gradle'
- name: Build app
run: ./gradlew assembleGoogleNormalDebug assembleGoogleNormalAndroidTest
- name: Start System UI demo mode
run: |
- name: Run emulator and generate screenshots
uses: reactivecircus/android-emulator-runner@v2
with:
api-level: ${{ matrix.api-level }}
target: playstore
arch: x86_64
profile: Pixel 4
force-avd-creation: false
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
disable-animations: false
script: |
adb shell settings put global hidden_api_policy 1
# Start demo mode
adb shell settings put global sysui_demo_allowed 1
# Display time 12:00
adb shell am broadcast -a com.android.systemui.demo -e command clock -e hhmm 1200
# Display full mobile data without type
adb shell am broadcast -a com.android.systemui.demo -e command network -e mobile show -e level 4 -e datatype false
adb shell am broadcast -a com.android.systemui.demo -e command network -e wifi show -e level 4 -e fully true
# Hide notifications
adb shell am broadcast -a com.android.systemui.demo -e command notifications -e visible false
# Show full battery but not in charging state
adb shell am broadcast -a com.android.systemui.demo -e command battery -e plugged false -e level 100
fastlane screengrab --app_apk_path app/build/outputs/apk/googleNormal/debug/app-google-normal-debug.apk --test_apk_path app/build/outputs/apk/androidTest/googleNormal/debug/app-google-normal-debug-androidTest.apk --tests_package_name=net.vonforst.evmap.debug.test --app_package_name net.vonforst.evmap.debug -p net.vonforst.evmap.screenshot --use_timestamp_suffix false --clear_previous_screenshots true -q en-US,de-DE
adb shell am broadcast -a com.android.systemui.demo -e command exit