Building an Unreal Engine Application with Mali Graphics Debugger Support

By Thomas Poulet ARM Mali Graphics

ARM Mali Graphics Debugger (MGD) allows developers to trace Vulkan, OpenGL ES, EGL and OpenCL API calls in their application to understand their effect frame-by-frame and to help identify possible bottlenecks in the code. This blog explains how developers can add support for MGD on a non-rooted device, to their Unreal Engine application.


The plan we are going to follow is very simple:

  • Add the interceptor library to the build system
  • Edit the activity to load the interceptor library
  • Install the MGD Daemon application on the target device


For our first step, we will need to download a version of Unreal Engine from the sources available on GitHub. For more information on this step, please see Epic’s guide.
Once you have a working copy of the engine, we can focus on getting MGD working. You will first need to locate the android-non-root folder in your MGD installation directory, and your Unreal Engine installation folder (where you cloned the repository). Copy the android-non-root folder to Engine\Build\Android\Java\.
Next, we will need to change the Android makefile to ensure that the interceptor is properly packaged inside the engine build. For this, edit the Android.mk file under “Engine/Build/Android/Java/jni/”  add this line at the end, include $(LOCAL_PATH)/../android-non-root/MGD.mk. It should look like this:


We will now specify to the main game activity that it needs to load the MGD library, locate GameActivity.java inside Engine\Build\Android\Java\src\com\epicgames\ue4\ and edit the onCreate function to look like so:

Engine-wise we are all set, we will now prepare our device. Install the MGD daemon on the target phone using the following command whilst being in the android-non-root folder:

Now before running your app you will need to run this command from the host PC (please ensure that the device is visible by running adb devices first):

Run the MGD daemon application on the target phone and activate the daemon itself:


At that point you can connect it to MGD on the host PC, start your application and begin debugging it. Please refer to the MGD manual for more in-depth information on how to use it.

Following these steps you should be able to use MGD with Unreal applications on any Mali-based platform. To learn more or ask a question, please contact the ARM Mali graphics Connected Community.


Recent Posts

Get Set for the Summer #ue4jam!

Get ready to buckle down and put your development skills to the test! Ne


Unreal Developers Shine at Develop:Brighton 2018

Numerous developers displayed their titles in the Unreal Networking Lounge ...

Unreal Powers On-the-Fly Compositing with Handheld Camera

Going beyond green screens: ARwall’s rear-projection system provides in-cam...