iOS Simulator does not refresh correctly - ios

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

Related

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.

Cannot open iPhone Control Center on simulator

I'm new to iOS coming from Android. I try to run simulator and open the Control Center on it. When I swipe from the bottom to up I see that it's empty. Any ideas what's going on with my simulator?
I tried at iPhoneX simulator and have the same.
Unfortunately the Simulator does not show a true Control Center. Yes, a blank screen appears, but no controls are available in there. Welcome to iOS ;]
I needed to do this specifically to do a screen recording, but I realised you can't do it that way. So I found out about this way https://medium.com/#skounis/take-a-screenshot-or-record-video-with-ios-simulator-90c196e03b67 for anyone looking to do the same.
xcrun simctl io booted recordVideo <filename>.<extension>
To stop recording, press Control-C in Terminal.
PS - for iPhone X emulator you need to swipe from the top right down (even though that doesn't get you what you want)
The problem not in Xcode but in iOS 11 simulator
Solved
I download iOS 10 simulator and control-center work good in Xcode 9.3
Control Center is not available in iOS Simulator but if you are looking for notification center, you can get it by swiping top-down on iOS simulator. You can test local notifications on simulator

Iphone starts lagging and not responding while debugging via Xcode

I've been trying to test my app on IPhone but the phone freezes time to time and stop responding for a while and so .. when its connected to Mac
(Mac is Installed on VMWare and there has been nothing wrong with it till now even the emulator)
any Idea on what may cause the problem ?
I suggest restarting the simulator and Xcode
first quit Xcode then make sure the active window is the simulator next what you want to do is look up at the task bar (gray bar at the top of the screen) click on hardware and then scroll down to reboot and click that, the simulator will now restart when the simulator finishes restarting navigate over to simulator and click on "reset all content and settings"
if that does not fix the problem try using another simulated device in my experience some work better then others (try the iPhone SE or the iPhone 5s they have worked better for me)

iOS Simulator 8.1 and 8.2 Translucency Bug with UITabBar?

Is there any known Bug regarding the iOS Simulator and UITabBar for iOS 8.1 and 8.2? Today I noticed during testing that text heavily shines through the UITabBar when running in the 8.1 and 8.2 Simulators, while other iOS versions work flawlessly.
I want to make sure there's no additional work needed, as the iOS 8 UINavigationBar translucent color drawing issues immediately came to my mind.
Demo Setup
Create fresh Tabbed App (using ObjC or Swift)
Delete the First View and add a UITableViewContoller with dummy Static Cells
Results
Run the application, on iOS 8.1 and 8.2 Simulators the text shines through, on iOS 8.3 and above everything is working as expected.
Not related to Simulator Scaling, tested. Using a late 2013 rMBP with discrete GPU, El Capitan 10.11.2 and Xcode 7.2 (7C68). Working fine on device running iOS 9.
Question: I don't have any iOS 8.x devices around anymore, can somebody please confirm (i.e. from memory) if that's simulator only or an OS bug? Or point to a rdar?
Edit: Verified that it's not related to Swift, also happens with ObjC.
#maddy: Thanks for fixing the Tags!
Edit: Probably a regression related to this Bug with iOS 7.1: Tab bar background is missing on iOS 7.1 after presenting and dismissing a view controller
Cheers,
Frederik
Many issues that are seen in the simulator are not simulator bugs but rather OS bugs that the simulator is revealing.
In this particular case, I think the issue is that there should be a blur getting applied to that layer behind the tab bar. It may be the case that you have turned on the "Low Quality" option in the "Graphics Quality Override" (Debug menu). Try turning that back to "Default" as that should cause all effects to be applied.

xcode iOS Simulator will dim part of the display down, then back to normal over and over again

Has anyone experienced this behavior? Is there anything I can do about it?
When running any of my apps in the iOS simulator, my screen (external monitor) will show a patch of dimmer colors. Usually the whole simulator, but sometimes the line cuts right through it.
This happened in all versions of xcode from 4 to the latest GM of xcode 5.
It's frustrating because I like to record the screen to show demos of my apps, but the constant dimming / un-dimming makes it look bad.

Resources