|author||Will Osborn <email@example.com>||Thu May 21 16:16:36 2020 +0100|
|committer||Will Osborn <firstname.lastname@example.org>||Thu May 21 16:16:36 2020 +0100|
Fix local reference handling when exception has been thrown Test: build and run on API 16 device Bug: 157227070 Change-Id: I896e595d91dfaa7d3db3b5925dfbc30e90110db7
Android Game SDK
Unless you need to compile the Game SDK from sources, it's recommended that you use the package with the pre-compiled library. You can download it on https://developer.android.com/games/sdk.
mkdir android-games-sdk cd android-games-sdk repo init -u https://android.googlesource.com/platform/manifest -b android-games-sdk
If the Android SDK is already installed locally, then download only the Game SDK source and build tools (~500Mb).
repo sync -c -j8 gamesdk repo sync -c -j8 external/modp_b64 external/googletest external/nanopb-c external/protobuf repo sync -c -j8 prebuilts/cmake/linux-x86 prebuilts/cmake/windows-x86 prebuilts/cmake/darwin-x86
Point the environment variable
ANDROID_HOME to your local Android SDK (and
ANDROID_NDK, if the ndk isn't in
ANDROID_HOME/ndk-bundle). Use the following gradle tasks to build the Game SDK with or without Tuning Fork (default target is
cd gamesdk ./gradlew archiveZip # Without Tuning Fork ./gradlew archiveTfZip # With Tuning Fork
Download the project along with specific versions of prebuilt Android SDK and NDK (~4GB). First, download the core project and tools:
repo sync -c -j8 gamesdk repo sync -c -j8 external/modp_b64 external/googletest external/nanopb-c external/protobuf repo sync -c -j8 prebuilts/cmake/linux-x86 prebuilts/cmake/windows-x86 prebuilts/cmake/mac-x86
Next, use the download script to get prebuilt SDKs and/or NDKs.
cd gamesdk ./download.sh
Finally, build the Game SDK using downloaded prebuilts.
cd gamesdk ANDROID_HOME=`pwd`/../prebuilts/sdk ANDROID_NDK=`pwd`/../prebuilts/ndk/r20 ./gradlew archiveZip # Without Tuning Fork ANDROID_HOME=`pwd`/../prebuilts/sdk ANDROID_NDK=`pwd`/../prebuilts/ndk/r20 ./gradlew archiveTfZip # With Tuning Fork
Download the whole repository with all available prebuilt Android SDKs and NDKs (~23GB).
repo sync -c -j8
Build static and dynamic libraries for several SDK/NDK pairs.
cd gamesdk ANDROID_HOME=`pwd`/../prebuilts/sdk ./gradlew gamesdkZip
./gradlew localUnitTests # Requires a connected ARM64 device to run ./gradlew localDeviceInfoUnitTests # No device required, tests are running on host
Samples are classic Android projects, using CMake to build the native code. They are also all triggering the build of the Game SDK.
cd samples/bouncyball && ./gradlew assemble cd samples/cube && ./gradlew assemble cd samples/tuningfork/scaledballs && ./gradlew assemble cd samples/tuningfork/expertballs && ./gradlew assemble
The Android SDK/NDK exposed using environment variables (
ANDROID_HOME) will be used for building both the sample project and the Game SDK.
Open projects using Android Studio:
and run them directly (
Shift + F10 on Linux,
Control + R on macOS). The local Android SDK/NDK (configured in Android Studio) will be used for building both the sample project and the Game SDK.
After opening a sample project using Android Studio, uncomment the line containing
add_gamesdk_sources(). This will add the Swappy/Tuning Fork sources as part of the project. You can then inspect the source code (with working auto completions) and run the app in debug mode (with working breakpoints and inspectors).