How to prevent debugger bar from appearing in Xcode 7? - ios

The problem
I'm not sure how to prevent the debugger bar from appearing/disappearing for certain files. This is an issue that has occurred ever since I started using Xcode 7.
Why it is a problem
Two to three lines are selected in the editor after I tap in it, to switch from/to the assistant editor, as show in the attached image below.
Here is what I know about the issue so far:
I've looked online, and found no information on the issue.
The issue still occurs if I elect to show the Assistant Editor on the right.
Some files do not cause the debugger to show.
Even if I choose to hide the debugger in Behaviors, the issue still occurs.
If I use the activation button to show the debugger, and then try to drag it down, the bar sticks at the bottom, and does not disappear.
For files that don't show the debugger bar, I'm able to drag the debugger down and it hides completely.
This does not happen on Xcode 6.4.
This occurs on both OSX and iOS projects.
Ideal Solution
I'm looking for a way to hide the debugger completely, so that the editor doesn't freak out and select lines when I tap inside it. Any help is greatly appreciated!

After more experimenting in Xcode, I found a fix.
Here are the steps for anyone else who is having the same issue:
Delete the UI Testing target
If you are using UI Testing in the project, then re-create the UI Test target, and files will no longer show the debugger bar.
I went through a lot of permutations before finding this, and nothing else had any effect. However, I'm not sure how long this fix will last, since whatever bug in Xcode caused it to occur in the first place could cause it to surface again. This is especially true for projects that have a large amount of UI Testing.
Edit
The debugger bar does reappear for a new file, even after adding the UI Testing target had been removed and re-created for the project. This happens even if the new file isn't a view object.

The Xcode debugging tools are integrated throughout the Xcode main window but are primarily located in the Debug area, the debug navigator, the breakpoint navigator, and the source editor. The debugging UI is dynamic; it reconfigures as you build and run your app. To customize how Xcode displays portions of the UI, choose Xcode Preferences > Behaviors.

Related

Xcode Record UI test - How to remove XCTestCase auto generated code drop downs

See the attached screen shot, when generating Xcode UI Test code using the record button, the generated code contains annoying drop downs that I cannot figure out how to remove.
When the popover is not displayed, then double-clicking on the code removes the menu tokens. It will now no longer appear in version control.
If the popover has appeared you need to select a value or otherwise dismiss the popover before the double-clicking works.
If there was a bug in earlier versions of Xcode, it is working at least in Xcode 10.3 (and possibly earlier versions)
I don't think there's any built-in function in Xcode to do this, so the best I can come up with is a regex that you can use to search and replace:
/\*#START_MENU_TOKEN#\*/|/\*\[.+\]#END_MENU_TOKEN#\*/
Interestingly, this works in the Xcode editor too, even if the actual texts START_MENU_TOKEN and so on are converted into dropdowns and as such invisible.

Assistant editor(Xcode 7.3) always showing interface file in storyboard , even when I choose manually

Even after deleting derived data many times, and trying other things, I am still facing this problem. Can you help me?
You can try using the shortcut key instead, to open up the assistant editor.
Shortcut key: -
option + click on the file which you want to open up in the assistant editor
Guys I just stop dealing with this problem by changing the settings in xcode 9.2. And now i use Navigation Pane.
Here is how it works :
Ok now if you go to xcode -> preferences -> navigation
and Choose the "Uses Focused Editor" as in the picture below.
Now you can manually select inside the Navigation Pane.
Just click whichever page you would like to change and select in the Navigation Pane.
Here is a few screenshots :
Pictures shows code files but it works with everything you can click in the Navigation Pane.
Try to drag and drop file from the Project Navigator into the path of the Assistant Editor as temporary fix.
You also can click on this icon to bring recent files.
Try to clean your project, clean Build Folder, restart Xcode.
Make sure the view controller in your Storyboard has correct custom class name.
I think I know the problem you're having. I experience it too, but it's intermittent. Sometimes clicking Manual shows me the entire project folder and I can select the editable classes, but other times it only shows the interface versions of them, which aren't editable and cannot have IBOutlets dragged to them (you can tell b/c it'll say internal class and has less code). I have noticed that if I toggle back and forth between Automatic and Manual, I can usually get the editable class to appear. I also will toggle the assistant editor off, select a different View Controller or two on the storyboard, then go back to my original one, turn the Assistant Editor back on, and it starts working again.
There are other discussions of it here, here, and here. This suggestion of turning off indexing sounds intriguing and worth a try if the problem keeps reappearing. UPDATE: This trick with hitting the + and opening a 2nd file, then closing the interface file, worked great when I tried it just now.
Here are pics of how the Automatic side shows the actual file when the Manual side only shows the interface, which says internal next to class:

