iOS Simulator hangs with beachball loader for 5-10 seconds to often - xcode

For almost half a year my simulator is often very slow and hangs for a couple seconds when I'm touching the running app. This happens a lot when touching TableViews or MapViews (zooming, swiping).
For example I run the app go to a mapView try to zoom in and swipe then always for 5-10 seconds the app hangs and shows the beachball (loading cursor). Then the app continues to work for a bit and it hangs again, continues to work, etc.
My colleagues don't have this problem on the same macbook (Pro late 2013, 2.3Ghz i7, 16gb, OSX 10.11.2) and same xcode project.
I've reinstalled Xcode (running latest), iOS Simulator (both iOS 8 and 9 and 9.2 have these problems).
I cannot find anything in the console and I have this with other xcode projects as well.
Hope someone can help me with this otherwise I will have to reinstall my macbook pro.
So I've tried:
Reinstall Xcode
Reinstall Simulators
Looking at the console app -> all messages
Tried other Xcode projects
Tried other iOS version simulators
Remove all my plugins
Checking the CPU and Memory loads -> nothing

There is a known bug in the simulator in Xcode 7.1 and 7.2 related to accessibility. When various accessibility introspection tools are enabled, the simulator app performs poorly. I suggest you use the Xcode 7.3 beta or disable the tool that is triggering the issue.
See https://forums.developer.apple.com/thread/24274

Related

Xcode 14 stuck at Launching App on Simulator after few runs

I have update my xcode to 14.1 and macOS to Ventura 13.0.1.
When I run my app from xcode on a simulator iPhoneSE 3rd generation (iOS 16) it works fine a few times. After that xcode is unable to launch app on simulator.
The number of time I try to run it keep adding Launching [App Name] to process .
If I restart simulator it start working again but same thing happens after few runs.I also created new simulator and same thing happens to it as well.
Note: I'm facing same issue for different projects so I think it's not related to my project.
I was facing this issue on an M2 Macbook Air, every build would open the simulator the first time, but on a second run it would hang on a black screen during "Launching app." It turns out the "fix" was to disable "Open using Rosetta" (Applications > Xcode > Right click > Get Info) which I had turned on because of a third party dependency in a work project that didn't create a proper universal binary, which broke using the simulator on M1.
I think people updating to the new version are installing separately, which has the same effect of disabling the rosetta setting if they were using it already.

Xcode 12.3 iOS 14.3 simulators Yellow Dock / yellow translucent issues

