Titanium ios app with 5.2.0 sdk crashes at launch in run or distrib mode but works fine in debug or simulator - ios

The device is iPhone 6s Plus with iOS 9.2. Using Titanium Studio, when I run in debug mode and stepping through code, the app runs fine. However, when I simply "run" it (device connected to laptop via USB) or install the .ipa file in adhoc distribution, the app crashes as soon as it is launched. There is absolutely no log generated in Titanium when "run". And there is little to no relevant information in Xcode too when the installed .ipa is run. Here is the log from Xcode:
Mar 18 09:42:51 ThisUser-iPhone-6s-Plus SpringBoard[58] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Mar 18 09:42:51 ThisUser-iPhone-6s-Plus SpringBoard[58] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Mar 18 09:42:51 ThisUser-iPhone-6s-Plus securityd[96] <Error>: secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Mar 18 09:42:51 ThisUser-iPhone-6s-Plus securityd[96] <Error>: secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Mar 18 09:42:51 ThisUser-iPhone-6s-Plus amfid[178] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Mar 18 09:42:51 ThisUser-iPhone-6s-Plus kernel[0] <Notice>: xpcproxy[311] Container: /private/var/mobile/Containers/Data/Application/8A3B415C-2259-A7NA-8XXD-8X5XFXCAJBDK (sandbox)
Mar 18 09:42:51 ThisUser-iPhone-6s-Plus MySampleApp[311] <Warning>: [DEBUG] Reading stylesheet from: /var/mobile/Containers/Bundle/Application/H3POBLF9-PB0N-1KF5-4RXY-EEDRD90GC79X/MySampleApp.app/stylesheet.plist
Mar 18 09:42:51 ThisUser-iPhone-6s-Plus iap2d[176] <Warning>: process com.mysampleco.mysampleapp is now running the foreground
Mar 18 09:42:51 ThisUser-iPhone-6s-Plus UserEventAgent[26] <Warning>: Tracking com.mysampleco.mysampleapp (via activity)
Mar 18 09:42:51 ThisUser-iPhone-6s-Plus MySampleApp[311] <Warning>: [INFO] MySampleApp/1.0.1 (5.2.0.384775e)
Mar 18 09:42:51 ThisUser-iPhone-6s-Plus MySampleApp[311] <Warning>: [DEBUG] Loading: /var/mobile/Containers/Bundle/Application/H3POBLF9-PB0N-1KF5-4RXY-EEDRD90GC79X/MySampleApp.app/app.js, Resource: app_js
Mar 18 09:42:52 ThisUser-iPhone-6s-Plus kernel[0] <Notice>: Sandbox: MySampleApp(311) deny(1) sysctl-read kern.proc.all.0
Mar 18 09:42:52 ThisUser-iPhone-6s-Plus kernel[0] <Notice>: Sandbox: MySampleApp(311) deny(1) process-info-pidinfo 0
Mar 18 09:42:52 ThisUser-iPhone-6s-Plus kernel[0] <Notice>: Sandbox: MySampleApp(311) deny(1) sysctl-read kern.proc.pid.0
Mar 18 09:42:52 ThisUser-iPhone-6s-Plus mediaserverd[28] <Notice>: '' com.mysampleco.mysampleapp(pid = 311) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None
Mar 18 09:42:52 ThisUser-iPhone-6s-Plus SpringBoard[58] <Warning>: HW kbd: Failed to set (null) as keyboard focus
Mar 18 09:42:52 ThisUser-iPhone-6s-Plus mediaserverd[28] <Notice>: 'FigPlayer - 34' (pid = 34) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None
Mar 18 09:42:52 ThisUser-iPhone-6s-Plus com.apple.xpc.launchd[1] (UIKitApplication:com.mysampleco.mysampleapp[0x72dd][311]) <Warning>: Service exited with abnormal code: 1
Mar 18 09:42:52 ThisUser-iPhone-6s-Plus SpringBoard[58] <Warning>: Application 'UIKitApplication:com.mysampleco.mysampleapp[0x72dd]' exited voluntarily.
Mar 18 09:42:52 ThisUser-iPhone-6s-Plus iap2d[176] <Warning>: process com.mysampleco.mysampleapp is now switching to other state
Mar 18 09:42:52 ThisUser-iPhone-6s-Plus iap2d[176] <Warning>: process com.mysampleco.mysampleapp is now terminated
Mar 18 09:42:52 ThisUser-iPhone-6s-Plus UserEventAgent[26] <Warning>: 85324450686: id=com.mysampleco.mysampleapp pid=311, state=0
Mar 18 09:42:52 ThisUser-iPhone-6s-Plus SpringBoard[58] <Warning>: [MPUSystemMediaControls] Updating supported commands for now playing application.
I've searched through other posts, some of whom point to "Javascript Minification" (which I turned off but still got the crash) and some talk about "Fastest, Smallest [-Os]" for Release in Code Generation section of Xcode's Build setting (which I don't know how to control since I'm using Appcelerator Titanium to build the app). Several others discuss specific code issues as revealed by the log. Since I get nothing in the log files that I can tell of significance, I'm not sure where to look.
Any help is appreciated.
UPDATE on March 21, 2016:
It took me a while to figure out the culprit. Here are the steps to reproduce the issue:
1) In Titanium Studio, create a new Mobile App project using Alloy Default template.
2) Run the newly created project as-is to a USB attached iPhone 6s Plus (or probably ANY ios device).
3) Click on the app icon on the device and the app will launch just fine with Hello World on the screen.
4) Now go to the TiApp.xml file and edit it by adding the following parameter:
<property name="appc-sourcecode-encryption-policy">embed</property>
5) Now run the modified project to the USB attached device.
6) Open the app and you will notice that it crashes right after the splash screen shows briefly.
It seems the property above does not work properly. Opened JIRA ticket AC-3389.

