Xcode 12.4 keeps freezing (Application not responding) - ios

Time to time, my Xcode starts freezing. Every few minutes for 5-30 seconds. I need to Force Quit as "application is not responding".
QUESTION
Is there any other way to fix this apart from removing connected devices as described here:
Xcode 12.3 keeps freezing ?
It says that even disabling "Connect via network" can help. But is there any other way? Because lets be honest - it is super convenient to test your app on real device without cables :)
Other things I have tried:
restarting Xcode
restarting MacBook
deleting everything in derived data folder

Related

XCode – Stuck on "Performing install actions"

Sigh. It started around 6 months ago and happened from time to time. For last 2-3 days I completely lost opportunity to debug on device. Whenever I'm trying it, I get infinite stuck on "Performing install actions" step. Sometimes, it ends with "unknown error occurred", sometimes with "Could not launch", sometimes it just stuck without any error.
I know the problem is in my specific iPhone, because it doesn't happen with another iPhones and it does happen with my iPhone on different machines.
What I've already tried and it sometimes helped me, but now it doesn't help at all:
restart XCode
restart Macbook
clean build folder/derived data (yeah, I'm an experienced iOS developer, so I've tried that)
unpair device and pair it once again (I should say, that previously I thought that was a silver bullet)
reinstall XCode
reinstall iOS Device Support
turn on/turn off Wi-Fi/Bluetooth
reboot iPhone
reset iPhone
reinstall provisioning profiles
pray
unpair Apple Watch
turn off Apple Watch
My setup: XCode 14.2 (tried different versions too, for example, XCode 13), iPhone 11 (iOS 16.2, started when I was on iOS 15)
Once again, I don't have any problems when I debug on Simulator on different device.
Any recommendations would be really appreciated, cause I'm already starting to lose my mind.

Very slow app debug startup, maybe "lldb-rpc-server" related?

