IOS Simulator takes a very long time to download for the first time

I am 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 load (80-120 seconds), which disables my automation testing. If I close the simulator and run it again, it will start in about 5-8 seconds. Starting another device will result in a long boot time.

I tried resetting the contents and settings of the simulator, uninstalling and reloading the simulators, and uninstalling and reinstalling Xcode.

This computer is a Parallels Desktop virtual machine running on Mac Mac 2012. Although I do not think that this is a resource problem (the simulator works fine with the second launch), I tried to increase the RAM and VM video memory without success.

+5
source share
4 answers

My solution so far has been to preload the simulator before it is needed for automation. I find this somewhat hacky, but he does his job.

xcrun instruments -w "Simulator Name Here" sleep 120 

This will launch the simulator and then sleep for a couple of minutes before proceeding with what you need for the simulator.

+1
source

There was the same problem after upgrading to Xcode 7 on my iMac (end of 2013). And yesterday I managed to resolve this by doing 2 steps (unfortunately, I don't know what really helped):

  • I had Xcode 6 installed side by side with Xcode 7. So, I uninstalled the Xcode 6 instance.
  • Open Xcode 7, go to Window -> Devices and delete all the listed iOS simulators that you have there. Close and restart Xcode. Go to Window โ†’ Devices again and add only those simulators that you need (in my case, I added iPhone 6 iOS 8, iPhone 6s iOS 9, iPad Air 2 iOS 9). You can add more simulators later when you need them. Also, not sure if this is very important, I did not select the watchOS paired device for the simulators that I added.

After completing these steps, my cold start of the simulator was significantly cool - it took about 30-40 seconds to start a cold start. Before that, it was 3-4 minutes, and the attempt of the first debugger-attachment was always unsuccessful.

Hope this will be helpful to someone.

+4
source

At the first boot, the sim device will go through the initial setup in the same way as the real device. Taking 2 minutes is quite a long time on modern systems, but not on what is unheard of, especially if you are not on an SSD. I suggest you look at sim device system.log to find out what tasks occur during the boot process and to monitor for any errors that might indicate that something is going wrong.

+1
source

I tried to run the iPhone6S simulator on my Macbook Air, and it just hung on the login screen of the game center. He hung for 10 minutes. I had a 50% scale on the simulator screen. Then I tried to zoom out even more, and immediately he went through the GC login screen.

My guess is that my little Air has no time to do anything other than refresh the simulator screen on a high scale, and when I scaled down, he had time to worry about the functionality of entering the game center. My simulated widow is now marker size. :)

Puh. I had a problem with the simulator for several weeks ...

+1
source

Source: https://habr.com/ru/post/1233285/


All Articles