ios Crashlytics 集成问题
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17378685/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Crashlytics integration issue
提问by Vinh Nguyen
I have trouble integrating Crashlyticsinto my project.
我无法将Crashlytics集成到我的项目中。
Having follow instruction on website. But soon after installing the Crashlytics mac app, add new build script, paste script, then I build my project to continue, then the app crashed.
遵循网站上的说明。但是在安装 Crashlytics mac 应用程序后不久,添加新的构建脚本,粘贴脚本,然后我构建我的项目以继续,然后应用程序崩溃了。
Update: so back then, I forgot to initialize a Crashlytics instance in AppDelegate. It's totally my fault, not the service nor the client app (which is really really awesome by the way!). You can see answers below.
更新:当时,我忘记在 AppDelegate 中初始化 Crashlytics 实例。这完全是我的错,不是服务也不是客户端应用程序(顺便说一下,这真的很棒!)。你可以在下面看到答案。
回答by Patrick Goley
In the Build Phases of your target, click the + Add a Build Phase button in the bottom right and select Add Run Script. In the Crashlytics mac plugin, you should be given a run script to copy into this run script build phase. It will look like this:
在目标的 Build Phases 中,单击右下角的 + Add a Build Phase 按钮并选择 Add Run Script。在 Crashlytics mac 插件中,您应该获得一个运行脚本以复制到此运行脚本构建阶段。它看起来像这样:
./Crashlytics.framework/run <your api key>
Except your api key will be a 40 digit number provided by the plugin.
除了您的 api 密钥将是插件提供的 40 位数字。
in your app delegate:
在您的应用委托中:
#import <Crashlytics/Crashlytics.h>
In didFinishLaunchingWithOptions
write the following line to start your Crashlytics session.
在didFinishLaunchingWithOptions
写下面一行开始你Crashlytics会议。
[Crashlytics startWithAPIKey:<your api key>];
<your api key>
is the same number in the run script.
<your api key>
在运行脚本中是相同的数字。
回答by Vitaliy Gozhenko
Crashlytics collect crashes only when app run NOT in debug mode.
Crashlytics 仅在应用程序不在调试模式下运行时收集崩溃。
Here is quote from Crashlytics Knowelege Base: 3. Then, make sure that a debugger is not connected. By default, Xcode will launch applications and attach a debugger. This will prevent the crash from reporting -- detach it!
以下引用自 Crashlytics Knowelege Base: 3. 然后,确保未连接调试器。默认情况下,Xcode 将启动应用程序并附加调试器。这将阻止报告崩溃 - 分离它!
http://support.crashlytics.com/knowledgebase/articles/92522-is-there-a-quick-way-to-force-a-crash-
http://support.crashlytics.com/knowledgebase/articles/92522-is-there-a-quick-way-to-force-a-crash-
回答by Venk
Add Crashlytics framework in your Project and add your Crashlytics key in Build Phase -> Run Scriptas like in the following image.
在您的项目中添加 Crashlytics 框架,并在Build Phase -> Run Script 中添加您的 Crashlytics 密钥,如下图所示。
回答by Frankie
Follow the advice in the answers above but in addition: IF you installed crashlytics via cocoapods, make sure you are using the proper path in your build phase script.
遵循以上答案中的建议,但另外:如果您通过 cocoapods 安装了 crashlytics,请确保您在构建阶段脚本中使用正确的路径。
Use:
用:
./Pods/CrashlyticsFramework/Crashlytics.framework/run myLongKey
Instead Of:
代替:
./Crashlytics.framework/run myLongKey
回答by chancyWu
For me, there is something wrong with my Crashlytics.app Mac App. So i download one and reinstall it. then it works.
对我来说,我的 Crashlytics.app Mac 应用程序有问题。所以我下载了一个并重新安装它。那么它的工作原理。