Xcode screen update error in simulator - ios

Since I updated my Xcode to 9 (now I have 9.2) the simulator is acting weird. It's very slow and the main problem is that every time it has to update the screen (when something trigger, when some view moves, etc) it doesn't update to the last frame. For example: if I have a tableview and it updates the new results, they won't be showed until I make a new movement (like dragging the tableview), then the new results will be showed.
It happens with every device, and the same app runs perfectly in a real device.
I have Sierra 10.12.6 if it helps.

If you have an Intel HD 3000 GPU (or similar) this can happen. It is a GPU driver bug and unfortunately I don't have a workaround for you at this time.
Using Simulator on a Metal-capable Mac (or switching to the discrete GPU if your machine has one) should work around it.

I've had this problem too with a late 2011 13" MacBook Pro with Intel HD 3000 graphics. I had a look at the solution to a related issue described in https://forums.developer.apple.com/thread/88446‌ and thought I'd experiment with other values for FramebufferEmulationHint. A value of '2' seems to be working for me:
defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferEmulationHint 2

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 does not refresh correctly

I try to simulate a very very simple application which I have created in Xcode 9. I try to simulate it in the iOS Simulator in an iPhone6 with iOS 11.2. I have also tested other devices with the same result.
On a real device, the app works as expected. But on the simulator it doesn't.
I expect, that the button will become orange after I have clicked on it. and the emoji should disappear. Instead it changes into some strange "shadowed" look. If I wait then, the button will sometimes turn its background to orange after around 30 seconds.
I have recorded a gif, to illustrate the problem.
http://www.giphy.com/gifs/l4pSUuBtN7aBVvbVe
UPDATE:
Here is another GIF: http://www.giphy.com/gifs/26DNe5B0vxIO6pHiw
The button gets refreshed, as soon as i drag down the info center.
Development machine: Mac mini 2011, i5, SSD, 8GB RAM, high Sierra
hope someone can help me.
UPDATE: 15.02.18
The problem only appears with iOS versions beginning from 10 and up.
With iOS Version 9.0 there is no problem. Expect that there arent any emojis...
In the meantime, i have filed a bug report to apple. But i think there will be no response on that.
Looks that others having the same problem: https://forums.developer.apple.com/thread/96511
iOS 13 UPDATE: Use the Hardware > Toggle In-call Status Bar option for all devices with iOS 13 or higher. The activity indicator is gone for all devices. Fortunately, the in-call status bar no longer changes the layout size.
--
I have finally found a working workaround for this!
For simulators without the notch, set this when you launch the app:
[UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
Swift 4.1:
UIApplication.shared.isNetworkActivityIndicatorVisible = true
and never set it back to NO. This will show the little loading indicator in statusbar, which will keep the simulator constantly active and will solve your issue.
Just don't forget to make sure you will not use it in the production configuration.
Simulators with the notch in the status bar (iPhone X) don't show the activity indicator, but you can use Hardware > Toggle In-call Status Bar, because the in-call icon is animating and will also keep the screen active.
Found a workaround here (after looking at your link to Apple forum):
https://forums.developer.apple.com/thread/88446
In Terminal:
If you have a discrete GPU in the system (eg: MBP 15" with Radeon HD 6750M):
defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferPerformanceHint 2
If you do NOT have a discrete GPU in the system (eg: MBP 13" or MacMini)
defaults write com.apple.CoreSimulator.IndigoFramebufferServices FramebufferEmulationHint 1
To be sure, try both options. First option helped me (although I have MBP 13" Early 2011).
I had the same problem of simulator not updating the changes from database.
You might have problem with caches, the simulators might need resetting.
Try quitting iPhone Simulator, then run xcrun in Terminal:
xcrun simctl erase all

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)

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

Resources