As mentioned earlier, using symbol tables can parse the call stack of so libraries such as libunity, but for the IL2CPP official package that enables engine code tailoring, the Build Id of symbol tables is inconsistent with the so library in apk.
Example
The following is the CRASH log of a Unity game. It can be seen that its packaged version is Unity 2020.3.12f1 (b3b2c6512326), an official package, and a 32-bit il2cpp package.
CRASH : Version '2020.3.12f1 (b3b2c6512326)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'armeabi-v7a' 01 pc 002dacc8 /data/app/com.azimiao.xxx==/lib/arm/libunity.so (BuildId: eaba752843d3dbc96e38e5fbc58237203d2015e0)
It can be seen that the Build Id of libunity.so in the package is eaba752843d3dbc96e38e5fbc58237203d2015e0
。
Go to the Editor folder of the same version and view the Build Id of the so library and the corresponding symbol table:
The library Build Id under the discovery editor is 53fa0bec678169de9c334e6263766d77b39e30f0
, which is different from the so library ID in Apk.
Therefore, it is not feasible to directly debug the symbol package in the Editor folder.
reason
After engine code clipping is enabled, the so library will be clipped when il2cpp is packaged.
resolvent
1. When packaging with UnityEditor
When packaging next time, in the Unity Build menu, select symbol table generation:
After packaging, there will be a corresponding symbol table zip package in the peer directory.
2. When exporting the project and packaging it with Android Studio Gradle
If the engine code clipping is enabled, do not close the Unity Editor after exporting the project, and obtain the symbol table from Temp:
#When engine code clipping is enabled: libunity:`/Temp/StagingArea/symbols/`
The libmain symbol table is still in the old place, namely PlaybackEngines in the Editor installation directory.
When Gradle is packaged, the symbol table of libil2cpp will be placed in unityLibrary/symbols/
Next.
If code clipping is not enabled, the symbol tables of libunity and libmain are in the same place, that is, PlaybackEngines in the editor installation directory.