Xcode files disappear from project navigator

I'm running into a strange Xcode issue where files that match my search are disappearing from the project navigator. With only 1 tab open in Xcode, I type a few letters into the search box in the project navigator. The list of files immediately filters to match my search term.
I then do nothing, and wait for 5 seconds, and Xcode refreshes and the files disappear and it displays "No Filter Results". If I add or remove a letter from the search box, the files come back for a few seconds, but then they disappear again. Is this some Xcode glitch? Or do I have to change something to get my files to stop disappearing when I do a search. I am on Xcode 7.3.1.
None of my other navigator tabs have any text in the search boxes. I also do not have the 'source control' or 'recent files' filters selected, as shown here:
I also have XCode 7.3.1 but cannot reproduce the behavior you are seeing. Please check following - there is filter box at the bottom, make sure that nothing there. If that does not resolve the problem check your settings in Xcode->Preferences->general->Find Navigator Details. Also try reinstalling xcode.

Xcode Utilities rigth panel don't lord information anymore while in Storyboard

I have a weird problem, and can't figure it out.
The comme from the storyboard in XCode Version 7.0 (7A220).
When I display my main.storyboard clicking on the file, everything appear, but if I select UI elements or ViewControllers nothing get displayed in the Utilities rigth panel tabs. It used to work fine a hour ago.
Here are the screenshots:
This is the Main.storyboard opened in Xcode, and I selected a random UIView.(It does the same with any kind of elements)
Now, as you can see, nothing is displayed here. Usually I can access the element properties...
This one is the only one who still appear, but it loads weirdly and takes time.
I don't have another computer for testing, and I can't work without this, so if you have any idea!
Restarting computer or Xcode never solves the problem.
I did two things, don't know which solved the problem.
First thing was to go into Window > project > 'yourProjectname' and the press the "delete derived data" option.
Second thing was to close the concerned tab on Xcode.
Hope this can help

Xcode 4.2 jumps to main.m every time after stopping simulator