Today I downloaded the release of Xcode 12.3, and I went running the iOS 14.3 simulators and it seems like there is a graphic glitch that all translucent views are yellow, dock included.
I redownloaded iOS 14.2 and those seem fine. It just seems really odd. I've submitted feedback, but I was curious if anyone else has seen this?
I'm on macOS v10.15.7 (Catalina) and am curious of if it's just Catalina or also macOS v11 (Big Sur).
Xcode 12.4 RC has announced fix.
iOS simulated devices no longer display an incorrect yellow tint in translucent UI elements. Certain GPUs may continue to display the tint with some tvOS simulators. (71203015)
I think it is a bug related to the discrete GPU.
In addition, this bug causes the background of the on-screen keyboard to be almost RGB(0,0,0). Experienced on MBP 2017 with Catalina.
Workaround I - Using integrated GPU
In the simulator, set menu File → GPU Selection → Prefer Integrated GPU to work around this bug.
Restart the simulator.
This was tested on a MacBook Pro with Catalina and Big Sur. As comments suggest that it won't work on iMac.
Workaround II - Reduce transparency
In the simulated device (e.g. iPhone), Settings → Accessibility → Display & Text Size → turn on Reduce Transparency.
Notice that it can only reduce the previous 'solid' yellow to 'fairly light'.
I find this workaround, as the discrete GPU can be used, is more suitable for testing the UI logic than the previous solution.
This was tested on a MacBook Pro with Catalina. Might work on iMac.
Are you using a MacBook Pro? I had the same bug.
I solved in the following ways.
Step 1: Unplug all cables, including the charging cable
Step 2: Restart the iOS simulator
Best way around it (what I've done), is to download the 14.2 Simulator pack from within Xcode.
Open Xcode->Preferences
Tap Components
Tap the 14.2 Simulator pack and Xcode is going to start installing it.
It's a workaround till they fix that miserable error.
It is Xcode 12.3 bug! you can see that sometimes in the code interface builder too:
It is not critical but If you really care about it, download and use the previous Xcode from here
Nothe that you can't build for iOS 14.3 if you choose to use Xcode 12.2.
More description
Xcode always have unknown issues at the release point. Some of them are critical like this with 54K views! and some are not like this issue with about 5K views in only 13 days.
My suggestion is to always have 2 Xcodes at the same time until you are sure about Xcode bugs!
Happened to me as well, while I was charging my MacBook Pro 2016. I closed my Xcode, disconnected my charger from the Macbook and run it again. The problem was fixed.
One thing to point out/confirm: Seems the issue is limited to the simulator. The issue does not persist when sideloading the project to iPhone.

Xcode 12.3 keeps freezing

I updated to the latest AppStore release of Xcode (12.3, 12C33).
It worked fine for an hour or two. After that it started to constantly freeze after being open for a few seconds to minutes.
I've tried the following, all without success so far:
restart macOS
clear derived data
tried with different projects
updating to latest macOS 11
Any other ideas or suggestions how to fix this?
Update
I can confirm that this is fixed in Xcode 12.5
I found an answer by Darr on the question "Xcode freezes after upgrade to 12.3" on Apple's developer forums that worked for me:
Unpairing my device connected via network and using only lightning cable seems to have resolved the issue for me.
Xcode > Window > Devices and Simulators > device > Connect via network
After going mad, I fixed this by removing all devices from Devices and Simulators (I had connect via network activated).
For now, it's working fine.
Power off your Apple Watch
Xcode may hang if the host Mac is connected to an iOS device which has one or more companion watches. The hangs occur when the watches aren't fully prepared for development, or if they are experiencing poor wireless connectivity. (72490921) (FB8945320)
Workaround: Power off the watches, or unpair them from the iPhone.
Xcode 12.4 Release Notes
You can force Xcode to freshly prepare a watch for development using these steps:
Force-quit Xcode.
Power-off and disconnect all iOS device from the Mac.
Reboot the Mac.
Launch Xcode, close all projects, and open the Devices and Simulators window.
Power-on and unlock an iOS device and its companion watchOS devices by entering the passcode as required.
Plug the iOS device into the Mac using USB cable.
Check each iOS device and each watch for any pairing request and approve the requests.
Monitor the status of device preparation in the Devices and Simulators window. If Xcode presents device-preparation errors, follow the guidance in the error message to resolve the error.
Once Xcode finishes preparing the iOS device and its companion watches for development, repeat steps 5 through 8 for each remaining iOS device and its companion watches until you verify that Xcode has prepared all devices for development. You may now open your Xcode projects and resume development.
I've been having the same problem. I had an iOS device connected via USB, unplugged it and it un-froze. Then I continued to have issue requiring force close each time.
I then clear derived data and things have been fine. I opened a StickerPack project and also had the same issue. Clearing DerivedData also fixed it.
Clear Derived Data:
Xcode pulldown menu > Preferences > Locations tab
Click the little arrow next to the path under Derived Data.
Delete the entire folder for you project. It will look like "MyAppName-bwonddotztrgkkfexrjxoncvmjit"
See this explanation about whether it's safe to delete DerivedData for your project.
I had the same problem with appstore version and someone advised to install from site, now it works fine. https://developer.apple.com/download/more/
Disable WLAN on my iMac fixes the problem currently.
Hope they will releast a fix very soon.
Xcode 12.3 is unstable and many times it crashes.
I reverted back to Xcode 12 and copied disk image of 14.3 in Device Support folder of Xcode (Contents > Developer > Platforms > iPhoneOS.platforms-DeviceSupport).
This I needed to debug on iPhone device having version iOS 14.3
https://github.com/mspvirajpatel/Xcode_Developer_Disk_Images/releases
I recently had similar situation. My Xcode 12.3 project could not be opened. I tried to open directly from popup that appears on start of the Xcode.
What worked for my was to downgrade Xcode to 12.2 and launch Xcode on new project. And then click my old one.
Maybe it would work without downgrading but I didn't check.
I had this problem too. I fixed it by going Devices and Simulators in the Windows file and disconnecting the iPhone reference I had for my phone when testing and app. Since the phone was no longer connected, its presence seemed to create a freeze.
In my case XCode 12.5 hangs/freezes on startup more or less instantly, right after it opens kind of an empty workspace.
I removed everything that I could imagine that deals with XCode on my machine, but it didn't help.
At the end I just used the hotkey for "Close Workspace" - Ctrl+Alt+Cmd+W
I hit this combo very often, very fast right after opening XCode and it worked!
The strange empty workspace showed up and closed instantly - now I could select other projects and everything works again.
There could be the multiple reasons and in my case reason was source control
preferences > Source Control > uncheck Enable source control
I have these performance problems with the newly updated Xcode from the AppStore to 12C33 (Xcode frozen for many seconds, instability of interface builder, etc.) only with apps which have frameworks added with cocoa pods and when working in the xcworkspace-file. (Integration of frameworks with Catharge even fail with error message 65). I'm running Xcode under macOS Catalina. Don't know what the technical reason could be, hence would appreciate if someone has an idea on this how to fix it.
Update: In the meantime I could fix it:
I eliminated my own devices from the device list and did then a deintegration and a new install of the cocoa pods for the projects. Afterwards I setup my devices again in the device list and all worked well again. Only eliminating and reintegration of my devices as described above didn't work in my case.

Xcode 4.6.2 IOS Simulator

Τhe last few days I experienced a problem with Xcode 4.6.2 when I try to run twice an application, in IOS Simulator only, the program throws an exception.
Somehow the simulator keeps the instance active even though the stop button was pressed and requires to press it again many times in order to run it again,on the other hand in my device Xcode works properly.
Any ideas ?
Xcode 4.6.3 was just released to fix a hang/crash issue with the ios simulator (and lldb debugger), particularly on osx 10.8.4.

IOS Simulator cannot find sdk and the simulated application quit errors

I have been having this Xcode problem for a couple of months where my iOS simulator stops working whenever i run any application on Xcode and says, "The simulated application quit." and "iOS Simulator could not find the SDK. The SDK may need to be reinstalled." I am running Xcode 4.3.3 and have iOS sdk 5.1 and everything updated but it happened on my previous version of Xcode also. I have tried reinstalling Xcode over 10 times now and have been posting this question for a while now. No one has been able to get a solution. I have even sent in a bug report to apple but i don't think they will respond. I have tried doing everything every other person that has this problem has been told to do in other threads. I'm honestly thinking about just buying a new mac and seeing if Xcode will work on that one or taking in my current one to get looked at by apple. So if anyone has any ideas please let me know.
Go to Xcode -> Preferences -> Downloads and make sure the "Target SDK" you have selected in your project is in fact installed under the Downloads windows. For me this magically was uninstalled. Once i installed the SDK that my app was using, all worked again
This worked for me: http://www.colinbowern.com/posts/the-simulated-application-quit
I just deleted the folder "6.1" under ~/Library/Application Support/iPhone Simulator
The I just launched again the app and the simulator recreated correctly the 6.1 folder.
Resetting the simulator settings (iOS Simulator > Reset Contents and Settings) resolved this issue for me.
I had the same issue. For me suddenly all the installed simulators (4.3 through to 6.0) stopped working. I then went to Xcode -> Preferences -> Downloads, and there I had the chance to update at least the 5.0 simulator. This is now working, yet I was not able to get the 4.3 or 5.1 or 6.0 to work.
I have personally experienced a weird thing with xcode regarding this issue. Sometimes the sdk is installed properly but it still gives this error. I have two classes, if I call first class from the app delegate then the ipad simulator works fine but when I call the second class then it gives the error that the sdk needs to be re-installed.
In my case when the error occured, I had two errors in the second class. When I corrected the errors after debugging, the ipad simulator started to work completely fine. This is quite weird but its not the problem with your sdk, the problem is somewhere in the code.
This just happened to me. I tried to launch with iPhone 5.1 Simulator, got the error "iOS Simulator could not find the SDK. The SDK may need to be reinstalled." I tried running iPad 5.1 Sim, which worked. I switched to non-retina iPad. Then I tried running iPhone 5.1 Simulator again, and it worked.

Resources