gpt4 book ai didi

iphone - 发生当机事故时,TestFlight TFLog无法上传

转载 作者:行者123 更新时间:2023-12-03 15:53:57 25 4
gpt4 key购买 nike

当TestFlight崩溃时,我有一个日志希望与崩溃报告一起上传。

按照他们网站上的说明,我想出了这个解决方案,但似乎并没有将我传递的日志发送到TFLog。但是,它报告崩溃完全正常。

-(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]);
}

我哪里出问题了?还是有更好的方法呢?

最佳答案

我可以看到两个问题:

在崩溃之后,

  • testFlightHandleExceptions将被称为,并记录了日志。相反,您每次登录时(崩溃之前)都需要在TFLog内部调用LogManager。这就是使用它的方式。
  • 在信号处理程序中使用objc而不是可以。因此,大多数c甚至都不被允许。

  • 希望有帮助:)

    杰森

    关于iphone - 发生当机事故时,TestFlight TFLog无法上传,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15671664/

    25 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com