Mali Graphics Debugger There is a debugger for Android devices that uses Mali for the GPU called "Mali Graphics Debugger".
This time, I learned how to use this debugger, so I summarized it. The second half also touches on how to use Unity-created apps.
This time, I did it for the 32-bit version (armeabi-v7a) on an Android device that is not rooted. By the way, the one I used is the Galaxy S6.
First, download the Mali Graphics Debugger from the ARM Site (http://malideveloper.arm.com/resources/tools/mali-graphics-debugger/). Execute the downloaded file and install the necessary files. You can leave the default installation destination.
Of the folder you downloaded earlier 'C:\Program Files\ARM\Mali Developer Tools\Mali Graphics Debugger v4.1.0\target\android-non-root\arm\armeabi-v7a' I think there is a file called libMGD.so in it. This file 'C:\android\arm\armeabi-v7a' Move to the folder called.
Launch Android Studio and open the file of the app you want to debug. Connect your Android device to your PC and enter the following command at the Android Studio command line.
adb forward tcp:5002 tcp:5002
Install the daemon program on the Android device side. Enter the following command on the command line.
adb install -r C:\Program Files\ARM\Mali Developer Tools\Mali Graphics Debugger v4.1.0\target\android-non-root\MGDDaemon.apk
Add the following jniLibs dir to your app's build.gradle
build.gradle
sourceSets.main.jniLibs.srcDir 'C:\\Android\\arm'
\ May have to be changed to a yen mark
Add the following code to the main activity of the app.
MainActivity.java
static {
try {
System.loadLibrary("MGD");
}
catch( UnsatisfiedLinkError e ){
// Feel free to remove this log message.
Log.e("[ MGD ]", "libMGD.so not loaded.");
}
}
Install the app on your Android device. Then open the target app from the MGD Daemon app.
On the PC 'C:\Program Files\ARM\Mali Developer Tools\Mali Graphics Debugger v4.1.0' Please start Launch.bat in. After startup, select Connect to target from Debug in the upper left menu to start tracing.
In the case of an app created with Unity, it worked fine when I ran it according to this person's site.
Building a Unity Application with Mali Graphics Debugger Support
If you can read English, I think that you can execute it without any problem if you read this site. It's okay to do what is written here instead of step 6 above.
I will summarize only what I needed in Japanese.
Do not perform step 6 above. Instead, create a new StandardActivity.java class and write the following code.
StandardActivity.java
package test.application;
import com.unity3d.player.UnityPlayerActivity;
import android.os.Bundle;
import android.util.Log;
public class StandardActivity extends UnityPlayerActivity
{
protected void onCreate(Bundle savedInstanceState)
{
try
{
System.loadLibrary("MGD");
}
catch( UnsatisfiedLinkError e)
{
Log.i("[ MGD ]", "libMGD.so not loaded.");
}
super.onCreate(savedInstanceState);
}
}
Rewrite android: name of activity in AndroidManifest.xml.
AndroidManifest.xml
activity android:name=”StandardActivity”
After that, you can debug by following the above procedure.
Recommended Posts