iPhone - detecting crashes, prompting user to send crash log
Are there any libraries out there that would allow end 开发者_如何学Pythonusers to send crash reports to developers?
For example, a user is using my app. It crashes. On boot up, a library loads before everything else and notices there is a crash report and prompts the user to send the crash log to me.
Is this possible? I think the Facebook app does something like this.
Thanks!
You actually have access to crash logs in iTunes Connect. Log in, go to Manage your Applications, pick an app, "View Details", and you should see a "Crash Reports" link to the right of the details pane.
That said, Apple only refreshes these daily, and will only give you access to reports of the most common crashes. If you want finer control, or need the user to submit reports directly, try plcrashreporter. You could ask the user for a submission this way, or just go ahead and automatically send all reports to your server. From the plcrashreporter site:
Introduction
Plausile CrashReporter implements in-process crash reporting on the iPhone and Mac OS X. The following features are supported:
Implemented as an in-process signal handler. Does not interfer with debugging in gdb.. Handles both uncaught Objective-C exceptions and fatal signals (SIGSEGV, SIGBUS, etc). Full thread state for all active threads (backtraces, register dumps) is provided. If your application crashes, a crash report will be written. When the application is next run, you may check for a pending crash report, and submit the report to your own HTTP server, send an e-mail, or even introspect the report locally.
Another alternative is HopToad - they host the site that will accept the crash reports and notify you.
iOS 5 and later Tapping Settings > General > About > Diagnostics & Usage will allow you to choose between Automatically Send and Don't Send.
iOS 4 and earlier By default, opting in is a one-time decision. If you'd like to change your decision, you can reset warnings for your iOS 4 or earlier device so that you will be asked again.
How to reset warnings within iTunes Connect your iPad, iPhone, or iPod touch to your PC or Mac. Wait until your device has appeared on the left side of the iTunes window under Devices. Right-click (Mac or PC) or Control-click (Mac) the icon for your device. From the shortcut menu, choose Reset Warnings:
The next time you sync after resetting warnings, you should see:
To disagree and stop sending Apple diagnostic and usage information, click No Thanks.
If you don't see the window above Disconnect your device from your computer. Open an application on your device. Press and hold the Sleep/Wake button until the red slider appears, and then press and hold the Home button until the application quits. If you're using iOS 2.x or earlier, press and hold the Home button until the application quits. Connect your device and sync it with iTunes. The option to agree or disagree to diagnostics collection should appear again.
Chearz;)
Another alternative that we have been using at my company is Crittercism - http://www.crittercism.com/. They have been very responsive to feature requests and have really helped us prioritize which issues to address.
Their SDK also has the functionality I set out to look for so long ago! :)
精彩评论