谷歌崩溃前的谷歌分析最后一个屏幕

时间:2013-12-11 13:35:36

标签: ios iphone objective-c google-analytics nsrangeexception

我的应用程序因信息很差而崩溃。当应用程序崩溃时,有没有办法在谷歌分析中找到最后一个屏幕名称?我正在跟踪我的应用程序中的每个屏幕。这样我就可以知道bug存在于哪个控制器中。谢谢你的帮助!

修改 崩溃报告:

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

3 个答案:

答案 0 :(得分:25)

我在我的应用中使用Google Analytics遇到了类似的情况。我能够从Crashes and Exceptions页面获得更多信息,通过点击Secondary Dimension - &gt;显示所有错误。参与 - &gt;屏幕名称。这显示发生崩溃/错误的屏幕。

答案 1 :(得分:1)

您是否尝试过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.
}

答案 2 :(得分:0)

我遇到了类似的问题,并遇到了多层解决方案: Google Analytics提供双向异常机制。

1→手动跟踪:

@try {
  NSArray *myArray = [self getListOfStudents];
}
@catch (NSException *exception) {
    [tracker sendException:NO // Boolean indicates non-fatal exception.
            withDescription:@"Unable to connect %d: %@", connectionError, errorDescription];
}

2→自动跟踪:

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions  
(NSDictionary *)launchOptions {
  [GAI sharedInstance].trackUncaughtExceptions = YES; // Enable the automatic tracking 

  // ... rest follows here.
}

希望这有帮助