我的应用程序崩溃,包含非常差的信息。当应用程序崩溃时,有没有一种方法可以在Google Analytics(分析)中找到最后一个屏幕名称?我正在跟踪应用程序中的每个屏幕。这样我就可以知道在哪个 Controller 中存在该错误。谢谢你的帮助!

编辑
崩溃报告:

NSRangeException Trace: <redacted> <redacted> <redacted> <redacted> <redacted> <redacted> <redacted> <redacted> <redacted> CFRunLoopRunSpec

最佳答案

您是否尝试过GA中的崩溃和异常分析?

您可以在此处找到有关该分析的更多详细信息:https://developers.google.com/analytics/devguides/collection/ios/v2/exceptions

页面中的跟踪代码示例:

@try {
  NSArray *highScores = [self getHighScores];
}
@catch (NSException *exception) {
    [tracker sendException:NO // Boolean indicates non-fatal exception.
            withDescription:@"Connection timout %d: %@", connectionError, errorDescription];
}

并自动跟踪未捕获的异常:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
  [GAI sharedInstance].sendUncaughtExceptions = YES; // Enable

  // ... the rest of your code, include other GAI properties you want to set.
}

10-07 17:05