How can I determine what crashed Mobile Safari? - iphone

My website crashes on Mobile Safari, but works fine on desktop.
How can I determine why it is crashing?

What you can do when Safari quits unexpectedly showing your website:
1. Safari debug console
Use Safari's debug console. Switch on in your iPhone: Settings->Safari->Advanced->Debug console=on.
For me it says
2 HTML errors on Line 6 (Viewport argument value "device-width" for key "width" not recognized and Viewport argument value "no" for key "user-scalable" not recognized.)
2 HTML tips also n Line 6.
Debug console will be shown next time you check your web page using Safari.
2. Web Inspector (from iOS 6.0)
If it is getting more complicated to find out the problem in your webpage use Web Inspector to Debug Mobile Safari. It is a great tutorial for this.
Using IOS Simulator I found that for this particular website all iOS version I have, 5.0, 5.1 and also 6.1, runs the page correctly with crashing the page but on device (iOS 5.0.1) still crashes.
My device runs on iOS 5, so I cannot access Web Inspector, but it is certainly the next step for you to check your site on device and check Web Inspector on your machine.
3. Use iPhone Configuration Utility's Console
You can downlod Apple's iPhone Configuration Utility, then you can access your mobile's Console during Safari test.
Checking your site I see couple of memory warnings which eventually lead to Safari crash.
4a. Use Xcode's debug facility
Using Xcode you can also access the device's Console (Window->Organizer->Devices tab->Console).
Your case reported the following on console:
Apr 30 10:15:18 unknown kernel[0] <Debug>: launchd[2489] Builtin profile: MobileSafari (sandbox)
Apr 30 10:15:38 unknown MobileSafari[2489] <Warning>: Received memory warning.
Apr 30 10:15:39 unknown SpringBoard[15] <Warning>: Received memory warning.
Apr 30 10:15:50 unknown UserEventAgent[12] <Notice>: jetsam: kernel termination snapshot being created
Apr 30 10:15:50 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobilephone[0xb2a4]) Exited: Killed: 9
Apr 30 10:15:50 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:com.apple.mobilesafari[0xf755]) Exited: Killed: 9
Apr 30 10:15:50 unknown SpringBoard[15] <Warning>: Application 'Phone' exited abnormally with signal 9: Killed: 9
Apr 30 10:15:50 unknown SpringBoard[15] <Warning>: Application 'Safari' exited abnormally with signal 9: Killed: 9
Apr 30 10:15:52 unknown ReportCrash[2491] <Error>: Saved crashreport to /Library/Logs/CrashReporter/LowMemory-2013-04-30-101552.plist using uid: 0 gid: 0, synthetic_euid: 0 egid: 0
4b. Use Xcode's debug facility, Instruments
Another sophisticated way to check what's happening is to use Instruments.
Checking again your site I see many-many low memory warning reported by Safari before it quits. Sadly it doesn't directy help you discovering the web site problem but maybe helps to find Safari open bug reports.

I had success debugging a crash by doing the following:
connect to the phones console using xcode
find the crash in the console, in my case is looks like this:
Sep 2 17:16:21 Edwards-iPhone ReportCrash[7093] : Saved report to /Library/Logs/CrashReporter/JetsamEvent-2015-09-02-171621.ips
Then go to Diagnostics in settings (settings > privacy > diagnostics & usage data - that's on ios 8.4. It's in a different place on other versions) and find the crash file.
This removes the need to guess at which crash reports the one you experienced.

Related

xcode 5 - debug on device failed using jailcoder

Using xcode 5.1.1, and trying to debug my app on a jailbroken iphone 4 (7.1.2).
I installed Jailcoder (from the facebook page) and patched both my xcode and my project with it.
The project is just a simple view application (trying to get that to work first).
I run the app using my iphone as the build setting, the app loads on my phone but then it exits with
2014-07-28 16:00:42.831 testLiveDebug[11384:60b] otherApps (null)
Opening the console in the organizer i see this error:
Jul 28 15:51:45 my-iPhone com.apple.launchd[1] (UIKitApplication:com.debug.testLiveDebug[0xe02e][11348]) <Error>: (UIKitApplication:com.debug.testLiveDebug[0xe02e]) Exited with code: 45
Jul 28 15:51:45 my-iPhone com.apple.launchd[1] (UIKitApplication:com.debug.testLiveDebug[0xe02e]) <Notice>: (UIKitApplication:com.debug.testLiveDebug[0xe02e]) Throttling respawn: Will start in 2147483641 seconds
Jul 28 15:51:45 my-iPhone com.apple.debugserver-310.2[11346] <Warning>: 38 +6.392165 sec [2c52/1307]: error: ::read ( -1, 0x35a9ec, 18446744069414585344 ) => -1 err = Bad file descriptor (0x00000009)
Jul 28 15:51:45 my-iPhone com.apple.debugserver-310.2[11346] <Warning>: Exiting.
Jul 28 15:51:45 my-iPhone backboardd[11188] <Warning>: Application 'UIKitApplication:com.debug.testLiveDebug[0xe02e]' exited abnormally with exit status 45
I have Appsync for 7.0+ and also tried with AppSync Unified....but still i get the same error.
In the past (ios6) this whole process worked fine with jailcoder.
Any idea why i cant live debug on the device ?
-Thanks
Resupported 4+ was causing the error....after i uninstalled it everything was working fine.

