本文档链接:https://blog.csdn.net/W546556/article/details/126134376?spm=1001.2014.3001.5502
1.installation package
根据使用系统download package(for Windows,Linux,macOS ).
https://developer.arm.com/downloads/-/arm-mobile-studio-downloads
包里面包含3部分:1、GUI app;2、target interceptor components(配置到android的插件);3、样例;
官方说在安装包的target文件夹下有以下文件夹:
android/arm/ (for Android-based Arm V7(32-bit) target devices)
android/arm64/ (for Android-based Arm V8 or later(64-bit) target devices)
以上两个文件夹是我在安装包里面的target文件夹下找到的,下面的文件夹我没有找到,不过对于分析android devices没影响。
linux/arm_softfloat/ (for Linux-based Arm V7 / V8 (32-bit) target devices)
linux/arm_hardfloat/ (for Linux-based Arm V7 / V8 (32-bit) target devices)
linux/arm64_glibc/ (for Linux-based Arm V8 or later (64-bit) target devices used the glibc C library)
linux/arm64_musl/ (for Linux-based Arm V8 or later (64-bit) target devices used the MUSL C library)
2.host system requirements
using TCP/IP 可以连接 Linux target 来online analysis (默认port 5002),如果需要改变默认port,可以用 --port/-p option 然后在1-65535之间指定另一个port。(我后续用的也是这个port)
2.1可以increase the available memory(aim to 增加the maximum capture size)
2.1.1打开<install_directory>/gui/aga.ini
2.1.2 找到Java Virtual Machine(JVM),后面数值可以增加为4的倍数(我这里没改,用的默认值)
2.1.3可以创建一个文件夹作为the temporary storage,在Graphics Analyzer运行以后可以将data存储到这个文件夹中,默认的存储位置在Graphics Analyzer运行之后的 Edit > Preferences中可以修改。
3.Target system requirements
For Android:
Vulkan 1.0-1.2 for Android 9 and above.
OpenGL ES 2.0, 3.0, 3.1, 3.2 for Android 8 and above.
3.1 Prerequisites for Android targets
1. install ADB.
2.添加环境变量到host machine, 在Graphics Analyzer 中 Edit > Preferences.
3.手机开发者设置打开(后面要root),板子上的应用在这里好像都是non-debuggable application.所以后面就按照这个来讲。(我在查了资料以后,感觉好像我们的release版本的application debug 的默认为false,我不知道是不是这个原因,所以如果按照Preparing to capture debuggable applications章节中的操作到后面好像显示的是no devices select )
所以下面我们按照Preparing to capture non-debuggable applications中操作
4.Preparing to capture non-debuggable applications
在capture non-debuggale applications的时候我们必须install Vulkan or OpenGL ES layer driver
然后安装和配置aga-daemon来核对不同applications的信息。
The target device must be running an eng or userdebug build of Android 10 or later.
这里的eng or userdebug是Android的编译版本,我不知道应该怎么改或者怎么查询。所以我也没有修改这里(因为看不懂,哈哈哈,看不懂的我都不动)
接下来就是配置步骤,就只写我走完的。
To capture OpenGL ES applications, you must install the interceptor as a global OpenGL ES
layer on your device。
4.1 Copy libGLES_layer_aga.so onto the device then into the app folder ( under target )
cd /home/local/Arm_Mobile_Studio_2022.2_linux/Arm_Mobile_Studio_2022.2/graphics_analyzer/target/android/arm64
adb push libGLES_layer_aga.so /data/local/tmp
adb shell chmod 777 /data/local/tmp/libGLES_layer_aga.so
adb shell cp /data/local/tmp/libGLES_layer_aga.so /data/data/
<package_name> //这个package_name就是application 的名称,具体的应用可以用下面的语句查询
adb shell ls /data/data
4.2 Enable layers:
adb shell settings put global enable_gpu_debug_layers 1
adb shell settings put global gpu_debug_app <package_name>
//这里的package_name要和上面的一致
adb shell settings put global gpu_debug_layers_gles libGLES_layer_aga.so
4.3 Copy the daemon to your target device:
cd /home/local/Arm_Mobile_Studio_2022.2_linux/Arm_Mobile_Studio_2022.2/graphics_analyzer/target/android/arm64
adb push aga-daemon /data/local/tmp
4.4 Open a shell on your target device as the super user and install the daemon on the device, and grant appropriate permissions:
adb shell
su
cp /data/local/tmp/aga-daemon /system/bin
chmod 777 /system/bin/aga-daemon
4.5 Enter the following commands on the host machine:
adb forward tcp:5002 tcp:5002
adb shell aga-daemon
5 Next steps
Open Graphics Analyzer and the Device Manager, then open the Linux/IP tab to connect to the
default IP address 127.0.0.1 and port 5002.
6 Getting Start
Connecting Android devices with host devices.在打开Graphics Analyzer 的时候,官方文档说的是会自动连接,但是我在使用的时候没有提示自动连接。下面我说一下配置步骤:
1.Open Graphics Analyzer
2.Click Open the Device Manage
3.Click Linux / IP
4.Click Start Capture
此时打开你之前选中的APP 就可以抓帧了,具体的功能可以参考graphics_analyzer_guide_101545_5.11_00_en的4 5 6 章节。