HockeySDK Warning - How to test crash reporting? - ios

I got this warning when running my application with HockeyApp integration:
[HockeySDK] WARNING: Detecting crashes is NOT enabled due to running the app with a debugger attached.
Crash reports are not sent and no alert is displayed when opening the app again.
Any one have any idea how to resolve this issue?

This has very simple reasons:
If you are running the app with Xcode attached, your app is connected to lldb, Xcode's debugger. When lldb is attached, it will of course do its job as a debugger and catch any exception or crash that occurs. This means that the crash can never reach the HockeyApp SDK or any other crash reporting SDK while lldb is attached at the same time.
The solution is also pretty simple. If you just want to make sure the SDK is integrated properly and will catch crashes, do the following:
Do a quick "Build & Run" to install the current version of the app on the simulator or device.
Click the "Stop" button in Xcode to stop the debugging session.
Manually start the app on the device or simulator by tapping or clicking the app icon.
Cause a crash.
Restart the app. Now the HockeySDK should process the crash report and show a dialog to approve crash log sending.
One thing to keep in mind: Make sure to not make the app crash immediately after app start as this would not give the SDK enough time to process and send the crash report before crashing again.

Hockey app sdk by default does not send report when a debugger is attached. There is nothing wrong with this.
It will send report when a archive build that release to ur tester cause a crash. I personally think this should and remain as this because you are trying to track crashes from your tester not when you are developing.

Related

Looking for local crashlog when device was tethered to Xcode

Question:
When iOS device is tethered to Xcode and crashed after building (app loaded in, was not a crash ON build), where is the crash log saved to?
Here's my predicament with some context:
I pulled a user's crashlog of EXC_BAD_ACCESS for my app. I symbolicated and I've narrowed it down to get a rough idea but now I'm trying to re-create the issue via building in Xcode to my iOS device (not simulator). Normally the app does not crash on load in (this crash isn't easy to replicate) but I've been able to have the app crash consistently with Address Sanitizer enabled, and it always crashed and points to a line in a thread with an men address -- not anything I don't already have from previous debugging.
However, one time I had a crash occur where it highlighted what func was called as well as every func called in the stack trace and what file this was all occurring in. In haste I hit build again in Xcode before I saved the output however... and now I cannot replicate.
The crashlog wasn't saved locally to my iOS device as I was still tethered to Xcode, and I checked ~Library/Logs/CrashReporter/MobileDevice but that did not contain them either.
I need find where Xcode would've saved these logs on my mac (if it did at all)?
Typically all the crash dumps are stored in Settings -> Privacy -> Diagnostics & Usage -> Diagnostics & Usage Data
Scroll down the list and find the crash file with your app name.
This link might be helpful - https://developer.apple.com/library/content/qa/qa1747/_index.html

iPhone 6S/iOS 9.1 : Can't find crash log with code 0xdeadfa11

I just discovered it is possible to force quit a frozen application on iOS.
According to the Technical Note TN2151 I should get a crash log on my device with code 0xdeadfa11 but I have no such crashlog.
The exception code 0xdeadfa11 indicated that an application has been force quit by the user. Force quits occur when the user first holds down the On/Off button until "slide to power off" appears, then holds down the Home button. It's reasonable to assume that the user has done this because the application has become unresponsive, but it's not guaranteed - force quit will work on any application.
Note: Terminating a suspended app by removing it from the multitasking tray does not generate a crash report. Once an app has suspended, it is eligible for termination by iOS at any time, so no crash report will be generated.
Is it an apple bug or are there some additional steps I am missing ?
EDIT
If I check the device console after the force quit I see this log :
ReportCrash[2074] : Stackshot code 0xdeadfa11 not tasked,
ignoring
Seems that for whatever reason iOS decides not to generate deadfall crash report.
I tried to generate force quit on three devices:
1)iPad 3 (iOS 8)
2)iPad Air (iOS 9.2)
3)iPhone 5 (iOS 9.2.1)
When I tried to generate crash on all three devices via xcode while debugging, no crash log was generate instead I got the following error message:
Message from debugger: Terminated due to signal 9
which I think similar to your message:
Service exited due to signal: Killed: 9
and when I tried to generate crash without debugging and seeing log via device logs then I found:
1)For iPad 3 (iOS 8): Crash log was generated, screenshot attached.
2)For iPad Air (iOS 9.2): Crash log was not generated.
3)For iPhone 5 (iOS 9.2.1): Crash log was not generated.
As per my understanding, when you try to generate force quit via xcode while debugging, it does not get generated and for case try to generate crash while without debugging directly in your device then it might be os (iOS 9) specific reason.
P.S: And Service exited due to signal: Killed: 9 is generated due to memory issues, and high CPU consumption tasks.
Hope this might help you further.
The Apple note says that Terminating a suspended app by removing it from the multitasking tray does NOT generate a crash report. I don't think you will have a log.