It looks like a provisioning issue. Check this thread which deals with a similar error.
If that does not help, please provide some more details like sample code and detailed crash logs (full trace-log). Thanks!

Related

I got "The identity used to sign the executable is no longer valid." only when offline

We have an app on iPad Air wifi model running ios 9.2 that worked fine since February. At 28th June the app starts to crash on startup when the ipad is not connected to the Internet.
The app starts up fine when connected to the Internet, and once it started up once, we can close it, disconnect the Internet and can now launch it normally offline.
When we adhoc the app to another iPad running ios12, the app launches fine offline. The client wants this fixed without updating the os.
This is the log when it crashed.
Jul 7 11:28:02 iPad networkd[90] <Notice>: -[NETClientConnection effectiveBundleID] using process name securityd as bundle ID (this is expected for daemons without bundle ID
Jul 7 11:28:02 iPad securityd[87] <Error>: CFReadStream domain: 12 error: 8
Jul 7 11:28:02 iPad SpringBoard[53] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jul 7 11:28:02 iPad SpringBoard[53] <Notice>: MIS: Using empty blacklist.
Jul 7 11:28:02 iPad networkd[90] <Notice>: -[NETClientConnection effectiveBundleID] using process name securityd as bundle ID (this is expected for daemons without bundle ID
Jul 7 11:28:02 iPad securityd[87] <Error>: CFReadStream domain: 12 error: 8
Jul 7 11:28:02 iPad SpringBoard[53] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jul 7 11:28:02 iPad SpringBoard[53] <Notice>: MIS: Using empty blacklist.
Jul 7 11:28:02 iPad securityd[87] <Error>: secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jul 7 11:28:02 iPad securityd[87] <Error>: secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jul 7 11:28:02 iPad networkd[90] <Notice>: -[NETClientConnection effectiveBundleID] using process name securityd as bundle ID (this is expected for daemons without bundle ID
Jul 7 11:28:02 iPad securityd[87] <Error>: CFReadStream domain: 12 error: 8
Jul 7 11:28:02 iPad amfid[164] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jul 7 11:28:02 iPad amfid[164] <Notice>: MIS: Using empty blacklist.
Jul 7 11:28:02 iPad securityd[87] <Error>: secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jul 7 11:28:02 iPad networkd[90] <Notice>: -[NETClientConnection effectiveBundleID] using process name securityd as bundle ID (this is expected for daemons without bundle ID
Jul 7 11:28:02 iPad securityd[87] <Error>: CFReadStream domain: 12 error: 8
Jul 7 11:28:02 iPad amfid[164] <Error>: SecTrustEvaluate [leaf AnchorTrusted]
Jul 7 11:28:02 iPad amfid[164] <Notice>: MIS: developer cert trust result = 5
Jul 7 11:28:02 iPad amfid[164] <Error>: /private/var/mobile/Containers/Bundle/Application/B670C369-644B-4A4A-AE35-0D42231058C3/FloorMap.app/FloorMap not valid: 0xe8008018: The identity used to sign the executable is no longer valid.
Jul 7 11:28:02 iPad com.apple.xpc.launchd[1] (UIKitApplication:com.d-jps.FloorMap[0xc74c][200]) <Notice>: Service exited due to signal: Killed: 9
Jul 7 11:28:02 iPad assertiond[62] <Warning>: Unable to obtain a task name port right for pid 200: (os/kern) failure (5)
Jul 7 11:28:02 iPad SpringBoard[53] <Warning>: Unable to register for exec notifications: No such process
Jul 7 11:28:02 iPad SpringBoard[53] <Warning>: Unable to obtain a task name port right for pid 200: (os/kern) failure (5)
Jul 7 11:28:02 iPad SpringBoard[53] <Warning>: Unable to obtain a task name port right for <FBApplicationProcess: 0x15f7e4a10; com.d-jps.FloorMap; pid: 200>
Jul 7 11:28:02 iPad SpringBoard[53] <Warning>: Application 'UIKitApplication:com.d-jps.FloorMap[0xc74c]' exited abnormally via signal.
Jul 7 11:28:02 iPad SpringBoard[53] <Warning>: Application '(null)' exited for an unknown reason.

Cordova iOS strange behavior, app close after splashscreen

I have experienced a strange behavior on a demo app i've done.
I'm learning how to develop apps with cordova, i developed a really simple demo app and i installed it with "RUN" of the xcode, in my iPhone 5S with iOS 9.3.
At first the app works really well but after a few days the app starts closing/crashing after the splashscreen.
The app stays in background but when i try to bring it up it closes/crashes again.
-- UPDATE --
After using Configurator for logging i got this :
========== 15/07/2016, 15:31:57 ==========
Jul 15 15:32:00 iPhone-de-Luis SpringBoard[54] : SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jul 15 15:32:00 iPhone-de-Luis SpringBoard[54] : SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jul 15 15:32:00 iPhone-de-Luis securityd[93] : secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jul 15 15:32:00 iPhone-de-Luis securityd[93] : secTaskDiagnoseEntitlements MISSING keychain entitlements: no stored taskRef found
Jul 15 15:32:00 iPhone-de-Luis amfid[2207] : SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jul 15 15:32:00 iPhone-de-Luis amfid[2207] : MIS: entitlement 'application-identifier' has value not permitted by provisioning profile 'iOS Team Provisioning Profile: io.ionic.luis.conference'
Jul 15 15:32:00 iPhone-de-Luis amfid[2207] : /private/var/containers/Bundle/Application/EE241426-5F1E-43B1-911F-C1C292F57F9D/RederiaCatalog.app/RederiaCatalog not valid: 0xe8008016: The executable was signed with invalid entitlements.
Jul 15 15:32:00 iPhone-de-Luis com.apple.xpc.launchd[1] (UIKitApplication:com.project.rederia[0xfc77][2872]) : Service exited due to signal: Killed: 9
Jul 15 15:32:00 iPhone-de-Luis assertiond[63] : Unable to obtain a task name port right for pid 2872: (os/kern) failure (5)
Jul 15 15:32:00 iPhone-de-Luis SpringBoard[54] : Unable to register for exec notifications: No such process
Jul 15 15:32:00 iPhone-de-Luis SpringBoard[54] : Unable to obtain a task name port right for pid 2872: (os/kern) failure (5)
Jul 15 15:32:00 iPhone-de-Luis SpringBoard[54] : Unable to obtain a task name port right for
Jul 15 15:32:00 iPhone-de-Luis SpringBoard[54] : Application 'UIKitApplication:com.project.rederia[0xfc77]' exited abnormally via signal.
Jul 15 15:32:01 iPhone-de-Luis SpringBoard[54] : Application '(null)' exited for an unknown reason.

ios install the mobileconfig freeze white screen

I am installing the .mobileconfig using the safari.
But, sometimes when I arouse the safari, it will navigation to the install the mobileconfig page.
The screen will freeze on the white screen, that does not show the install button on the right top.
like below:
Have anyone had encounter the same problem?
My code to call the safari is using below code:
NSURL *url = [NSURL URLWithString:#"http://127.0.0.1:777/myconfig.mobileconfig"];
[[UIApplication sharedApplication]openURL:url];
I had copy the error command log like below:
Jan 7 21:53:25 James-iphone nsurlsessiond[109] <Error>: Task 2 for client <CFString 0x154e5e4f0 [0x1a0e33b68]>{contents = "com.apple.mobileassetd"} completed with error - code: -999
Jan 7 21:53:25 James-iphone Preferences[464] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jan 7 21:53:25 James-iphone Preferences[464] <Notice>: MIS: Using empty blacklist.
Jan 7 21:53:25 James-iphone syncdefaultsd[519] <Notice>: (Note ) marked "com.me.keyvalueservice" topic as "opportunistic" on <APSConnection: 0x136515d10>
Jan 7 21:53:26 James-iphone Preferences[464] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jan 7 21:53:26 James-iphone Preferences[464] <Notice>: MIS: Using empty blacklist.
Jan 7 21:53:26 James-iphone Preferences[464] <Notice>: (Note ) MC: Applying iPhone defaults
Jan 7 21:53:26 James-iphone Preferences[464] <Warning>: BTM: attaching to BTServer
Jan 7 21:53:26 James-iphone Preferences[464] <Error>: SecTrustEvaluate [leaf IssuerCommonName SubjectCommonName]
Jan 7 21:53:26 James-iphone Preferences[464] <Notice>: MIS: Using empty blacklist.
Jan 7 21:53:27 James-iphone syncdefaultsd[519] <Notice>: (Note ) marked "com.me.keyvalueservice" topic as "enabled" on <APSConnection: 0x136515d10>
Jan 7 21:53:27 James-iphone MobileSafari[514] <Error>: KeychainGetICDPStatus: keychain: -25300
Jan 7 21:53:27 James-iphone MobileSafari[514] <Error>: KeychainGetICDPStatus: status: off
Jan 7 21:53:27 James-iphone MobileSafari[514] <Error>: KeychainGetICDPStatus: keychain: -25300
Jan 7 21:53:27 James-iphone MobileSafari[514] <Error>: KeychainGetICDPStatus: status: off
Jan 7 21:53:27 James-iphone MobileSafari[514] <Error>: KeychainGetICDPStatus: keychain: -25300
Jan 7 21:53:27 James-iphone MobileSafari[514] <Error>: KeychainGetICDPStatus: status: off
Jan 7 21:53:28 James-iphone Preferences[464] <Warning>: *** Assertion failure in -[UITableView _endCellAnimationsWithContext:], /BuildRoot/Library/Caches/com.apple.xbs/Sources/UIKit/UIKit-3512.30.14/UITableView.m:1720
Jan 7 21:53:28 James-iphone Preferences[464] <Error>: *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 5. The number of rows contained in an existing section after the update (7) must be equal to the number of rows contained in that section before the update (4), plus or minus the number of rows inserted or deleted from that section (2 inserted, 0 deleted) and plus or minus the number of rows moved into or out of that section (0 moved in, 0 moved out).'
*** First throw call stack:
(0x183805900 0x182e73f80 0x1838057d0 0x18417899c 0x1886f004c 0x1941301c4 0x194136d64 0x183259630 0x1832595f0 0x18325ecf8 0x1837bcbb0 0x1837baa18 0x1836e9680 0x184bf8088 0x188560d90 0x1000b7718 0x18328a8b8)
Jan 7 21:53:28 James-iphone SpringBoard[54] <Warning>: HW kbd: Failed to set (null) as keyboard focus
Jan 7 21:53:28 James-iphone com.apple.xpc.launchd[1] (UIKitApplication:com.apple.Preferences[0xfe24][464]) <Notice>: Service exited due to signal: Abort trap: 6
Jan 7 21:53:28 James-iphone SpringBoard[54] <Warning>: Application 'UIKitApplication:com.apple.Preferences[0xfe24]' crashed.
Jan 7 21:53:28 James-iphone UserEventAgent[23] <Warning>: 2463897065357: id=com.apple.Preferences pid=464, state=0
Jan 7 21:53:28 James-iphone MobileGestaltHelper[88] <Error>: libMobileGestalt MobileGestalt.c:276: server_access_check denied access to question UniqueDeviceID for pid 519
Jan 7 21:53:28 James-iphone syncdefaultsd[519] <Error>: libMobileGestalt MobileGestaltSupport.m:151: pid 519 (syncdefaultsd) does not have sandbox access for re6Zb+zwFKJNlkQTUeT+/w and IS NOT appropriately entitled
Jan 7 21:53:28 James-iphone syncdefaultsd[519] <Error>: libMobileGestalt MobileGestalt.c:537: no access to UniqueDeviceID (see <rdar://problem/11744455>)
Jan 7 21:53:28 James-iphone diagnosticd[82] <Error>: unable to find offset 0x8327f9a4 in shared cache for arch 'arm64'
Jan 7 21:53:28 James-iphone ReportCrash[520] <Notice>: platform_thread_get_unique_id matched 240727
Jan 7 21:53:28 James-iphone ReportCrash[520] <Notice>: Formulating report for corpse[464] Preferences
Jan 7 21:53:28 James-iphone ReportCrash[520] <Warning>: saved type '109_Preferences' report (21 of max 25) as /var/mobile/Library/Logs/CrashReporter/Preferences_2016-01-07-215328_James-iphone.ips
Jan 7 21:53:29 James-iphone pkd[154] <Warning>: assigning plug-in app.cyan.timy.dayext(2.2) to plugin sandbox
Jan 7 21:53:29 James-iphone pkd[154] <Warning>: enabling pid=54 for plug-in app.cyan.timy.dayext(2.2) B9580AEF-CE50-4DD3-A98C-9B5AF2933220 /private/var/mobile/Containers/Bundle/Application/D753EF69-C9C2-4C71-9755-79F8553787A9/HourDay.app/PlugIns/DayExt.appex
Jan 7 21:53:30 James-iphone SpringBoard[54] <Warning>: plugin app.cyan.timy.dayext invalidated
Jan 7 21:53:31 James-iphone SpringBoard[54] <Warning>: [MPUSystemMediaControls] Updating supported commands for now playing application.
Jan 7 21:53:31 James-iphone SpringBoard[54] <Warning>: [MPUSystemMediaControls] Updating supported commands for now playing application.
Jan 7 21:53:31 James-iphone com.apple.WebKit.WebContent[518] <Error>: CoreAnimation: failed to allocate IOSurface
Jan 7 21:53:36 James-iphone mediaserverd[25] <Notice>: '' (pid = 516) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None
Jan 7 21:53:36 James-iphone com.apple.xpc.launchd[1] (com.apple.WebKit.WebContent.A90CE0BD-CDCB-43AB-9311-B0D990645C4E[516]) <Warning>: Service exited with abnormal code: 1
Jan 7 21:53:36 James-iphone mediaserverd[25] <Notice>: '' (pid = 516) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None
Jan 7 21:53:36 James-iphone mediaserverd[25] <Notice>: 'FigPlayer - 31' (pid = 31) setting DiscoveryMode = DiscoveryMode_None, currentDiscoveryMode = DiscoveryMode_None
Jan 7 21:53:36 James-iphone SpringBoard[54] <Warning>: [MPUSystemMediaControls] Updating supported commands for now playing application.
Maybe can give you some hint.
Are you installing OVER other profiles or along with others? I've replaced mine a few times now and iOS 9.1 doesn't like it for me on the iPhone 6+.
The only (want most painless) way I've found is to remove the old profiles before I install new ones via Xcode
On Xcode:
1) Click on the "Window" menu
2) Click on "Devices"
3) Wait for your Device (devices) to load .. Oh make sure they're plugged in! hah
4) Right click on the device you need to change profiles on
5) Click on "Show provisioning profiles"
In there you can add and delete profiles safely :)
edit
The other options is what's called OTAC (over the air configuration)... It's exactly what happens when your mobile phone provider sends you new APN settings and it asks you to install the settings "out of the blue"...
The docs are here:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/iPhoneOTAConfiguration/Introduction/Introduction.html
The only issue you'll have is that this isn't something you can do on the simulator so you'd better create "dummy profiles" to avoid replacing your development or production ones.
Another note, I did find this post on here: Installing a configuration profile on iPhone - programmatically

