views:

115

answers:

3

HI,

any body knows how i can get crash logs from customers ? instead of manually asking them to sync and go to this directory and this directory and send it.

is there any automatic way to do that ?? . to send a crash report to our server by some mean.

+2  A: 

If you are talking about normal AppStore sales, Crash Reports are available through iTunes Connect.

Just go to "Manage Your Applications" -> "Your Application" -> And click "View Details" with the version currently active in the AppStore.

You will then get the details of your application, including the crash reports that are send in by your customers.

Wim Haanstra
+1  A: 

In iTunes, with their device tethered, if the user control-clicks on the name for their device, they will be able to select "Reset Warnings". Afterwards, a dialog box will pop up when the user next Syncs their device asking if it's OK to send data to Apple. If they click OK, then iTunes will upload all the crash logs from their device to Apple's servers.

Afterwards, you should be able to find your crash logs in iTunes Connect, and download them yourself. New crash logs will appear if your app still has problems and the user Syncs again, all automagically.

hotpaw2
+1  A: 

You can perform your own crash-logging with PLCrashReporter. Typically, you write the crash log to a file and then send it to a server the next time the app starts.

In order to prevent an infinite crash-reporting loop (there was one in an early version), you want to do things in a specific order:

  1. Read the file to memory and delete it. (Hopefully this won't crash.)
  2. Parse the crash report and send it to the server. (If it crashes now, the file has been deleted, so it shouldn't happen again.)
  3. Finally, enable crash reporting (so if it crashes in steps 1 or 2, the crash isn't logged).

In any case, you should have a "Oops, it crashed! Do you want to send a crash report?" dialog. I think automatic crash-logging is permitted by the default EULA, but it doesn't hurt to be nice to your users.

If you're worried about losing reports forever if the user says "no", instead of deleting the report, you can do logrotate-style style renaming (i.e. rename report8 to report9, rename report7 to report8, ..., rename report to report0). Then have a "send last N crash reports" button (either set N=10 or count the number of reports), so even if they've accidentally disabled it (or they had no internet at the time), they can still send the report.

tc.