Building for Android - TheXTech/TheXTech GitHub Wiki

To build the game for Android, you will need to install the Android Studio (Not available in CN!) from the official site.

Once you will install the Android Studio, you will need to install the next components:

  • Android SDK 34+
  • Android NDK r32c
  • CMake
  • Ninja

Preparing to build

Before to start the build, you should obtain the source code for TheXTech. You can use the stable version as well as the latest in-development to test out any new experimental features and receive any further bugfixes earlier.

Stable version

If you want to build the stable version, you can simply download the source code archive from the official site or from GitHub releases:

And then, unpack the archive and open the terminal at the just-now unpacked directory that contains the source code for TheXTech.

Important note: Please never use the "Source code" links at Github releases: they are broken. Instead, download the thextech-full-src-v*.*.*.tar.gz or thextech-full-src-v*.*.*.tar.bz2 or thextech-full-src-v*.*.*.zip archive.

This project uses submodules and GitHub is unable to create source code packages that includes submodules too.

Development version

If you want to build the latest in-development version, then, instead of downloading the archive, you can clone the repository itself by running this in a terminal (please open the terminal at the directory where you want to put the clonned repository, so, you will know where it is):

git clone https://github.com/TheXTech/TheXTech.git

Then, Make sure all submodules have been pulled, otherwise, it won't build:

cd TheXTech
git submodule init
git submodule update

Building the code

Right now there are two ways to build the project: via Android Studio, or via terminal using the Gradle build command.

Via Android Studio

Open the project application in Android Studio: the project you need to open and build is located in the android-project sub-directory of the repository.

From the Android Studio, you can run the Build -> Make to compile the project or Build -> Generate signed Bundle / APK to get the ready-for-use APK file you may share with other people and install on any devices directly.

From terminal via Gradle

Before to run the build, you should properly download and unpack the Android SDK and the Android NDK of the version r23c. And then, set up the environment variables according to the manual.

Once all development tools are ready, now, at the TheXTech's source code directory, run next commands in the terminal:

  1. Enter the directory with the Android project:

    cd android-project
    
  2. Run the build itself:

    • if on UNIX-like systems
      ./gradlew assembleApkRelease
      
    • Or if on Windows:
      gradlew.bat assembleApkRelease
      

After the build finishes, you can find your binaries in the android-project/thextech/build/outputs/apk/apk/release directory. It will be unsigned by default and you should sign it by your key to be able to install it to your or any other device.

Deployment of built stuff

The APK you have built and signed can be simply installed into the device through ADB or by the manual placement into the device and installing via any file manager.

To make it work right you will need:

  • Download any of game assets packages and unpack it into the convenient directory.
  • Run the game and select the directory that contains assets you had to unpack.

Distribute custom builds

If you whaever want to distribute your own modified builds, make sure they won't conflict with our official version:

  1. Open the android-project/thextech/build.grudle file.
  2. Navigate the buildTypes { line, and find the release { and release-ci { inside it.
  3. Add next line into them:
applicationIdSuffix '.kokoko'
versionNameSuffix '-BYKOKOKO'

Where is kokoko - whatever like you want to put, like your nickname or alias, or anything also your fantasy can. This will make your APKs being identified as different applications, so, there is no conflicts with the official builds, and they can be installed both on the same device.