In my app there are two targets:
Target 1 : MyApp - com.app.myapp
Target 2 : MyAppQA - com.app.myappQa
Email Id used for Fabric
Step to integrate Crashlytics:-
1.Add below cocoa pod
pod 'Fabric'
pod 'Crashlytics'
2.Add a Run Script into Build Phase(For this step you must have login into fabric than get API key)
"${PODS_ROOT}/Fabric/run" 8252525b24e2d6fagsdg101ea7faf49edefa84ff3ec342b0dgsdrergadc2bd8agsdg50671jhga2ee8c017ddgsdg33fbbb
3.Add Your API Key into info.plist file
<key>Fabric</key>
<dict>
<key>APIKey</key>
<string>your_key</string>
<key>Kits</key>
<array>
<dict>
<key>KitInfo</key>
<dict/>
<key>KitName</key>
<string>Crashlytics</string>
</dict>
</array>
</dict>
4.Add below code in AppDelegate file
AppDelegate.h:-
#import <Fabric/Fabric.h>
#import <Crashlytics/Crashlytics.h>
AppDelegate.m:-
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[Fabric with:@[[Crashlytics class]]]
}
5.For force crash write below code on any button click event of view controller,can not write into app delegate file
[[Crashlytics sharedInstance] crash];
6.Change build setting:
click on project target >> Build setting >> Chnage value of “Debug information Format” set it to “DWARF with dSYM file”
click on project >> Build setting >> Chnage value of “Debug information Format” set it to “DWARF with dSYM file”
7.How to crash app
Xcode's debugger prevents us from processing crash reports.
To make sure a crash is reported during your simulator testing:
⁃ Launch simulator (Run your project and install app in simulator)
⁃ Press stop (stop from Xcode )
⁃ Launch your app and force a crash (Now do not run project, just open simulator and launch your app from simulator and press button that u write code for crash ` [[Crashlytics sharedInstance] crash];`)
⁃ Relaunch the app from simulator (again run app from simulator not from Xcode project)
⁃ See the crash report in the web dashboard
Mike from Fabric here.
Once the dSYM is uploaded, we will start reprocessing any crashes from the last 7 days, so it should be visible by now.
For uploading dSYMs, including seeing any errors with the upload flow, you can use the upload-symbols
script located in the Fabric OS X app at Fabric.app/Contents/MacOS/upload-symbols
and in the Fabric CocoaPod payload at $PODS_ROOT/Fabric/upload-symbols
Run the script with the following to upload all dSYMs from a given folder:
find <directory-to-search-for-dsyms> -name "*.dSYM" | xargs -I \{\} /path/to/upload-symbols -a <api-key> -p <platform> \{\}
Documentation reference.