6

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

编辑 崩溃报告:

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

3 回答 3

25

我在我的应用中使用 Google Analytics 时遇到了类似的情况。我能够从显示所有错误的崩溃和异常页面获取更多信息,方法是单击二级维度 -> 参与度 -> 屏幕名称。这显示了发生崩溃/错误的屏幕。

于 2014-03-27T18:52:11.180 回答
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.
}
于 2013-12-11T19:22:42.947 回答
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.
}

希望这可以帮助

于 2014-10-06T07:18:46.893 回答