简体   繁体   English

发生当机时,TestFlight TFLog无法上传

[英]TestFlight TFLog not uploading when there is a crash

When TestFlight crashes I have a log I wish to upload with its crash report. 当TestFlight崩溃时,我有一个日志希望与崩溃报告一起上传。

Following the instructions on their website I came up with this solution, but it doesn't seem to be sending the log I pass to TFLog. 按照他们网站上的说明,我想出了这个解决方案,但似乎并没有将我传递的日志发送到TFLog。 However it reports the crash just fine. 但是,它报告崩溃完全正常。

-(void)applicationDidFinishLaunching:(UIApplication *)application {

    /*Setup crash handlers for TestFlight so we can send logs. */
    NSSetUncaughtExceptionHandler(&testFlightHandleExceptions);
    // create the signal action structure
    struct sigaction newSignalAction;
    // initialize the signal action structure
    memset(&newSignalAction, 0, sizeof(newSignalAction));
    // set SignalHandler as the handler in the signal action structure
    newSignalAction.sa_handler = &testFlightSignalHandler;
    // set SignalHandler as the handlers for SIGABRT, SIGILL and SIGBUS
    sigaction(SIGABRT, &newSignalAction, NULL);
    sigaction(SIGILL, &newSignalAction, NULL);
    sigaction(SIGBUS, &newSignalAction, NULL);
    [TestFlight takeOff:TESTFLIGHT_API_KEY];
}

void testFlightHandleExceptions(NSException *exception) {
    [LogManager e: @"Sending crash to TestFlight" Tag:@"AppDelegate"];
    TFLog(@"%@",[LogManager getLog]);
}

Where have I gone wrong? 我哪里出问题了? Or is there a better way in doing this? 还是有更好的方法呢?

There are two problems I can see with this: 我可以看到两个问题:

  1. testFlightHandleExceptions is going to be called after the crash and it's logs are recorded. testFlightHandleExceptions会崩溃之后被调用,它的日志记录。 Instead you need to be calling TFLog inside of LogManager every time you log something (before the crash). 相反,您每次在日志记录之前(崩溃之前)都需要在LogManager内部调用TFLog That's how it's meant to be used. 这就是使用它的方式。

  2. It is not ok to use objc inside of a signal handler. 这是正常使用objc信号处理程序内。 For that matter, most c isn't even allowed. 因此,大多数c甚至都不被允许。

Hope that helps :) 希望有帮助:)

Jason 杰森

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 使用新目标将IPA上载到TestFlight时出错 - Error When Uploading IPA to TestFlight Using New Target 在iOS TestFlight设备上发生SIGSEGV崩溃 - SIGSEGV Crash on iOS TestFlight Device 应用程序崩溃但没有TestFlight崩溃报告 - App Crashes But No TestFlight Crash Report 为什么从Testflight运行时此应用程序崩溃100%,也许从Xcode崩溃10% - Why would this app crash 100% when running from Testflight, maybe 10% from Xcode 如果已经通过Testflight在设备上安装了应用程序,则从Xcode启动时应用程序崩溃 - App crash when launching from Xcode if app already installed on device through Testflight iTunes连接 - 我在哪里可以看到TestFlight构建的崩溃报告? - iTunes connect - Where can I see the crash reports for TestFlight builds? 用testflight轻按按钮时,应用崩溃 - App crashes when button tapped with testflight 仅在 TestFlight/Prod 中崩溃 - UIButton 初始化覆盖 - 在展开可选时意外发现 nil - Crash only in TestFlight/Prod - UIButton Init Override - Unexpectedly found nil while unwrapping an optional 设备令牌为零,当我从 testflight 下载应用程序时..? - Device token is nil, when I download the app from testflight..? 在testflightapp.com的哪里可以看到TFLog输出? - Where can I see TFLog output on testflightapp.com?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM