iOS Simulator takes extremely long time to boot first time - ios

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...

Related

iPhone 12 Pro debugging on device hangs

Like many of you I received my iPhone 12 pro today in the mail! And of course the first thing I wanted to do was run it in debug on my actual device. Curious if any of you with new iPhone 12's, or iPhone 12 pro's are seeing a huge lag when trying to debug to the device. for example it takes almost 1 min to even hit the entry point in the app delegate, and about 20 seconds when given focus to a uitextview for the keyboard to show up (after the 1st time the keyboard loads, the subsequent ones are instant)
Its super crazy because the simulator is instant, all other actual devices (Xs etc) are instant (all on 14.1), but my brand new 12 pro is unworkable when debugging to it.
Any suggestions? Ive tried multiple projects, seems to do it on every one. Ive submitted a feedback as well.
Disconnect the device, then delete the contents of ~/Library/Developer/Xcode/iOS DeviceSupport and restart Xcode.

Xcode 12.0.1 Screenshot is capturing only Home-screen on iOS simulator

While trying to capture a screenshot on Xcode V12.0.1 - the app screen turns to "Home screen" (of IOS) and a screenshot on the home screen is prodcued instead of the app screen.
It was working fine a week before, but my OS and Xcode were auto updated last week to MacOS 10.15.7 and Xcode V12.0.1 and since then i am unable to take screenshots of the simulator.
I ran into this issue and as of now I can only provide a work arround - Use command line to take the screenshot
cd to the folder that you want save the screenshots to.
Run xcrun simctl io booted screenshot Screenshot.png
Firstly, this problem still happens (at least, for me) in Feb 2021 with Xcode 12.3.
Secondly, I was running Xcode and the simulator on an older (slow) Mac mini, so doing something like xcrun simctl io booted screenshot Screenshot.png worked for me too, but it took over 30 seconds from pressing "enter" to when the snapshot was captured, so by then the simulator screen had changed (I was trying to get a screenshot of the launch image). I suppose with careful timing, to use the command 30 seconds or so before the time the simulator is displaying the desired screen, is one way, but tricky and error prone.
Thirdly, I tried restarting Xcode, after quitting the simulator as well, and it worked for me. It seems to have a good chance of working when Xcode is first started, although later the "home screen" bug appears to surface for some unknown reason.
If you copy the screen it seems to work as well.
Simulator -> Edit -> Copy Screen
Then paste the image from clipboard into an image editor etc.

Xcode 9 GM seed Simulator Screen Artefacts

I have simulator screen problems, after installment of last beta, it's happen randomly, when i build any project, usually on 3-4 time, when i hit play. Have to quit Simulator Application, and start it again.
Anyone have same issue ?
Screenshot:
It seems that Metal is the default renderer for the new simulator and some of the older Apple devices do not support it :
Mac computers that support Metal
For example, I have a mid 2011 Mac-mini and had to switch it to OpenGL to get the simulator working (as suggested by #Jeremy Huddleston Sequoia)

Why is Xcode 7 iOS Simulator freezing?

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.

iOs Simulator running slow

Guys I really need your help. I was so concentrated running my game on iphone 5s device and I didn't realize that iphone 6 is running a little slower than the 5s and the 6 plus worst. What can I do for it?
This is a very common bug with the simulator a way I get around it is.
IOS Simulator: Window > Scale > 50% - it makes the simulator look like an actual device and it fits your screen perfectly.
Then I just leave the simulator open at all times rather then closing after I'm done testing my apps. This saves Xcode having to load all the simulators files and directories each time you run your app.
Hope this helps, cheers.
Did you try cleaning? Sometimes applications have problems.
iOS Simulator:
iOS Simulator Menu > Reset Content and Settings..
Xcode:
Product > Clean

Resources