This is more of a general annoyance. Every time after stopping the simulator, Xcode jumps to main.m for some reason. On the left nav, it jumps to the Debug Navigator.
Is there a way to fix this?
It's annoying because I might be testing a certain line of code, and now each time, I need to make a couple of clicks just to go back to that code.
This problem is not new, seems to get worse though. At the time of writing this, I was on the GM seed, but this problem persists in XCode 4.2 final. This was not a problem in previous versions of XCode.
When we start debug from xcode, the debugger sets itself up to monitor signals from OS. When we press stop button in XCode (or hit cmd + R - which first stops existing instance running and then try to start new one, somewhat equalant to we press manually stop first and then run) SIGKILL is sent to the debugger.
Whenever the cause of interruption is from outside the app (in other words all cases where SIGKILL is sent, like stop button press) , debugger jumps to main, since main is the root of the app and the place where your app meets the OS. Debugger has no way to identify why this SIGKILL is issued (pressing stop button in xcode/ press cmd + R/ delete app from multitasking bar etc), but it treats SIGKILL as outside interrupt, and nothing related with your code. So it jumps to main.
If the cause of interruption is from inside the app (like app crash/SIGABRT) debugger handles it and jumps to the place of crash, which we normally see.
I do not consider this as an xcode bug, rather a normal way of handling SIGKILL. But if you want to stay at your code and do not want to jump to main you can do two things
You can do as Gabe suggested. As BBonified said, it is like a band-aide,
but I think it should work (personally I never tried that)
Report a bug/request for a feature here. Let me tell you you
are not the first one to do so. Already a bug has been reported. See
this and this. But I don't have much hope of a positive action from Apple
And I agree with you, it is sometimes annoying. Especially if you have experienced differently in previous XCode versions. But we can only take what they give here.
I guess it's fair to call it a bug, Xcode 3 specifically suppressed this useless artefact.
I've had success (four times and counting) with this one-liner in ~/.gdbinit:
handle SIGKILL nostop noprint nopass
Taken from this gdb manual:
http://www.delorie.com/gnu/docs/gdb/gdb_39.html
Not sure if it applies to lldb as well.
I tried what David suggested but that didn't work for me, so I tried something similar:
Open Preferences, select Behaviors tab.
Select "Run exits unexpectedly" from left column.
Select "Show debugger with current views".
I'm using Xcode version 4.2 build 4D199.
EDIT: That worked for about 15 minutes. Then it reverted to bringing up main.m in the editor again.
I had the same problem and it WAS really annoying, especially when you were in the middle of debugging, stopping/launching the app several times in a row after small modifications.
Everything is solvable through settings in Xcode user preferences:
Just go to "run completes"
There find the "Show" line and click the checkbox
On the same line modify target to go to "Current" in the dropdown menu.
There you go. Xcode will not move your editing view from now on. Enjoy.
PS: Xcode version 4.2 Build 4C199
Go to Preferences -> Behaviors. Choose "Run Completes" in the left hand side. Check the box next to "Show Tab" and enter a tab name. I use "Edit". This way whenever you stop, you will always be back at a tab called Edit.
None of the other solutions listed were suitable for me, so I made a macro (using an external hotkey utility).
(wait 0.1 second after each step)
command-period
command-1
down arrow
up arrow
command-j
enter
Use this key instead of the normal stop, and you end up with your cursor positioned where you left it. Very nice.
Xcode -> Preferences
Under Behaviors
Click on Run Starts
Checkbox for [Show] debugger with [Current Views]
...worked for me.
None of the preference adjustments seem to work for me.
I have been able to track the offending sequence of events. The SIGKILL error message will occur when you run your app and use multiple threads. For instance, when using UIWebView in my app it will abort to main.m. I verified that when UIWebView is not called, XCode can be stopped without the SIGKILL error message returning the user to main.m
It looks like there are at least two threads that get started when initializing a UIWebView.
However, any threads created by you during the running of your app will cause the SIGKILL to improperly notify XCODE to return to the main.
You can see this in the GDB that there is a switch just before SIGKILL:
[Switching to process 24957 thread 0x2103]
[Switching to process 24957 thread 0x7403]
[Switching to process 24957 thread 0x207]
Program ended with exit code: 0
It is definitely still a bug with XCODE that will hopefully be fixed.
For now, if you avoid executing code that launches a separate thread, it will not change the view back to main.m For code that does launch additional threads, I would recommend quitting the simulator to return to edit mode in XCODE.
None of these solutions worked for me and I find the behavior too intrusive to put up with.
I get round it by using the 'Assistant Editor' instead of the editor as my main editing window. You access the Assistant Editor using the tiny little bow tie button at the top right of the single window.
You can set then it to 'Manual'. Click on the button that is the far left crumb of the breadcrumb trail at the top of the Assistant Editor frame and select Manual from the pop-up menu that appears. The Manual setting allows you to select the file you're editing by clicking on the second to last crumb of the breadcrumb trail and selecting the file from the pop-up that appears.
I then just minimize the size of the main editor - or use it as a secondary editing window, useful given that you can't split the editors into multiple frames any more. Far from ideal - but that's XCode 4 for you.
This might not be much. I was able to avoid this problem 99% of the time by waiting for 2 seconds or so after stopping the app, before relaunching it.
UPDATE: After upgrading to the latest Xcode, I am prompted to use LLDB instead of GDB. The problem seems to be gone now.
I was trying to find the offending line when my code was breaking, so what I did was:
Go to where you define your breakpoints (breakpoint navigator, according to the documentation)
Click in the "+" sign in the left bottom corner of the navigation area
Click on Add Exception breakpoint
You click Done
Run your app
Xcode shows you the offending line.

Resources