iOS app crashes immediately when debugging AppleWatch app on Simulator (not on device)

I've got an AppleWatch app that is working fine in Simulator and Device, but when I call openParentApplication, it appears that the parent app is crashing immediately because I see this in the console output:
The UIApplicationDelegate in the iPhone App never called reply()...
When I try to manually launch the parent iOS app in the Simulator it crashes there too immediately. I don't have time to attach the debugger (which is already attached to the AppleWatch app) to see what is crashing it. Note that the parent app runs fine when the AppleWatch is running and I'm using a real iPhone. I can also run the app fine on the Simulator when not debugging the AppleWatch app.
I've tried resetting the Simulator, but problem persists.
I'm just not sure how to debug this. Any help is appreciated.
Start an explicit background task in handleWatchKitRequest. Otherwise, your app gets killed before it reaches reply().
Refer to this post for a code example on how to create a background task.
In turns out that after commenting out all code in the parent app's didFinishLaunching and stripping almost all code out of the watch extension, the problem was indeed at a lower level.
The Simulator has a
Debug | Open System Log...
menu option that showed the crash logs, which contained:
Dyld Error Message: Library not loaded:
#rpath/MyCore.framework/MyCore Referenced from:
/Users/me/Library/Developer/CoreSimulator/Devices/A2061705-DDDF-477C-9AAA-E50GG43A6350/data/Containers/Bundle/Application/DEB7FB25-8233-4B9F-8DAB-9FF8AE42BF33/MyApp.app/MyApp
Reason: no suitable image found. Did find:
/Users/me/Library/Developer/CoreSimulator/Devices/A2061705-DDDF-477C-9AAA-E50FF43A6350/data/Containers/Bundle/Application/DEB7FB25-8553-4B9F-8DAB-9FF8AE95BF33/MyApp.app/Frameworks/MyCore.framework/MyCore:
mach-o, but wrong architecture
My Swift app has a few dependent Swift projects that are used by the app and extension. Getting the Swift frameworks to link has been a major pain. I've included the dependent frameworks (compiled in the same workspace) as embedded binaries. This works when running on the device, or on the Simulator, but not when running in this hybrid watch app + parent app Simulator context.
I changed the embedded binary references to point to the frameworks under ...DerivedData...Debug-iphonesimulator, as opposed to ...DerivedData...Debug-iphoneos, and the problem went away.
Still hoping the Swift framework story will improve.
Are you seeing an actual crash? That message has appeared for me plenty of times without the host app crashing.
99% of the time, that error appears because developers aren't opening a background task to complete their work in handleWatchKitRequest. Without the background task, the OS kills your app in the background before it has a chance to reply.

iOS7 xCode 5, how to get crash logs from a development build on device?

I playtested the game that I'm making on my development iPad, while it was not connected to xCode. There were 4 instances where the game just crashed/closed.
If I remember correctly, these crashes should create a crash report which can be visible in the Organizer>Devices>Device Logs. However, upon checking this, I see only 1 (instead of 4) reports, most of which are marked as "unknown".
Is there a way for me to refresh the device logs, or make sure that my device does keep logs of all crashes that happened while not connected to xCode?

iOS App crashes when setting breakpoint in Xcode

I have an app I'm developing where setting a breakpoint in Xcode while the app is running causes it to crash. At least I assume it is a crash. There is nothing in the console saying what happened. The app just terminates.
Note that the break point is not being hit, just the act of setting it causes this.
I've developed many apps and this is the first to act like this. Does anyone have any ideas what could be happening or how to figure this out? It is really slowing down my debugging.
I'm assuming you're using Xcode 4.x. Try going into your scheme's settings and switch to a different debugger (GDB if you have LLDB currently set, or vice versa).
If that doesn't work, we need more info:
which version of Xcode and iOS are you using?
does the problem occur in the Simulator or on your device, or both?
have you tried placing a breakpoint in different places in your code?
As far as I can tell, it's a debugger issue. So your app does not actually crash, it's the debug session that crashes which causes the app to terminate. You can observe a similar effect when you hit Stop in Xcode or disconnect your device while an app is attached to the debugger in Xcode.
Might be an issue with mismatching Xcode and iOS versions. Please provide more info about your environment to help diagnose the problem.

Resources