Flurry analytics doesn't seem to log events in ios 4.2

In the past days I'm having issues with flurry api, and it seems that it
stopped working.
My build ios version is 4.2 and the Flurry version is Flurry iPhone SDK v4.0.4
In my code I'm doing this:
[Flurry setDebugLogEnabled:YES];
[Flurry startSession:#"MY_API_KEY"];
[Flurry logEvent:#"Entered app"];
And I'm getting:
Oct 12 18:17:40 unknown myApp[2981] <Warning>: Flurry: startSession
called for the first time
Oct 12 18:17:40 unknown myApp[2981] <Warning>: Flurry: Start session
called with apiKey[MY_API_KEY]
Oct 12 18:17:40 unknown myApp[2981] <Warning>: Flurry: Trim white space
and use apiKey[MY_API_KEY]
Oct 12 18:17:40 unknown myApp[2981] <Warning>: initial network status [1]
=========
Oct 12 18:17:40 unknown myApp[2981] <Warning>: FlurrySession: Add session
with startTime[2012-10-11 19:36:13 +0000] to saved sessions
Oct 12 18:17:40 unknown myApp[2981] <Error>: -[__NSCFNumber length]:
unrecognized selector sent to instance 0x4504a0
Oct 12 18:17:40 unknown myApp[2981] <Warning>: Flurry: Finish starting
session with apiKey[MY_API_KEY]
Oct 12 18:17:40 unknown myApp[2981] <Warning>: FlurrySession: dealloc
session
And no event Entered app seems to be logged or viewed in debug, except:
Oct 12 18:23:11 unknown myApp[2981] <Warning>: Flurry: setGender[M]
Oct 12 18:25:03 unknown myApp[3001] <Warning>: Flurry: setUserID[5]
Also if running it in xcode it stopped in this line
[Flurry startSession:#"MY_API_KEY"];
And only after pressing twice the continue program execution the program
continues to run.
In the iphone (without the xcode) it runs smoothly but the debug log is the
same, and no events seems to be logged.
Any suggestions?
p.s. Tried to talk to flurry support about this, no one got back to me for 3 days now...
Good to see that the issue got resolved. It seems that for some reason your mail did not reach Flurry. For any further issues, please feel free to write to support#flurry.com. We'll make sure your query is answered within 24 hours. (Full disclosure: I work in the Support team at Flurry)
It seems that [Flurry setUserID:currUserId] when currUserId was NSNumber* (due to passing of id currUserId), caused the problem.
Always make sure that you pass the value NSString* to Flurry, also in events values....
If we use flurry event in background,we should enable
[Flurry setBackgroundSessionEnabled:YES]; under didFinishLaunchingWithOptions in Appdelegate.
To enable background session the error of [_NSCF Number length] is avoided,it can able to track the event.

Unable to connect jailbroken iPhone 3G running iOS 4.2.1 to Xcode for development

I have jailbroken iPhone 3G and recently I've updated the firmware to 4.2.1 (was 3.1.2). Now I'm trying to add this iPhone to Xcode organizer to use it for development. Xcode runs the process of collecting debug information for the device but gets stuck copying file (2 of 2) somewhere about 80%. I switch to Console and see nothing that could relate to the problem. Where can I get more information about what's happeining?
Update:
I've tried to reconnect the device and this time there is multiple lines in Console:
Sun Nov 20 02:13:57 unknown lockdownd[17] <Error>: 2ffea000 handle_connection: Could not receive USB message #6 from DTDKSymbolHelper. Killing connection
Sun Nov 20 02:13:57 unknown com.apple.mobile.lockdown[17] <Notice>: Could not receive size of message
Sun Nov 20 02:13:57 unknown /Developer/Library/Daemons/DTFetchSymbols[1859] <Notice>: Found paths:
Sun Nov 20 02:13:57 unknown /Developer/Library/Daemons/DTFetchSymbols[1859] <Notice>: /usr/lib/dyld
Sun Nov 20 02:13:57 unknown /Developer/Library/Daemons/DTFetchSymbols[1859] <Notice>: /System/Library/Caches/com.apple.dyld/dyld_shared_cache_armv6
Sun Nov 20 02:14:59 unknown lockdownd[17] <Error>: 2ff68000 handle_connection: Could not receive USB message #6 from MDCrashReportTool. Killing connection
Googling did not give any results.
Make sure you have an SDK installed on your desktop that supports the iOS version installed on your iPhone. Otherwise, Xcode will not recognize your device. You can also launch Organizer and it will tell you whats going on and if your device (OS) is supported.
Is it possible that you disabled any launchdaemons?
If you disabled an accessory launch daemon then I'm guessing it could affect xcode connecting to the device.
Have you tried to Un-Jailbreak it.

"security policy error" on iPhone and iPod Touch

I'm getting an "Error from Debugger: Error launching remote program: security policy error" when I try to run my app on my ipod touch. The provisions look in order, and the app builds to my iphone 3gs just fine. The app used to build just fine to my ipod touch, so I'm flustered what could have changed and wondering if anyone has any thoughts on what might be causing this issue. The build logs are below.
Mon Mar 15 14:25:54 unknown com.apple.debugserver-43[449] <Warning>: Connecting to com.apple.debugserver service...
Mon Mar 15 14:25:55 unknown SpringBoard[24] <Warning>: Unable to launch com.yourcompany.Unearthed because it has an invalid code signature, inadequate entitlements or its profile has not been explicitly trusted by the user.
Mon Mar 15 14:25:55 unknown com.apple.debugserver-43[449] <Error>: error: unable to launch the application with CFBundleIdentifier 'com.yourcompany.Unearthed' sbs_error = 9
Mon Mar 15 14:25:55 unknown com.apple.debugserver-43[449] <Warning>: 1 [01c1/0903]: RNBRunLoopLaunchInferior DNBProcessLaunch() returned error: ''
Mon Mar 15 14:25:55 unknown com.apple.debugserver-43[449] <Warning>: error: failed to launch process (null): security policy error
Mon Mar 15 14:26:03 unknown MobileSafari[72] <Warning>: void SendDelegateMessage(NSInvocation*): delegate (webView:decidePolicyForNavigationAction:request:frame:decisionListener:) failed to return after waiting 10 seconds. main run loop mode: UITrackingRunLoopMode
Have you checked that the iPod doesn't contain any expired provisioning profiles? I've had trouble in the past when building to devices that contain expired provisioning profiles.
Try removing any expired profiles and see if it helps.
Delete all old expire provisioning profile..
We "fixed" this by installing the release version (built for ad-hoc distribution) and then debugging from Xcode. It installs and updates the application fine from now. 3GS with 4.3.2.

iPhone SDK strange console message launchd_core_logic.c

I am running release version of the app on the iPhone, it works fine. There is no error messages in the XCode debugger:
Running…
Switching to thread 11779
Switching to thread 11779
sharedlibrary apply-load-rules all
(gdb) continue
Switching to thread 12291
Switching to thread 11779
Switching to thread 13059
Debugger stopped.
Program exited with status value:0.
However I see these messages in the console of iPhone when connect to it via Organizer:
WWed Oct 7 15:37:01 unknown com.apple.launchd[1] : (UIKitApplication:com.blah.blah[0x830c]) Bug: launchd_core_logic.c:2649 (23909):10
Wed Oct 7 15:37:01 unknown com.apple.launchd[1] : (UIKitApplication:com.blah.blah[0x830c]) Working around 5020256. Assuming the job crashed.
Wed Oct 7 15:37:01 unknown com.apple.launchd[1] : (UIKitApplication:com.blah.blah[0x830c]) Job appears to have crashed: Segmentation fault
Wed Oct 7 15:37:01 unknown com.apple.debugserver-43[6124] : 1 [17ec/1603]: error: ::read ( 7, 0x28091c, 1024 ) => -1 err = Bad file descriptor (0x00000009)
Wed Oct 7 15:37:01 unknown SpringBoard[25] : Application 'blah' exited abnormally with signal 11: Segmentation fault
I have tried Apple's UICatalog sample and empty view based app generated by the XCode. They both report exactly the same message as my code in the console. So this is NOT my app related.
There is no crash logs created, so I don't think it is a crash.
What is it? Is it a problem, even though application works perfectly fine?
Thanks
I had the same problem and it gave me problems when testing in app purchases. In the end I found out that I was running the program with an iPhone Distribution code signing instead of an iPhone Development code signing. When I changed that for the Debug configuration (and removed the Entitlements.plist) it worked again. Hope it helps.
It's not a problem. I have similar messages on my console all the time. And as you said it's not your apps fault, so as long as you app runs ok there is no problem.
The message is not from your app, it's from the com.apple.launchd. I think that only the xcode console output is really relevant for you.