I am not exactly sure when it first started, but in recent releases of Xcode, I have felt the iOS Simulator become more and more sluggish. This is hardly surprising given the ever-increasing resolutions of iPhone's, and given my local setup has not seen a refresh in a number of years as, like many others, I am waiting to see what Apple announces with a new modular Mac Pro (this year?).
Here at Optimised Labs, we are always looking for ways to improve performance. Given I spend a lot of time modernising existing iOS apps or writing new ones from the ground up, a small boost in performance would increase my productivity considerably!
Sure, there was this bug in Xcode 9.0 with the OpenGLES.framework, but I always use the most recent version of Xcode. At the time of writing this is Xcode 9.2.
During my research I discovered two quick wins on how to increase the performance of the iOS Simulator:
- Always use either 'Physical Size' (⌘1) or 'Pixel Accurate' (⌘2) window sizes. If Pixel Accurate is greyed out the screen resolution on your Mac does not support this size. Instead try a different simulated device, eg, iPhone SE.
- Try an alternative rendering mode for the simulator. This can be done with
defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferRendererHint Xwhere
0...3. I have found
3(OpenGL) works best for me. Remember to restart the simulator after changing.
Using these two techniques my iOS Simulator went from practically unusable back to 'reasonable'. However, I went ahead and filed a radar as suggested because I would like to see my GPU being used instead! Feel free to dupe if you find the same on your machine.
Update 6th March 2018: got back to me asking for more information on what I meant by "unusable". In order to demonstrate, I supplied two videos of scrolling performance in the iOS Simulator before and afterwards.
Update 8th March 2018: closed my radar as a dupe of radar.