Robolectric in Google Summer of Code 2024
Feb 25, 2024We have some exciting news to share - Robolectric has...
This page describes how to set up a development environment to build Robolectric in the supported OSs (Linux, Mac, Windows).
JDK 17 is currently required to build Robolectric. Newer versions of the JDK (e.g. 21) will likely work, but may contain some rough edges.
The first step is to install the Android SDK tools. The easiest way to do this is to install Android Studio, which also installs a copy of the Android SDK tools, and provides the SDK Manager UI to manage SDK versions. Alternatively it is also possible to only download the Android command line tools without installing the entire Android Studio. However, it is recommended to install Android Studio if possible. Visit https://developer.android.com/studio#download to get started.
If you install the Android Studio, it’s recommended to use the latest stable Android Studio because Robolectric keeps using the latest stable AGP, and it requires a recent Android Studio.
Many of Robolectric’s integration tests require the Android build tools to be installed and specific SDK versions to be installed.
git clone https://github.com/robolectric/robolectric.git
./gradlew clean assemble
./gradlew test --parallel -D"robolectric.enabledSdks=26,27,28"
./gradlew cAT --info
If you’re using Windows, it’s recommended to use PowerShell in Windows Terminal.
We have some exciting news to share - Robolectric has...
In recent years, the team has received multiple issues regarding...
My name is Umesh Singh and I was an...