CocoaPods์ผ๋ก ์ ์ฉ
1. Firebase ํ๋ก์ ํธ ๋ง๋ค๊ธฐ => https://firebase.google.com/docs/ios/setup#create-firebase-project
2. Firebase์ ์ฑ ๋ฑ๋ก => https://firebase.google.com/docs/ios/setup#register-app
3. GoogleService-Info.plist ํ๋ก์ ํธ์ ์ถ๊ฐ => https://firebase.google.com/docs/ios/setup#add-config-file
4. PodFile์ pod 'firebase/crashlytics' ์ถ๊ฐ
5. AppDelegate์ Firebase์ ์ฐ๋ํ๋ ์ฝ๋ ์ถ๊ฐ => https://firebase.google.com/docs/ios/setup#initialize-firebase
6. dSYM ํ์ผ ์๋ ์ ๋ก๋๋ฅผ ์ํด Xcode ์ค์
- TARGETS > Build Settings > All >'debug information format > ๋๋ฒ๊ทธ, ๋ฆด๋ฆฌ์ฆ ๋ชจ๋ DWARF with dSYM File๋ก ์ค์
7. ๋น๋ ์คํฌ๋ฆฝํธ ์์ฑ
Build Phases > + ๋ฒํผ > 'New Run Script Phase' > 'Run Script' > ์คํฌ๋ฆฝํธ ์ ๋ ฅ
/bin/sh
"${PODS_ROOT}/FirebaseCrashlytics/run"
Input Files
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}
$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
8. Crashlytics ๋๋ฒ๊น ๋ก๊น ์ฌ์ฉ ์ค์
- Product > Scheme > Edit Scheme > Run > Arguments > 'Arguments Passed On Launch' > '-FIRDebugEnabled' ์ถ๊ฐ
9. ๋น์ ์ ์ข ๋ฃํ์ฌ Crashlytics ์ค์ ์๋ฃ
SPM์ผ๋ก ์ ์ฉ
1. Firebase ํ๋ก์ ํธ ๋ง๋ค๊ธฐ => https://firebase.google.com/docs/ios/setup#create-firebase-project
2. Firebase์ ์ฑ ๋ฑ๋ก => https://firebase.google.com/docs/ios/setup#register-app
3. GoogleService-Info.plist ํ๋ก์ ํธ์ ์ถ๊ฐ => https://firebase.google.com/docs/ios/setup#add-config-file
4. AppDelegate์ Firebase์ ์ฐ๋ํ๋ ์ฝ๋ ์ถ๊ฐ => https://firebase.google.com/docs/ios/setup#initialize-firebase
5. Xcode File(ํ์ผ) > Add Packages(ํจํค์ง ์ถ๊ฐ)๋ก ์ด๋ํ์ฌ Firebase Apple ํ๋ซํผ SDK ์ ์ฅ์ ์ถ๊ฐ
https://github.com/firebase/firebase-ios-sdk
6. Xcode์์ ๋น๋์ ์ฌ์ฉํ dSYM์ ์์ฑ
- TARGETS(๋์) ๋ชฉ๋ก์์ ๊ธฐ๋ณธ ๋น๋ ๋์์ ์ ํ
- Build Settings(๋น๋ ์ค์ ) ํญ์ ํด๋ฆญํ ํ ๋ค์ ๋จ๊ณ๋ฅผ ์๋ฃํ์ฌ Xcode์์ ๋น๋์ ์ฌ์ฉํ dSYM์ ์์ฑํ๋๋ก All(๋ชจ๋)์ ํด๋ฆญํ ํ debug information format์ ๊ฒ์ํฉ๋๋ค.
- ๋ชจ๋ ๋น๋ ์ ํ์ Debug Information Format(๋๋ฒ๊ทธ ์ ๋ณด ํ์)์ DWARF with dSYM File๋ก ์ค์
7. Xcode์์ dSYM์ ์ฒ๋ฆฌํ๊ณ ํ์ผ์ ์ ๋ก๋ํ ์ ์๋๋ก ์ค์
- Build Phases > + > New Run Script Phase(์ ์คํ ์คํฌ๋ฆฝํธ ๋จ๊ณ)๋ฅผ ํด๋ฆญ
- Shell(์ ธ) ๋ผ๋ฒจ ์๋์ ์๋ ์คํฌ๋ฆฝํธ ํ๋์์ ์คํฌ๋ฆฝํธ(ํ๋ก์ ํธ์ dSYM ํ์ผ์ ์ฒ๋ฆฌํ๊ณ ํ์ผ์ Crashlytics์ ์ ๋ก๋ํด๋ผ) ๋ฅผ ์ถ๊ฐ
"${BUILD_DIR%/Build/*}/SourcePackages/checkouts/firebase-ios-sdk/Crashlytics/run"
- Input Files(์ ๋ ฅ ํ์ผ) ์น์ ์์ ๋ค์ ํ์ผ ์์น์ ๊ฒฝ๋ก๋ฅผ ์ถ๊ฐ
# ํ๋ก์ ํธ์ dSYM ํ์ผ ์์น
${DWARF_DSYM_FOLDER_PATH}/${DWARF_DSYM_FILE_NAME}/Contents/Resources/DWARF/${TARGET_NAME}
# ํ๋ก์ ํธ์ ๋น๋๋ Info.plist ํ์ผ ์์น
$(SRCROOT)/$(BUILT_PRODUCTS_DIR)/$(INFOPLIST_PATH)
8. ๋น์ ์ ์ข ๋ฃํ์ฌ Crashlytics ์ค์ ์๋ฃ
์ฐธ๊ณ ์๋ฃ
https://velog.io/@pleasureofcoding/iOS-Firebase-Crashlytics-%EC%84%A4%EC%A0%95%ED%95%98%EA%B8%B0
https://firebase.google.com/docs/crashlytics/get-started?hl=ko&platform=ios
https://ios-development.tistory.com/261
'iOS ๐ > iOS' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Xcode 13, No StoryBoard Settings with SceneDelegate (0) | 2022.04.12 |
---|---|
Debugging 1 : dSYM, DWARF (0) | 2022.03.29 |
SPM, Swift Package Manager (0) | 2022.03.29 |
MVVM-C (0) | 2022.03.28 |
Xcode 13, No StoryBoard Settings without SceneDelegate (0) | 2022.03.22 |