Mobile App Testing with Gradle in GitHub Actions
Accelerate your mobile testing workflow with unlimited concurrent Android emulators. Perfect for CI/CD pipelines and test automation at scale.
You can use remote Android instances in your GitHub Actions workflows as targets for your tests. Thanks to unlimited concurrency, your end to end tests will complete much faster without additional cost.
Acquire an organization token
- Go to
Settings
in Limbar Console. - Choose
API Tokens
in the left sidebar. - Click
Create Token
to create a new token. - Copy the token and save it in Github Secrets as
LIM_TOKEN
.
Use limbario/run-android
action
Here is an example invocation of the limbario/run-android
action. Once it completes, the Android instance is connected with adb
and is seen as a target
for all your Android operations.
- name: Run Android instance
uses: limbario/run-android@v0.4.3
with:
token: ${{ secrets.LIM_TOKEN }}
The following is how you’d use it for the official Now In Android application to run the tests that require an Android instance.
name: Run Android Tests
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
repository: android/nowinandroid
ref: d15c739812f25401b21614fe0f7e18534d285921
- name: Copy CI gradle.properties
run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: 17
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
- name: Run Android instance
uses: limbario/run-android@v0.4.3
with:
token: ${{ secrets.LIM_TOKEN }}
- name: Run tests
run: ./gradlew connectedDemoDebugAndroidTest --daemon
Watch while the tests run
You can also watch the device while the test is running for debugging purposes.
In the logs, you will find the randomly generated name for your Android instance. Run the following command to watch the device:
lim connect android <instance-name> --region <region>
You should see success logs like the following and a window popping up:
$ lim connect android 1vnb5vxb1b
✓ Checking your token 📜
✓ Fetching instance information
✓ Tunnel is ready for adb at localhost:34579 🚇
⠹ Ready to control the device 🕹️
Alternatively, you can go to Limbar Console , find
your Android instance, and click Connect
to get the full command you need to connect.
Clicking connect shows you the lim connect
command you can use to stream the emulator instance:
Performance Benefits
- Run unlimited concurrent tests without additional costs
- Perfect for mobile app testing automation
- Integrated with popular testing tools