To pinpoint native functions in the stack trace to the Forms code in your app, you can use the mtouch
tool that comes with Xamarin.iOS. This tool can symbolicate the stack trace and map it to the corresponding source code.
Here are the steps to use mtouch
:
- Retrieve the crash log from the user's device.
- Open Xcode's Organizer and select the crash log.
- Right-click on the log and select "Show in Finder".
- Copy the
.ips
file to your development machine. - Open Terminal and navigate to the directory containing the
.ips
file. - Use the
symbolicatecrash
tool to symbolicate the crash log:
Replacexcrun atos -o YourAppName.app/YourAppName -arch arm64 -l <load-address> <memory-address>
<load-address>
with the load address of the binary (found in the crash log) and<memory-address>
with the memory address from the crash log. - The output of the
symbolicatecrash
tool will contain the stack trace with the corresponding source code file and line number.
References: