Why is Xcode 7 iOS Simulator freezing? - ios

I'm getting odd freezes of up to 60s in the Xcode 7 simulator, specifically when scrolling or doing other GPU-intensive tasks. The problem appears to be with the simulator as a whole, not my app (lots of spinning beach ball, slow to respond to rotate commands, etc.).
If I track CPU time in Instruments, 50s of real time shows as below 0.5s of CPU time for my app.
What's going on? (El Cap, Xcode 7.1, all iOS versions, all devices)

I run Better Snap Tool for window management. Quitting this app (or disabling it from interacting with the simulator) fixes the problem immediately, even if the sim is in the middle of a freeze. No idea why, but Better Snap Tool appears to be interfering with iOS Simulator's use of the GPU.

Related

ARKit randomly limits frame rate to 30FPS

Every once in a while when I run my ARKit project the frame rate locks to 30FPS. This seems to happen completely by random.
This happens even when the scene is empty and there are no rendering and background processes happening.
After closing Xcode and running the app again a couple times, it goes back to the default 60FPS.
Any idea what this could be?
I'm running on XCode 10.1 and iOS 12.1
It is known bug for iPhone 7/8 in iOS 11/12. Most people from forums say that sometimes iPhone seems to get stuck at 30 fps and only restart cures its weird issue.
Also, this bug happens when you use Unity's building blocks for ARKit. Currently there is no explanation why this is happening. Let's wait for new updates of Xcode, ARKit and iOS.
Hope this helps.

iOS Simulator takes extremely long time to boot first time

I'm trying to run an iOS simulator (Xcode 7.0.1, OS X Yosemite). However, the first time I run the simulator, it takes a very long time to boot up (80-120 seconds), which is causing my automation testing to time out. If I close the simulator and re-launch the same one, it will boot up in about 5-8 seconds. Launching a different device will cause the long boot up time again.
I have tried resetting the content and settings of the simulator, deleting and re-downloading simulators, and uninstalling and reinstalling Xcode.
This machine is a Parallels Desktop VM running on a 2012 Mac Mini. While I do not believe this to be a resource issue (the simulator runs just fine with the second launch), I have tried increasing ram and video memory to the VM with no success.
Had the same issue after updating to Xcode 7 on my iMac (late 2013). And yesterday I've succeeded to resolve it by doing 2 steps (unfortunately, I don't know which did really help):
I had Xcode 6 installed side by side with Xcode 7. So I've deleted Xcode 6 instance.
Open Xcode 7, go to Window -> Devices and delete all listed iOS simulators you have there. Close & re-start Xcode. Go to Window -> Devices again and add only simulators you need (in my case I've added iPhone 6 iOS 8, iPhone 6s iOS 9, iPad Air 2 iOS 9). You can add more simulators later on as you need them. Also, not sure if this is critical, I've selected no paired watchOS device for simulators I've added.
After completing these steps, my simulator cold start was significantly imporoved - it takes now like 30-40seconds max for a cold start. Before that it was 3-4minutes and first debugger attach attempt always failed.
Hope, this will be helpful for somebody.
My solution so far has been to pre-boot the Simulator prior to needing it for automation. I consider this somewhat hackish, but it does get the job done.
xcrun instruments -w "Simulator Name Here"
sleep 120
This will launch the simulator, then sleep for a couple minutes before proceeding on to whatever else you need the simulator for.
At first boot, the sim device will go through initial setup just like a real device. Taking 2 minutes is quite a long time on modern systems but not that unheard of, especially if you're not on an SSD. I suggest you watch the sim device's system.log to see what tasks are occurring during the boot process and keep an eye out for any errors that might indicate what is going wrong.
I tried to run the iPhone6S simulator on my Macbook Air, and it just hung at the game center login screen. It hung for 10 minutes. I had 50% scale on the simulator window. Then I tried to reduce the scale even more, and immediately it passed the GC login screen.
My guess is that my little Air has don't have time to do anything else but updating the simulator screen at high scales, and when I reduced the scale it had time to bother with the game center login functionality. My simulator widow is the size of a stamp now. :)
Puh. I've had this simulator problem for weeks...

iOS app crashes when the simulator window is moved

I’m working on a universal iOS application that runs fine on both the iPad Air and iPhone 5. Sometimes (1 out of ~5 times), when I move the simulator window, it crashes. I don’t get a usable error log nor a stack trace. It just seems the app get’s terminated and I do get a beach ball. I did add an "Exception Breakpoint” but it does not fire. The simulator itself does not crash. I can still use the shortcut for the home button and restart my application.
I do have 16GB of Ram. I don’t think it’s a memory problem.
Do I invoke something on my app when I move the simulator window? I can’t reproduce this behaviour, but it happened to me multiple times a day since I updated Xcode. Does anybody else have this problem? Is there a workaround?

iOS Simulator crashing mac after a few seconds of use

This is such a strange issue, but lately I can't start the iOS Simulator without it crashing my Mac and me needing to unmount the HD, repair it, and then restart.
When iOS Simulator is running, after a few seconds, a bunch of colored lines start appearing on the screen as tiny tears and then the screen splits in half and either turns gray or blue with black lines. The first couple of times I could close the simulator in time and the screen would revert back to normal, but after a few times it's almost an immediate crash with almost no chance of trying to close the simulator. When I restart, I can't get past the grey screen and need to go into recovery mode. I have a 2GHz i7 MacBook Pro with 16GB memory running OS X 10.9.1.
Does anyone have any ideas at all what is causing this?
Turns out it was that widespread GPU issue that most early 2011 MacBooks have. I've taken it to get it's logic board replaced as it's the only fix. I should have Googled this before asking, but if you're here reading this then you're smarter than I am. Good work.
Because of security issues you have to update to 10.9.2 ASAP if you're really on 10.9.1

iPhone App Running Slower on Simulator

I am currently working on an iPhone app where I use 2 main timers that make the game work as one piece. The only problem I've encountered so far is that when I run it on the iOS Simulator from Xcode the game seems to lag a bit, and all of the animations run slower. I'm not sure if this is a memory issue, but isn't the iOS Simulator supposed to run just as smooth as the iPhone? When I run it on my iPod Touch 4th Generation, I don't encounter this problem. Is there a way I can fix this, or does anyone know why this happens?
The frameworks are designed to work with specific hardware on device for graphics acceleration. This is not present in the simulator, so you'll see diminished performance on graphics-intensive applications. You might however see increased performance in the simulator in non-graphics related areas. The bottom line is always test on real hardware - the simulator is just a convenience.

Resources