46
46
asset_name : android-frida-interception-script-${{ github.ref }}.js
47
47
file : ./build/android-frida-interception-script.js
48
48
tag : ${{ github.ref }}
49
- repo_token : ${{ secrets.GITHUB_TOKEN }}
49
+ repo_token : ${{ secrets.GITHUB_TOKEN }}
50
+
51
+ test-android :
52
+ name : Test on Android emulator
53
+ runs-on : ubuntu-latest
54
+ strategy :
55
+ matrix :
56
+ api-level : [30]
57
+ steps :
58
+ - uses : actions/checkout@v4
59
+
60
+ - name : Set up Python
61
+ uses : actions/setup-python@v5
62
+ with :
63
+ python-version : ' 3.11'
64
+
65
+ - name : Install Frida CLI
66
+ run : |
67
+ pip install --user frida-tools
68
+ echo "$HOME/.local/bin" >> $GITHUB_PATH
69
+
70
+ # Apparently significantly improves emulator performance:
71
+ - name : Enable KVM
72
+ run : |
73
+ echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
74
+ sudo udevadm control --reload-rules
75
+ sudo udevadm trigger --name-match=kvm
76
+
77
+ # Cache the emulator AVD:
78
+ - name : AVD cache
79
+ uses : actions/cache@v4
80
+ id : avd-cache
81
+ with :
82
+ path : |
83
+ ~/.android/avd/*
84
+ ~/.android/adb*
85
+ key : avd-${{ matrix.api-level }}
86
+
87
+ - name : Create AVD and cache snapshot
88
+ if : steps.avd-cache.outputs.cache-hit != 'true'
89
+ uses : reactivecircus/android-emulator-runner@v2
90
+ with :
91
+ api-level : ${{ matrix.api-level }}
92
+ target : google_apis
93
+ force-avd-creation : false
94
+ emulator-options : -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
95
+ script : |
96
+ echo "Generated AVD snapshot for caching."
97
+
98
+ - name : Run tests
99
+ uses : reactivecircus/android-emulator-runner@v2
100
+ with :
101
+ api-level : ${{ matrix.api-level }}
102
+ target : google_apis
103
+ force-avd-creation : false
104
+ emulator-options : -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
105
+ script : |
106
+ adb devices
107
+ bash test/setup-emulator.sh
108
+ echo "Emulator ready to test"
109
+ adb shell pgrep -f frida-server
0 commit comments