iOS Error on launch from deeplink: lsd[738] <Warning>: LaunchServices: application launch failed - timeout waiting for launch

When launching my iOS app from a deeplink (a URL with app specific scheme), I get this error in log:
lsd[738] <Warning>: LaunchServices: application launch failed - timeout waiting for launch.
when the app is launched normally, there is no error.
There is no other log regarding the root of the timeout.
I am looking at the log coming from a device.
Here is the full log:
Mar 26 18:03:35 iPod kernel[0] <Notice>: xpcproxy[2291] Container: /private/var/mobile/Containers/Data/Application/E1E3A2BC-E5B7-4BE3-881D-CFFC37666FA2 (sandbox)
Mar 26 18:03:35 iPod MobileSafari[2291] <Error>: assertion failed: 12F5047f: libxpc.dylib + 51923 [A76ECB1C-8653-340A-A02D-52E89E8A8902]: 0x7d
Mar 26 18:03:35 iPod Unknown[2291] <Error>:
Mar 26 18:03:35 iPod locationd[63] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
Mar 26 18:03:35 iPod MobileSafari[2291] <Error>: Could not successfully update network info during initialization.
Mar 26 18:03:36 iPod locationd[63] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
Mar 26 18:03:36 iPod backboardd[56] <Warning>: CoreAnimation: updates deferred for too long
Mar 26 18:03:38 iPod kernel[0] <Notice>: xpcproxy[2295] Container: /private/var/mobile/Containers/Data/Application/8D14282B-075D-431C-B5BE-D9961FB420D7 (sandbox)
Mar 26 18:03:38 iPod syncdefaultsd[2287] <Notice>: (Note ) marked "com.me.keyvalueservice" topic as "ignored" on (null)
Mar 26 18:03:38 iPod locationd[63] <Notice>: Gesture EnabledForTopCLient: 0, EnabledInDaemonSettings: 0
Mar 26 18:03:38 iPod Training[2295] <Error>: assertion failed: 12F5047f: libxpc.dylib + 51923 [A76ECB1C-8653-340A-A02D-52E89E8A8902]: 0x7d
Mar 26 18:03:38 iPod Unknown[2295] <Error>:
Mar 26 18:03:48 iPod **lsd[738] <Warning>: LaunchServices: application launch failed - timeout waiting for launch.**
Mar 26 18:03:48 iPod Training[2295] <Warning>: willFinishLaunchingWithOptions
Mar 26 18:03:48 iPod Training[2295] <Warning>: didFinishLaunchingWithOptions
I was seeing 8 second delays before seeing the same log message.
Mar 26 18:03:48 iPod **lsd[738] <Warning>: LaunchServices: application launch failed - timeout waiting for launch.**
This was only happening when launching the app when the app was not already in the background. I filed a bug with Apple. This issue is supposedly fixed in iOS 9 beta 4. Unfortunately, older versions of iOS will continue to have this problem.

