Arm Community
Arm Community
  • Site
  • User
  • Site
  • Search
  • User
Arm Community blogs
Arm Community blogs
Mobile, Graphics, and Gaming blog Using Mali Graphics Debugger on a Non-rooted device
  • Blogs
  • Mentions
  • Sub-Groups
  • Tags
  • Jump...
  • Cancel
More blogs in Arm Community blogs
  • AI blog

  • Announcements

  • Architectures and Processors blog

  • Automotive blog

  • Embedded and Microcontrollers blog

  • Internet of Things (IoT) blog

  • Laptops and Desktops blog

  • Mobile, Graphics, and Gaming blog

  • Operating Systems blog

  • Servers and Cloud Computing blog

  • SoC Design and Simulation blog

  • Tools, Software and IDEs blog

Tell us what you think
Tags
  • Mali Graphics Debugger
  • Tutorial
Actions
  • RSS
  • More
  • Cancel
Related blog posts
Related forum threads

Using Mali Graphics Debugger on a Non-rooted device

Stephen Barton
Stephen Barton
April 21, 2016
2 minute read time.

Traditionally Mali Graphics Debugger (MGD) works on a rooted device, in this mode an interceptor layer sits between your application and the driver. Your application then calls into this interceptor layer and the interceptor then sends a copy of this data back to the MGD application and passes the call on to the driver.

Rooted and Non-rooted image Mali Graphics Debugger daemon

However, this isn't the only way that MGD can be used. The second option has all of the functionality of the first option with the added benefit that it will also work on a standard Android device with no modification. The trade-off is that you need access to the full source code of the application that you want to profile. This blog explores the second option so you can debug your applications on non-rooted devices.

Prerequisites

  1. Your computer should be setup for Android development, in particular:
    • The Android SDK and NDK should be installed
    • Your system path should include the adb binary.
  2. You should have access to the full source code of your application
  3. Your device must be running at least Android 4.2

Installation

  1. Copy the folder called android-non-root from the target directory in your MGD installation to your application's root folder.

  2. In your target application's Android.mk add the following code.

 include $(LOCAL_PATH)/../android-non-root/MGD.mk
  1. In your projects main activity class you need to add the following:
static 
{
               try 
               {
                               System.loadLibrary("MGD");
                }
                catch( UnsatisfiedLinkError e )
                {
                                // Feel free to remove this log message.
                                Log.i("[ MGD ]", "libMGD.so not loaded.");
                }
}
  1. Recompile the application and install it on your Android device

Running your application

The first thing we need to do is to install the MGDDaemon application on the target. The MGDDaemon application is responsible for sending the information from the interceptor library to the host. Without it the host won't receive any data.

  • cd into the android-non-root directory and run adb install -r MGDDaemon.apk
  • Then run adb forward from a command prompt adb forward tcp:5002 tcp:5002
  • Then launch the MGD Application. This should take you to a list of applications that it has detected have the MGD interceptor library correctly inserted. Before you click on one you need to press the Mali Graphics Debugger daemon switch to on.
Mali Graphics Debugger app list
  • Once pressing the switch you should be able to connect to the process in the MGD host and a new tab for your current trace should be created. At this point you just need to click on your application in the MGD daemon application and the trace should work.

Following these steps you should be able to use MGD on any Mali-based platform. If you have any issues please raise them on the Community and someone will be more than happy to assist you through the process.

Anonymous
Mobile, Graphics, and Gaming blog
  • Optimizing 3D scenes in Godot on Arm GPUs

    Clay John
    Clay John
    In part 1 of this series, learn how we utilized Arm Performance Studio to identify and resolve major performance issues in Godot’s Vulkan-based mobile renderer.
    • June 11, 2025
  • Bringing realistic clothing simulation to mobile: A new frontier for game developers

    Mina Dimova
    Mina Dimova
    Realistic clothing simulation on mobile—our neural GAT model delivers lifelike cloth motion without heavy physics or ground-truth data.
    • June 6, 2025
  • Join the Upscaling Revolution with Arm Accuracy Super Resolution (Arm ASR)

    Lisa Sheckleford
    Lisa Sheckleford
    With Arm ASR you can easily improve frames per second, enhance visual quality, and prevent thermal throttling for smoother, longer gameplay.
    • March 18, 2025