When a Xamarin iOS app gets to a certain size (as yet undetermined), Instruments occasionally fails to fully launch the app. Instead the app seems to stay in a partially launched state, but never displaying the UI, just a black screen. It seems this issue happens more and more the bigger the app gets. In the included test project, you may have to hit the "Record" button in Instruments several times before the issue is displayed. The customer who reported this issue noted that they could not get the same issue to occur with a fully native app built in Xcode.
## Steps to reproduce:
1) Deploy the App to the Simulator (device also do the same thing) (Link to get app is in private comment below)
- Start "MyAppHangPOC" under iPad 2 / iOS 8.1 Simulator using Xamarin Studio on a Mac (Debug | iPhoneSimulator)
2) Prepare profiling for the application
- Start Apple Instruments
- Choose Standard > Allocations
- Choose iPad 2 (8.1 Simulator) > Installed Apps > MyAppHangPOC
3) Start profiling the application
- Click the Record button
- See the application restarting in the iOS simulator
- If you see some yellow buttons on a brown background, you didn't reproduce the issue (takes around 3-6 tries to reproduce in PoC)
- Back in Instruments, restart the recording:
- Click Stop
- Wait 1 second
- Restart "3) Start profiling the application"
- If you DON'T see yellow buttons AND Memory Allocation in instruments stop capturing new allocations, you reproduced the issue
- Note: If you see the home screen, tap on the MyAppHangPOC to resume the app
Expected result: App will be fully launched and profiling can occur.
Actual result: The application froze, so instruments can't profile our Xamarin application.
In the simulator logs, you will see this appear after some seconds:
backboardd: CoreAnimation: timed out fence a397
If you hit the home button while frozen, you should see those logs appearing:
SpringBoard: LICreateIconForImage passed NULL CGImageRef image
backboardd: CoreAnimation: timed out fence 4fdb
backboardd: CoreAnimation: timed out fence a01b
backboardd: CoreAnimation: updates deferred for too long
* Notes : - It's one of the way to reproduce the issue, not the only one.
- The issue occurs on Simulator AND device
- It occurs with different versions of Xamarin (tested 5.7.1 build 17 and 5.7.2 build 7)
- The more we clean the project, the lower the repro rate is, and it seems to be independant of what we clean
- It occurs on all mac we tried
- It happens on iOS 7 + 8
- Could not reproduce it with pure XCode project
- We tried to delay some code after the MainViewController is displayed, but it still hang later on
- Sometimes (but rarely) it froze even before finishing the WillFinishLaunching in our real application
- Can be reproduced with Xamarin Studio or Visual Studio
- Turning off debugging + Performance Profiling while enabling LLVM does help in PoC (because the app is smaller?), but is not sufficiant for real app.
This might be a dupe of https://bugzilla.xamarin.com/show_bug.cgi?id=19379
*** This bug has been marked as a duplicate of bug 19379 ***