可以肯定,你应该尝试从设备的崩溃日志。测试人员必须将设备与iTunes同步,然后导航到iTunes复制任何崩溃报告的文件夹。这取决于你使用的平台。
Mac OS X: ~/Library/Logs/CrashReporter/MobileDevice/<DEVICE_NAME>
Windows XP: C:\Documents and Settings\<USERNAME>\Application Data\Apple Computer\Logs\CrashReporter\MobileDevice\<DEVICE_NAME>
Windows Vista or 7: C:\Users\<USERNAME>\AppData\Roaming\Apple Computer\Logs\CrashReporter\MobileDevice\<DEVICE_NAME>
<USERNAME>
是计算机的用户的登录名。 <DEVICE_NAME>
是iPod touch或iPhone的名称,例如“我的iPhone”。
有一些方法可以自动收集崩溃报告,我贴在可能性的概述,这里另一个答案的一部分:Including custom data into iOS crash dumps
另外在iOS的模拟器进行测试时,可以自动存储警告。子类UIViewController
并在视图控制器出现时自动触发内存警告。
这里是如何做到这一点的一些示例代码:
#import "BaseViewController.h"
@interface BaseViewController (Private)
- (void)simulateMemoryWarning;
@end
@implementation BaseViewController
- (void) viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
#if TARGET_IPHONE_SIMULATOR
#if defined (CONFIGURATION_Debug)
// If we are running in the simulator and it's the DEBUG target
// then simulate a memory warning. Note that the DEBUG flag isn't
// defined by default. To define it add this Preprocessor Macro for
// the Debug target: DEBUG=1
[self simulateMemoryWarning];
#endif
#endif
}
- (void)simulateMemoryWarning {
#if TARGET_IPHONE_SIMULATOR
#if defined (CONFIGURATION_Debug)
SEL memoryWarningSel = @selector(_performMemoryWarning);
if ([[UIApplication sharedApplication] respondsToSelector:memoryWarningSel]) {
[[UIApplication sharedApplication] performSelector:memoryWarningSel];
} else {
NSLog(@"%@",@"Whoops UIApplication no loger responds to -_performMemoryWarning");
}
(CFStringRef)@"UISimulatedMemoryWarningNotification", NULL, NULL, true);
#endif
#endif
}
@end
继承自己的视图控制器时,而不是从UIViewController的子类现在用这个。此代码最初张贴在这里https://gist.github.com/956403并调整在Xcode 4.2.1工作从这里https://stackoverflow.com/a/2785175/474794
你试过从设备获取崩溃日志,并从它那里得到的任何信息? – adig 2012-02-15 11:53:22