Ren'Py contains tools that help you take a packaging-centric approach to Android game development. In this approach, you will use a PC to build an Android package and upload it to your device. You can then run the game like any Android application. When it works correctly, you can upload the package you make to Google Play and other app stores.
Building an Android application consists of four steps:
Once you've finished these steps, you'll have a runnable Android package. You'll only need to run step 3 when you decide to make changes to your game's configuration or when configuring a new game entirely; you'll run step 4 most often, whenever you need to make a new build of your game.
There are three things you may need to manually download and install before you can build packages:
Java Development Kit. The Java Development Kit (JDK) contains several tools that are used by RAPT, including the tools used to generate keys and sign packages. It can be downloaded from:
Please note that the developer-focused JDK is different from the user-focused JRE, and you'll need the JDK to create Android packages.
Android Device Drivers. On Windows, you may want to install a device driver to access your device, although this is not necessary. Links to android device drivers can be found at:
On Linux or OS X, you won't need a device driver. If you can't access your device, you may need to read:
However, modern versions of Linux and OS X should just work.
The next step is to set up the Android SDK and the rest of your development environment. This step will:
This step requires Internet access.
To perform this step, choose "Install SDK & Create Keys" from the Android screen in the Ren'Py Launcher.
RAPT will report on what it's doing. It will also prompt you with warnings about licenses, and ask if you want it to generate a key.
Warning
The key generated by RAPT is created with a standard passphrase. You should really use keytool to generate your own signing keys.
At the very least, you should keep the android.keystore file in a safe place. You should also back it up, because without the key, you won't be able to upload the generated applications.
Before building a package, you must give Ren'Py some information about the Android build of your game. To do this, choose "Configure" from the Android screen of the Ren'Py launcher.
If you need to change the information - for example, if you release a new version of your game - you can re-run the configure command. Your previous choices will be remembered.
Finally, you can build and install the package. This is done with a by connecting your Android device to your computer, and choosing "Build & Install" from the Android screen of the Ren'Py launcher. (The first time you install, your Android device may ask you to authorize your computer to install applications.)
If you'd rather copy the game's apk file to your Android device manually, choose "Build Package" from the Android screen of the Ren'Py launcher. Then navigate to the 'bin' directory underneath the RAPT directory and copy the file mygame-release.apk into your Android Device. You will then need to find the .apk file in your Android device using a file manager application and open it to install the game.
Debug output can be found by running the adb command manually from the terminal. After installing the SDK, the adb command can be found as rapt-dir/android-sdk/platform-tools/adb. (On Windows, use adb.exe.)
To view output from Ren'Py, consider a command line like:
adb logcat -s python:*
There are several special files that are used to set the icon and presplash images used by the package. These files should be placed in the base directory.
If present, these are used in preference to android-icon.png for screens of the given densities. This allows for pixel-perfect icons. Available screen densities and the corresponding icon sizes are:
Ren'Py optionally supports the use of expansion APKs when used on a device supporting Google Play. Expansion APKs allow Google Play to host games larger than 50MB in size. Please see:
For information about expansion APKs work. Right now, only the main expansion APK is supported, giving a 2GB limit. When an Expansion APK is created, all game files will be placed in the expansion APK. Ren'Py will transparently use these files.
To configure your game to use Expansion APKs, you'll need to set two variables:
This is the Google Play license key associated with your application, which can be found on the "Services & APIs" tab associated with your application in the Google Play developer console. (Be sure to remove all spaces and newlines from the key.)
This should be a tuple of 20 bytes, where each byte is represented as an integer between -128 and 127. This is used to encrypt license information returned from Google Play.
A valid (if insecure) value for this variable is:
(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19)
RAPT will place the expansion APK on the device when installing the APK package on the device. The expansion APK will be an .obb file found inside the bin subdirectory of the RAPT directory.
In normal operation, Google Play will place the expansion APK on the device automatically when the user installs the application.