Keywords: Xcode | crash logs | symbolication
Abstract: This article provides a detailed guide on how to import and view crash logs in Xcode 6 and later versions, addressing the common issue of users being unable to locate the crash log view after upgrading from Xcode 5. It explains the background of interface changes in Xcode 6 that led to the migration of crash log management, offers step-by-step instructions for importing logs via the Devices window, and supplements with advanced techniques for manual crash report symbolication. Covering everything from basic operations to troubleshooting, it helps developers efficiently handle iOS app crashes.
With the upgrade from Xcode 5 to 6, its interface architecture underwent significant restructuring, particularly the separation of device management from the Organizer. This left many developers finding that the familiar crash log view had disappeared. In Xcode 5, users could easily drag and drop crash logs for viewing via the Organizer, but after the upgrade, this intuitive feature seemed absent. In reality, crash log management was not removed but relocated to a new position, requiring adaptation to a new workflow.
Accessing Crash Logs in Xcode 6+
To access crash logs, first open the Devices window. Select Xcode > Window > Devices from the menu bar, or use the shortcut Shift+Cmd+2. In the left panel, choose a connected iOS device (e.g., iPhone or iPad). After selecting the device, the right side displays device details; click the View Device Logs button. This opens the log viewer, which includes tabs such as "All Logs," "Crash Logs," and "Performance Logs." By default, all logs are shown, and users can filter to quickly locate crash records.
Importing External Crash Log Files
Importing external crash log files is a straightforward drag-and-drop operation. Ensure the log file has the correct .crash extension—sometimes files may be saved as .txt or .ips formats and need renaming to comply. In the log viewer, simply drag the file into the log list area. The system automatically handles the import process and displays a new entry in the list. For easier management, it's advisable to clean up old logs before importing: select unnecessary entries and press Delete to remove them, but this should only be done for non-critical historical data.
Manual Symbolication of Crash Reports
When automatic symbolication fails or finer control is needed, crash reports can be handled manually. Create a separate folder and copy the app's executable (e.g., Foo.app) and corresponding debug symbol file (Foo.app.dSYM) from the .xcarchive, along with the crash report file. Open the crash report in a text editor, locate the Binary Images: section, and copy the starting address from the first line (e.g., 0xd7000). In the terminal, navigate to the folder and run the command: xcrun atos -o Foo.app/Foo -arch arm64 -l 0xd7000 0x0033f9bb, where the -arch parameter is determined based on the hardware architecture in the crash report. For batch addresses, save them to a text file (e.g., addr.txt) and use the -f option to symbolic them all at once.
Verification and Troubleshooting
To ensure symbolication accuracy, verification is recommended. In the crash report, find the end of the Thread 0 call stack; typically, the second line shows the app's main function address, e.g., 34 Foo 0x0033f9bb 0xd7000 + 2525627. Symbolicating this address should return main(); otherwise, check the load address and architecture settings. For apps with Bitcode enabled, it may be necessary to download the corresponding dSYM file from iTunes Connect, extract the executable binary, and use it in the atos command instead of the original file.
Using the symbolicatecrash Script
Another approach is to use Xcode's built-in symbolicatecrash script. First, find the script path via the command find /Applications/Xcode.app -name symbolicatecrash, with a common location being /Applications/Xcode.app/Contents/SharedFrameworks/DVTFoundation.framework/Versions/A/Resources/symbolicatecrash. Copy the script to the working folder, set the environment variable export DEVELOPER_DIR=$(xcode-select --print-path), then run ./symbolicatecrash -v MyApp-Crash-log.crash MyApp.dSYM. This automatically generates symbolized logs, outputting them to the terminal for analysis.
In summary, Xcode 6 and later versions integrate crash log management through the Devices window. While interface changes initially caused confusion, operations remain efficient. Combined with manual symbolication techniques, developers can comprehensively address various crash analysis scenarios, enhancing debugging efficiency.