I have a strange behavior for a few days. Every debug start in any iOS project on a physical device (MacOS projects start up normally) that I'm working on (even in a blank new project) lasts between one minute (on a USB connection) and over two minutes (on) a Wi-Fi connection). That's so annoying! I use Xcode 11.2.1 and Xcode 11.3 Beta, the same result on both. The host system is macOS 10.15.1 on a Macbook Pro Retina 15 inch (late 2012). The app will always hang in the home screen until it finally launches. While booting over a WiFi connection, a process called "llbd-rpc-server" receives several megs from the iOS device over the WiFi network, even on a completely empty sample project! I have never had this problem before! I have a backup system that does not experience this issue (same Xcode and MacOS version). So, is this an Xcode setting in the context of LLDB? I have already disabled all breakpoints, no change! Please help!
I have been suffering with this for a couple of weeks. I finally found https://forums.developer.apple.com/thread/123068 which includes the helpful hint:
I deleted folders inside ~/Library/Developer/Xcode/iOS DeviceSupport/
(folder's name started with 12.4.6), then run Xcode and launch an app
again, problem solved.
Which did in fact finally solve my issue.

Fix XCode Errors about Simulator in use and lost connection

These errors keep happening from time to time when i run my app. There doesn't seem to be any rhyme or rhythm to when the errors happen. Sometimes I can run and quit my app 100 times and not see these. Sometimes every 5 times they will show up. They go away but they are slowing down the dev process. How can I fix the underlying issue?
In my experience, these 3 cases occur in 3 different scenarios.
"Springboard Error" is a common iOS simulator issue since Xcode 5.
It has no fix, as yet, other than restarting the iOS simulator.
.
"lost connection" occurs when you disconnect the device or quit the simulator prematurely.
(example: click run and then stop it almost immediately)
"Simulator in use" occurs when you're already running, say, ABC xcode project in the iOS simulator and you want to run another Xcode project, say, XYZ project in the iOS simulator simultaneously.
Go to ABC project, stop it and then run XYZ project.

Why does Xcode 4.3.1 (4E1019) / 4.3.2 (4E2002) hang regularly with iOS simulator? [duplicate]

This question already has answers here:
Xcode 4.3.2, issue with running on simulator
(6 answers)
Closed 9 years ago.
Once in every 10-20 runs I experience a hanging Xcode when trying to start a new App run in the simulator. The App won't start.
I can quit the simulator, but Xcode will simply ignore quits.
The only solution so far is to kill and restart Xcode. Fortunately that seems to work without side effects.
(xcode 4.3 on Lion, 8GB mac mini, 5.1 iOS)
Edit: I filed a bug report with Apple.
Edit June 2012: it's still a problem in Xcode 4.3.2 (4E2002)
Edit October 2012: with Xcode 4.5 this issue seems to have gone away. I do seem to notice that every run on the simulator now has a pause of a few seconds before starting the application. Perhaps the issue was fixed by introducing a longer wait somewhere. (There is no such thing as a free lunch.)
Found a workaround that saves you killing Xcode when this happens: if a hang occurs when you are running the iPhone simulator switch to iPad simulator, or vice versa. You will get the message that the simulator is already in use, but ignore that. Then switch back to the device simulator that caused your trouble in the first place, a new run will work!
Perhaps Xcode has trouble contacting the running process in the simulator, above workaround helps.
i have found that the hang is harder than all that. can't even get in to switch simulators. Quit Xcode won't work because it doesn't want to stop all tasks. tried killing a zombied clang task, but that didn't work. didn't see either gdb or lldb tasks, though i know clang is associated with lldb.
so ... no answer except force quit xcode or kill -9 xcode processes in terminal.
update … try this https://stackoverflow.com/a/10277189/774691 (which is also referred to by this https://stackoverflow.com/a/13400190/774691 ) ! it's impossible to believe it works, but i use this 2-3 times a day, and i laugh and i laugh and i laugh. it's insane, but it works. vote it up. the guy who came up with that answer needs some serious upvotes!
Use GDB instead of LLDB (default) for debugging. There are some bugs in LLDB right now affecting launch hangs, false memory address readouts, uncaught breakpoints resulting in EXC_BREAKPOINT kills).
Just press command+b and quickly press command+r and it will run.
I'm seeing this a lot. Every time I start XCode, I get one run and then after that if I try to run again (after Command-Q in the simulator) I have to Force Quit XCode if I want to run again. I can see running simulator processes with ps -ef, but even if I kill them (and they die), XCode still believes there's a simulator running.
I'm having some success with performing iOS Simulator > Reset Content and Settings... before I quit the simulator. I'm also having some success with Stopping the simulator (from XCode) as soon as I've finished testing it.
It seems that stopping the App currently running in the simulator before new compiling-run solve the problem : command+. and command+r
Moutain Lion (10.8) + Xcode Version 4.4.1 (4F1003)
I reported it to apple
BUG REPORT
12872744
https://devforums.apple.com/thread/175685
You can also restart the Simulator and restart the app manually and this wakes XCode up and it leaves the stuck DEBUG mode and goes back to STOP mode.
You have to start the run in Xcode again but at least its stopped hanging.

Warning dialog "The Service is Invalid" when building and running App in XCode 4

I'm being annoyed by a warning dialog XCode 4 shows everytime I want to run the App I'm developing... it says:
"The Service is invalid.
Please check your setup and try again.
(0xE8000022)."
See image attached:
Sometimes the App will load on the iPhone 4, sometimes it won't. It's a huge waste of time! Please if anyone knows how to help it let me know.
I though it was because I enabled iOS Device Discovery to Support Wirelessly Connected Devices. When I saw it was an useless feature I disabled it, but still have the same dialog showing up.
Well, I decided to invest some time on the issue... and I think I have an answer to it, restarting XCode 4 or swapping between versions of XCode 4 didn't helped it.
I was getting the warning dialog with two different iPhones, both iPhone 4, running iOS 5.0.1 (Build 9A405). Then, I tested with an iPad 2 running iOS 5.0.1 (Build 9A405) and the dialog did stopped popping out, so I restarted the iPhone 4s and the problem is not happening anymore, I can build and run smoothly again.
Just as I suspected, the issue must be some background process listening on the device that XCode 4 needs to talk with. This process dies at some point during development or during normal usage of the phone and does not restarts by itself, you need to turn off the device and turn it on again.

Resources