Do you also have any difficulties while debugging with Xcode 13.4. Most of the time it hanging/stuck at break point. I always have to stop(need to hit stop button at least 10 to 12 times) and run again. Even though I do that, same thing happens over and over.
And also most of the time it is unable to expand the data at breakpoint to see what's in there.
I tried to clear DerivedData, to restart the Xcode, to close apps in Mac with high memory usage and so on. But nothing help.
It would be really nice if you can share your solutions for the similar issue.
Thank you.
Related
Building for instruments already takes an inordinate amount of time - about 5 minutes. And then I'm trying to investigate where a memory leak is coming from, so I'm commenting out various things then testing, again each test taking 5 minutes to build.
So then it's after an hour or so, and much frustration at the issue coming and going, seemingly without pattern, that I see something which I commented out, appear on screen. So I change the title bar text, build, and start in Instruments. Just as I suspected, the title text hasn't changed. So here's my process:
Build for Profiling.
Profile.
Instruments and the simulator both open, or come to the foreground ready to test.
I press the record button.
This does not make it test the latest version, but actually, just a recent version. I suspect the issue comes when you don't fully, entirely, close Instruments. While it does build, and puts Instruments in front of you after pressing Profile, it doesn't use that build.
This is incredibly frustrating. Is there a pattern to this? Something, I'm somehow doing wrong? This has wasted a lot of time.
I'm having the same problem with Xcode 6.3.1...
I've managed to overcome it by doing the following but it's cumbersome:
Close the Instruments app.
Clean the project.
Run the project as usual on the simulator and stop it after the project is launched.
Profile the project again.
If anyone knows why this is happening and have a better solution, please post it here.
This problem persists for me in Xcode 6.4. I find that
Quite Instruments & Simulator
Rebuild & Run in Xcode
Quit Simulator
Press Cmd+I to profile from Xcode
seems to work for me and is a lot quicker than doing a clean.
I am observing that whenever I am profiling my application using instrument in Xcode 6.0.1, application hangs every time while I am browsing through the application. I am using iPhone 5S (iOS 8.0.2) to run my application. When I run the application on device it runs all fine.
Found the fix - disabling the NSLog statements (profiling on release and not on debug) solved the issue for me.
Extending on Abhinav's correct answer, NSLog() is indeed triggering the issue, but not all NSLogs, only some very large ones. In my case I was logging some long responses from a web service, and commenting only those ones out fixed the problem of Instruments hanging. I guess this is the reason why the issue is not as widespread as you'd think (I couldn't find any reference to it on Apple's dev forums).
I've just been solving the same issue and it turned out to be caused by something else. I'm not 100% sure yet which part of my code is responsible, but it's got something to do with accessing the internet. So I've switched into Airplane mode et voila!
So my conclusion is that a network request was hanging the main thread (only when running Instruments tho -- weird) and if anyone else is running into similar problems, try finding what might hang your main thread.
Hope it saves some time :)
Z.
Follow those steps:
Run app on your device. It would be better if you set Release build in Edit scheme menu.
Go to the Debug navigator section on your Navigator (left menu in Xcode).
Click on CPU.
Click on Profile in Instruments and choose Transfer.
Instruments will run Time Profiler. Then in top panel click on Library button (looks like "+").
The library menu will open. You need to select your instrument.
I've been struggling with an weird issue for some time now. When running my app with the iOS Simulator initially closed it launches correctly. But if I then run it again without closing the simulator it crashes and just prints (lldb) in the error log. If I then run it again (without closing the simulator) it launches correctly. And if I do the same again it crashes. So it seems to be every second time. It works when using a iOS device and I have a college with the exact same project who doesn't experience this problem in the iOS Simulator. What I've tried is cleaning, reset contents and settings, manually removing the app, restarting my computer and reinstalling Xcode.
There's an issue with OS X 10.8.4 that causes random simulator crashes.
https://devforums.apple.com/message/817179#817179
A couple of workarounds have been suggested, including switching to GDB. See here:
We have found the issue. It is a process killing race condition in
"debugserver" when it is killing the application it is debugging which
causes this problem to occur.
The work around that should work for
all folks is to kill the app first, wait for it to go away, then hit
CMD+R. The quick turn around of just pressing CMD+R is now showing
this thread race condition more often in 10.8.4.
Apple resolved this issue in June 13th, 2013 build:
Yes, I meet it too. In Product -> edit scheme change the debugger from lldb to gdb. Can simply solve it. Hope Apple can fix it asap.
Using both Xcode 4.4 and 4.5, I can't get the iOS simulator to actually start. It used to work, but one day it just stopped without any reason. I've tried reinstalling Xcode many times and rebooting, but to no avail. It just sits there bouncing away in the Dock, almost taunting me. Running my app on an actual iPad works fine, though. What could be causing this?
Here's the output I get from force closing it.
EDIT: it works now. The only thing I did was delete com.apple.finder.plist in ~/Library/Preferences to fix my Time Machine not working. Whether or not it was actually this that did it, I don't know, but it works now.
My app runs fine on the simulator. However, when I run it on my iPhone, it gets as far as displaying the splash screen and then just stays there. It's an iPhone 3GS and the software version is 5.0.1. That's what happens when Debugger = None. When Debugger = GDB, I get an error message, 'Thread 1: Program received signal: "SIGABRT"', which I have learned can mean almost anything. I'm running Xcode 4.2.1.
I'm coming off a long hard night of battling with this error message, which appeared seemingly out of nowhere in a stable mature app. I tried to roll back with time machine, I deleted the Derived data for my project in Organizer a few times and did some of the other stuff recommended in this thread.
XCode 4 hangs at "Attaching to (app name)"
It got ugly. For a while, I couldn't even reboot my machine. Eventually, I was able to relaunch finder and suddenly the Simulator was working again. Two more pieces of information, I used to have to click allow in two dialog boxes when running on my phone but now it's only one (the one about code signing, I forget what the other one was about). Second, I find all the build architecture target stuff confusing but I set all my Base SDKs to be latest iOS. Lastly, I tried Product --> Clean and then Build but that didn't fix it. As you may have gathered, I'm getting my butt kicked. Any help would be much appreciated.
Dessie
Many times I have experienced Xcode going "crazy" with a physical device connected. At times I saw the behavior you describes; other the app simply refused to start;
In all of those cases, I could fixed it in either of two ways:
disconnect the iphone and connect it again;
reboot the device.
This is a very common problem that is easily fixable.
1) remove the app from the device
2) reboot the device
3) close Xcode and you must restart, logging out will not work