Installing CodeWorks for Android

A walkthrough of the installation process of CodeWorks for Android

Windows
MacOS
Linux

Unreal Engine 4 (UE4) uses a special version of the Android Software Development Kit (SDK) called CodeWorks for Android, which contains all of the SDK and Native Development Kit (NDK) components needed to develop Android projects with Unreal Engine. Although we are currently using version 1R7u1 on Windows and Mac and 1R6u1 on Linux, we intend to use subsequent releases of CodeWorks.

If you have other versions of the Android SDK installed (or older versions of CodeWorks for Android), we recommend that you uninstall those and install CodeWorks for Android using installer that is distributed with Unreal Engine. In the following sections, we will walk you through the CodeWorks installation process.

If you already have the correct version of CodeWorks for Android installed, but your environment variables have been lost, you can simply point the Editor to the install locations using the Edit > Project Settings > Android SDK properties in the Editor.

Required Setup

Additional Setup for GitHub Users

If you downloaded Unreal Engine 4 from Github, you will need to perform the following steps before you can run the CodeWorks for Android 1R7u1 installer. Please note that this applies to both Windows and Mac based PCs that download the Unreal Engine 4 source code from Github. If you are using the binary build downloaded from the launcher, then you can skip this required setup and immediately install CodeWorks for Android 1R7u1.

  1. Once Unreal Engine 4 has been downloaded from Github and extracted, run the Setup.bat file to download the required files as well as the CodeWorks for Android 1R7u1 installer.

  2. After the Setup.bat has finished running, locate and run the CodeWorks for Android 1R7u1 installer, following the instructions below.

Before you can install CodeWorks for Android 1R7u1 on Mac, you will need to install Java 8. It can be downloaded from here .

Additional Setup for GitHub Users

If you downloaded Unreal Engine 4 from Github you will need to perform the following steps before you can run the CodeWorks for Android 1R7u1 installer. Please note that the following applies to both Windows- and Mac-based PCs that download the Unreal Engine 4 source code from Github. If you are using the binary build downloaded from the launcher, you can skip this process and proceed to the next steps.

  1. Once Unreal Engine 4 has been downloaded from Github and extracted, run the Setup.command file to download the required files as well as the CodeWorks for Android 1R7u1 installer.

  2. After Setup.command has finished running, locate and run the CodeWorks for Android 1R7u1 installer, following the instructions below.

Make sure that you have Java Development Kit 8 (JDK 8) installed, and that your JAVA_HOME environment variable set to the correct version of the Java Development Kit (JDK). To verify that JAVA_HOME is set properly, enter echo $JAVA_HOME into the terminal. If you don't see the correct JDK version, download JDK 8 and install it on your Linux computer, making sure to set the JAVA_HOME environment variable to the newly installed JDK.

Before continuing, please note that Android Vulkan on Linux is not supported at this time.

Installation

