When I get new symbol file, i will add it into the google drive sharing folder, and update the collected-symbol-files.md. You can follow this repository to get the latest update.
What's the use of system symbol files
It's for symbolicating those system frameworks in your iOS crash report.
We can make out that the problem was caused by UISearchDisplayController'sdelegate. It'sassign. This crash happened when tap search bar while poping the viewController.
The problem of symbolicating system frameworks
You may find out that you can't always symbolicate those system code. There're several problems:
If you want to symbolicate system frameworks in your crash report, you need the corresponding system symbols, matching the OS Version and CPU architecture.
Most system symbols can only be got from physical iOS devices. Apple never offer a website to download these symbols.
You can download old versions of Xcode and pull out the SDK image you need. Usually the symbols are part of the latest Xcode release, but Apple doesn't always provide Xcode updates when an iOS version only contains bug-fixes but no API changes. And since Apple replace system framework with tbd files after Xcode7, this trick doesn't work any more. Read this for more details: Xcode software image for user iOS in order to symbolicate iOS calls, Missing iOS symbols at “~/Library/Developer/Xcode/iOS DeviceSupport”. (Update: Actually, since Xcode 6, there is no real device SDK. So you can only get SDKs before iOS 7 from Xcode.)
When you first connect a new iOS device to Xcode, Xcode will show a loading message: Processing symbol files(after Xcode 9, it's Preparing debugger support for Device). It's copying system symbol files from device to your Mac's path: ~/Library/Developer/Xcode/iOS DeviceSupport.
That means you need a corresponding device if you want to symbolicate a crash report. There are 132 versions from 7.0 (11A465) to 10.2.1 (14D27)(most OS version contains three different type:arm64,armv7s,armv7. Aarm64device contains botharm64andarmv7s). That's obviously very difficult to collect them all.
That's the meaning of this repository, to share these system symbols.
update: Since iOS 10, iOS firmware are not encrypted, so we can get symbols from firmware now.
How to use
When you need to symbolicate a crash report, check the Code Type and OS Version section. Such as:Code Type: ARM-64OS Version: iOS 10.2 (14C82). That means you need arm64version symbols of 10.2 (14C82)system.
Find the package in my sharing folder and extract it to ~/Library/Developer/Xcode/iOS DeviceSupport. (Check the file's name and path, it should be~/Library/Developer/Xcode/iOS DeviceSupport/10.2 (14C82)/Symbols).
Use Xcode'ssymbolicatecrash tool to symbolicate your crash report. This tool will search system symbols in theiOS DeviceSupportpath automatically. Read this to learn how to usesymbolicatecrash: Symbolicating an iOS Crash Report.
Extract Symbols from Firmware
If the symbols you need is not in the list, you can get from firmware by yourself.
We can almost get all systems' symbols from firmwares now. And after iOS 10, firmwares are not encrypted any more. You can also get symbols of beta firmwares.
How to extract symbols from firmware:
Download the ipsw firmware (not OTA files), corresponding the system version you need
Uncompress the firmware file as zip, find the biggest dmg file(it's the iOS system file image)
If the version of the firmare system is higher than iOS 10, the dmg is not encrypted. So just double click to load the image, and go to step 6
If the version is lower than iOS 10, you have to decrypt the dmg file with corresponding firmware key. Find key in Firmware_Keys(UnderRoot Filesystemsection in the corresponding firmware page)
Decrypt dmg file with its key. You can use the dmgtool in tools:./dmg extract encrypted.dmg decrypted.dmg -k <firmware_key>. Then you get the decrypted.dmg, double click to load the image
In the image folder, go to System/Library/Caches/com.apple.dyld/, you can get dyld_shared_cache_arm64, dyld_shared_cache_armv7s,dyld_shared_cache_armv7, they are the compressed system frameworks
Uncompress dyld_shared_cache_armxxx with dsc_extractor tool in Apple's dyld project. I put it in tools:./dsc_extractor ./dyld_shared_cache_armxxx ./output
If you need all arm64, armv7s and armv7 of frameworks, you need to extract dyld_shared_cache_arm64, dyld_shared_cache_armv7s,dyld_shared_cache_armv7all. Before Xcode 11, dsc_extractorwill merge different architectures into same files when extracting to a same directory
After Xcode 11 for iOS 13.2, dsc_extractor won't merge different architectures files. We need to merge symbols with lipo command. Try merge_symbols.sh : sh merge_symbols.sh <path_to_extracted_arm64e_symbols> <path_to_extracted_arm64_symbols> Since iOS 11 doesn't support armv7 any more, we only care about arm64 and arm64e. For arm64e symbols, just add arm64e suffix in the directory name. 13.3.1 (17D50) arm64e for arm64e, and 13.3.1 (17D50) for arm64.
Then you get all system frameworks of this firmware in output folder. Put those files into a folder as a symbol file hierarchy, such as 12.0 (16A5288q)/Symbols/, and you can use this folder to symbolicate crash report now
Thank you for reading. If this project is helpful, please give me a star :)
My Other Framework
I'd like to introduce ZIKRouter, a iOS dependency injection framework. ZIKRouter helps your app split into loosely-coupled components. you can see how to perfectly decouple your modules in the demo.
请发表评论