iOS App will not die, writes to console & plays sounds after quit

My app has some kind of Zombie problem. (Not an NSZombie problem. Like, a coming-back-from-the-dead problem.)
I first noticed that after a debugging session, when I would go for a run the music on my iPhone would pause every ~7 minutes, and when I'd unlock the device the app name would be flashing red in the status bar as though it had just crashed. Sometimes there would even be phantom sound from the app, like it was still running in the background somehow.
Manually quit the app, continue. Still get the intermittent audio artifacts even though the app no longer appears in my list of running apps.
When I plug back in, this is in the console for each time the app zombified and restarted itself. It looks just like a normal launch of the app! What the? What could be triggering my app to restart itself?
Console:
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: cocos2d: cocos2d v1.1.0-beta2b
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: cocos2d: Using Director Type:CCDirectorDisplayLink
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: cocos2d: OS version: 5.1 (0x05010000)
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: cocos2d: GL_VENDOR: Imagination Technologies
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: cocos2d: GL_RENDERER: PowerVR SGX 535
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: cocos2d: GL_VERSION: OpenGL ES-CM 1.1 IMGSGX535-63.24
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: cocos2d: GL_MAX_TEXTURE_SIZE: 2048
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: cocos2d: GL_MAX_MODELVIEW_STACK_DEPTH: 16
// etc //
Apr 26 12:10:01 unknown kernel[0] <Debug>: launchd[2658] Builtin profile: container (sandbox)
Apr 26 12:10:01 unknown kernel[0] <Debug>: launchd[2658] Container: /private/var/mobile/Applications/FFEB0A26-06D1-4C46-8AE5-C60582D09A1D [69] (sandbox)
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: Audio session details
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: Audio Input Available? YES
Apr 26 12:10:01 unknown mediaserverd[32] <Warning>: 12:10:01.641 <SystemSoundServer> WARNING translating HAL error: 561214578
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: Max Possible Inputs 15151420
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: Outputs 2
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: Device sample rate 44100.000000
Apr 26 12:10:01 unknown Breakout[2658] <Warning>: Hardware buffer size 0.023220
// etc //
Apr 26 12:10:33 unknown SpringBoard[52] <Notice>: Posting 'com.apple.iokit.hid.displayStatus' notifyState=1
Apr 26 12:10:33 unknown UserEventAgent[12] <Warning>: DEBUG: Changing screen blanked state: 0
Apr 26 12:10:33 unknown SpringBoard[52] <Notice>: MultitouchHID: detection mode: 255->0 (deferring until bootloaded)
Apr 26 12:10:33 unknown SpringBoard[52] <Notice>: MultitouchHID: device bootloaded
Apr 26 12:10:33 unknown SpringBoard[52] <Notice>: MultitouchHID: detection mode: 0->0
Apr 26 12:10:34 unknown kernel[0] <Debug>: set_crc_notification_state 0
Apr 26 12:10:34 unknown ReportCrash[2659] <Notice>: Formulating crash report for process Breakout[2658]
>
Apr 26 12:10:34 unknown SpringBoard[52] <Warning>: pid_suspend failed for [2658]: Unknown error: -1, Unknown error: -1
Apr 26 12:10:34 unknown SpringBoard[52] <Warning>: Could not set priority of [2658] to 4096, priority: No such process
Apr 26 12:10:34 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:com.charliewilliams.Breakout[0xd5ad]) Job appears to have crashed: Trace/BPT trap: 5
Apr 26 12:10:34 unknown SpringBoard[52] <Warning>: Application 'Breakout' exited abnormally with signal 5: Trace/BPT trap: 5
Apr 26 12:10:35 unknown ReportCrash[2659] <Error>: libMobileGestalt computeUniqueDeviceID: total time for bb to return imei: 0
Apr 26 12:10:35 unknown ReportCrash[2659] <Notice>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/Breakout_2012-04-26-121033_Tortuga-Gigante.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
Explanation of the solution: It turned out to be simple - 1. I was shutting down my audio session in dealloc but not in applicationDidEnterBackground. And since I'm using kaudiosessioncategory_playandrecord that seems to tell iOS to restart the app if it crashes in the background.
Now, why is it crashing in the background? ...well, that's my next task.
The app may have a background voip flag set. If it does, the OS will restart the app if it exits abnormally (or when the device restarts).
what audio framework are you using? the iPod app, GarageBand and other audio apps present red flashing in the title bar when audio processing continues after exiting the app. This wouldn't happen with Cocos Denshion I don't think, so you must be using an Apple framework for your audio? The answer likely lies with how it is configured. Apple gives some of its own audio frameworks permission to keep running when in the background so you can have customized music playing, like apps for radio stations, etc.
We will probably need code snippets also as the logs don't tell us what code is executed

Resources