It is highly recommended that you install CodeWorks for Android while the Editor and Launcher are both closed to ensure that there are no problems with the install.

  1. TNavigate to the Engine > Extras > Android folder.

    The CodeWorks for Android 1R7u1 installer requires an installation of Visual Studio to complete successfully.

    Install Type

    Location

    Binary

    [EngineInstallLocation]\Unreal Engine[EngineVersion]\Engine\Extras\Android

    GitHub

    [EngineSyncLocation]\UE4\Engine\Extras\Android

  2. Double-click the CodeWorksforAndroid-1R7u1-windows.exe file to initiate the install process.

    Click to enlarge image.

  3. Click the Next button on the first window to begin the installation process.

    Click to enlarge image.

  4. Click the Next button to continue.

    Click to enlarge image.

  5. Set a location to download and install CodeWorks for Android 1R7u1. You can leave this set to the default location.

  6. Select whether or not you want to enable data usage collection, and then click the Next button. Whether you choose to enable it or not will not affect further setup, and this is entirely at the discretion of your team.

    Click to enlarge image.

  7. Make sure that you are installing CodeWorks for Android 1R7u1 and click the Next button.

    Click to enlarge image.

  8. Click on the check mark box labeled Accept All if you agree with the license terms and then press the Accept button.

    Click to enlarge image.

  9. A new window will be displayed showing the download and install progress of the required CodeWorks for Android 1R7u1 tools. You will need an internet connection to complete this portion. Depending on the speed of your internet connection, this could take anywhere from a few minutes to a few hours to complete.

    Click to enlarge image.

  10. Click the Next button to continue the installation.

    Click to enlarge image.

  11. Click the Finish button to complete the installation.

    Click to enlarge image.

  12. Click the Yes button to restart your PC.

    AndroidWorks_12.png

    If you downloaded Unreal Engine 4 from Github, when CodeWorks for Android 1R7u1 has finished installing, restart your PC or Mac so the environment variables are set and then run the Setup.bat file one more time to download the required Android Development files.

  1. Navigate to the Engine > Extras > AndroidWorks folder.

    Install Type

    Location

    Binary

    [EngineInstallLocation]\Unreal Engine[EngineVersion]\Engine\Extras\AndroidWorks\Mac

    GitHub

    [EngineSyncLocation\UE4\Engine\Extras\AndroidWorks\Mac

  2. Double-click the CodeWorks for Android 1R7u1-osx.dmg to load the CodeWorks for Android 1R7u1 installer.

    Click to enlarge image.

  3. Double-click the CodeWorks for Android 1R7u1 installer icon to start the installation process.

    Click to enlarge image.

  4. Click Next.

    Click to enlarge image.

  5. Click Next.

    Click to enlarge image.

  6. Specify a location where CodeWorks for Android 1R7u1 should be installed, then press the Next button. You may use the default location.

    Click to enlarge image.

  7. When the CodeWorks for Android 1R7u1 Component Manager is displayed, click the Next button to begin the download and install process.

    Click to enlarge image.

  8. Click the check mark box labeled Accept All if you agree with the license terms, and then click the Accept button.

    Click to enlarge image.

  9. The CodeWorks for Android 1R7u1 Component Manager will now begin to download and install the required tools. You will need an internet connection to complete this portion. Depending on the speed of your internet connection, this could take a few minutes to a few hours to complete.

  10. Once everything has been installed, the following window will be displayed. Click the Next button to continue.

    Click to enlarge image.

  11. Click the Finish button to complete the installation.

    Click to enlarge image.

    If you downloaded Unreal Engine 4 from Github, when CodeWorks for Android 1R7u1 has finished installing, restart your Mac so the environment variables are set and then run the Setup.command file one more time to download the required Android Development files.

Once CodeWorks for Android 1R7u1 has finished installing, you will need to edit your Bash file by doing the following:

  1. Open up the Mac Terminal.

    JH_01.png

  2. In the Terminal type, nano ~/.bash_profile.

    JH_02.png

  3. Scroll down to the end of the file and add, export JAVA_HOME="/Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home".

    JH_03.png

    The above is the default path, if you installed somewhere else you need to make sure that your path points to the jdk1.8.0_121.jdk/Contents/Home.

  4. Press CTRL + X to exit the bash and then press Y to save the changes then press Enter to confirm the changes and finally restart your Mac.

  5. When your Mac restart, open up the Terminal and then input Monitor and press enter. If everything has been setup correctly you should see the Android Device Monitor splash screen.

    JH_04.png

While Unreal Engine on Windows and Mac uses CodeWorks for Android 1R7u1, Unreal Engine on Linux currently uses 1R6u1.

  1. Open the Terminal and use the cd command to set your working directory to the [UE4Root] folder that contains the compiled engine.

    Click to enlarge image.

  2. From inside of the [UE4Root] folder, navigate to the CodeWorks for Android binary file (CodeWorksforAndroid-1R6u1-linux-x64.run) by entering the following string into the terminal: cd Engine/Extras/AndroidWorks/Linux.

    Click to enlarge image.

  3. Now, enter ls -l into the terminal, displaying a long listing of the directory's contents.

    Click to enlarge image.

    The file's permission settings tell you that CodeWorksforAndroid-1R6u1-linux-x64.run is not ready for execution. Before you can run the CodeWorks for Android binary, you need to change the file's access rights to allow for "execute" permissions.

  4. To change the file permission settings of CodeWorksforAndroid-1R6u1-linux-x64.run, enabling it to run like a normal executable, enter chmod +x CodeWorksforAndroid-1R6u1-linux-x64.run into the terimal.

    Click to enlarge image.

    If you want to learn more about the chmod command, enter man chmod into the terminal to read the manual page covering how chmod works.

  5. Now, enter ls -l into the terminal.

    Click to enlarge image.

    The file's permission settings highlighted in the image indicate that the CodeWorks for Android 1R6u1 binary file is ready for execution.

  6. To run the CodeWorks for Android binary, enter ./CodeWorksforAndroid-1R6u1-linux-x64.run into the terminal.

    Click to enlarge image.

    Please make sure that your computer has a valid Internet connection prior to moving onto the next step.

  7. After the CodeWorks for Android 1R6u1 binary unpacks the NVIDIA CodeWorks for Android installer, you'll see the Installer Welcome window, prompting you to click either Next or Cancel.

    Click to enlarge image.

  8. From the Installer Welcome window, click the Next button to begin the installation process.

    Click to enlarge image.

  9. Now, from the Android Developer's Welcome Window, click the Next button to continue the installation process.

    Click to enlarge image.

  10. Specify the directory where CodeWorks for Android should be installed.

    Click to enlarge image.

  11. Click the Next button to download and install CodeWorks on your computer.

    Click to enlarge image.

  12. Verify that you're installing CodeWorks for Android 1R6u1, then click the Next button from the Android Component Manager window.

    Click to enlarge image.

  13. After the Terms and Conditions window appears, take some time to read through all of the Terms and Conditions before selecting the Accept All check box.

    Click to enlarge image.

  14. Now, click the Accept button to begin the installation process.

    Click to enlarge image.

  15. Once the installer completes the installation process, go ahead and click the Next > button to proceed.

    Click to enlarge image.

  16. After the Installation Complete window opens, click the Finish button to complete the installation.

    Click to enlarge image.

  17. Make sure to reboot your computer before moving onto the next step.

    Click to enlarge image.

    If you don't want to use Ubuntu's GUI, you can restart your computer by entering sudo reboot into the terminal.

End Result

Once you have completed this installation, you will have all of the required Android SDKs installed and ready for use in building an Unreal Engine project for Android devices.

Select Skin
Light
Dark

Welcome to the new Unreal Engine 4 Documentation site!

We're working on lots of new features including a feedback system so you can tell us how we are doing. It's not quite ready for use in the wild yet, so head over to the Documentation Feedback forum to tell us about this page or call out any issues you are encountering in the meantime.

We'll be sure to let you know when the new system is up and running.

Post Feedback