Skip to content

Commit fc257a2

Browse files
committed
Add entry for generating stacktrace on simulator to readme
1 parent b4d7b53 commit fc257a2

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

Images/pid.png

178 KB
Loading

README.md

+16-1
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,13 @@ Since Xcode properly supports wrapping Swift libraries, we can just submit it fr
196196

197197
This is only an issue if you must support iOS < 12.2.
198198

199-
## Generating a Stack Trace (Device only)
199+
## Generating a Stack Trace
200200

201201
If you experience a crash on your end it's very valuable for us to have as much information as possible to provide you with the best support experience.
202202
Such valuable information includes a stack trace of the crash. Here's a quick step-by-step guide, showing how to generate a stack trace in Visual Studio 2019:
203203

204+
- Device (Recommended)
205+
204206
1. In the Terminal app enter the following command: `touch ~/.mtouch-launch-with-lldb`. This will essentially let you use lldb to debug your application when it launches.
205207
2. Launch your app in debug mode in Visual Studio for Mac.
206208
3. Open the Application Output window in Visual Studio. It will ask you to execute another command in the Terminal.
@@ -209,6 +211,19 @@ Such valuable information includes a stack trace of the crash. Here's a quick st
209211

210212
If you want to remove lldb from your debug setup again you can simply run `rm ~/.mtouch-launch-with-lldb` in your Terminal.
211213

214+
215+
- Simulator
216+
217+
1. Launch your app in debug mode in Visual Studio for Mac.
218+
2. Open your Activity Monitor app.
219+
3. In the Activity Monitor app search for your app name in the search bar. To give an example, if I want to attach to our PSPDFCatalog example app I need to search for "PSPDFCatalog".
220+
4. Double-Click on the process to view the information window.
221+
5. Now you need to identify the PID (Process ID) of your process. The PID is the number included in the round brackets in the window title, e.g. if the title says "PSPDFCatalog (73389)", then 73389 is your PID.
222+
6. Now you need to open your Terminal app and enter the following command to attach lldb: `lldb -p YOUR-PID aux`. For the example case above this is what the full command would look like: `lldb -p 73389 aux`.
223+
<img width="50%" src="Images/pid.png"/>
224+
7. Once lldb is set up in the terminal window, you can simply use it like you would in Xcode.
225+
8. To get a stack trace you need to type `bt all`.
226+
212227
# Contributing
213228

214229
Please ensure [you signed our CLA](https://pspdfkit.com/guides/web/current/miscellaneous/contributing/) so we can accept your contributions.

0 commit comments

Comments
 (0)