Xcode: On debug, is there any way to prevent it from opening the navigator on the front-most window? - xcode

I'm trying to figure out how to use Xcode in a multi-window setup. I would like to have one window be my main window, and then have others that I use to do occasional spot editing. Here's the rub: I never want to have the navigator (or the debug console, for that matter) open in those other windows. I only want the navigator and console to open in the main window.
Right now, when I run the app the debug navigator and console open up in whichever window is frontmost (causing me to have both the main window and the secondary window with console pains and navigator open). Is there anyway to prevent the console and issue navigator from opening on the secondary window while preserving this behavior for the main window?

I'm not sure I fully understand what you want - but you can configure some of these things in the Xcode preferences under "Behaviors". Under "Running" you can click on "Starts" and it will show you the behaviors for when you run your application. You can set it to show a particular tab in the active window or a separate window. You can set up that tab to contain just the debugger. If it does show the debugger in the other tabs, you can minimize the debugger panes, and I believe it will save that state for the next time it launches. See here for more details.

Go to Xcode -> Behaviors -> edit behaviors. Now under build and running uncheck shows Navigator.

In Xcode Preferences > Behaviours > Runnings > Generates output, uncheck Show debugger with Current Views.

Related

Xcode: How to keep IB & Assistant editor opened when app crashes in simulator or debug is enabled

During editing I keep open Interface Builder on left and Assistant editor on right side. When a breakpoint is added or when the app crashes during runtime, the Interface Builder pane disappears, and it shows file which has breakpoint or crash. It's annoying as I've to go back to IB after each such instance and it takes too much of my time.
Is there anyway I can stop Interface Builder disappearing and crash/breakpoint file to be shown on Assistant editor or in any other window?
A simple workaround would be simply to duplicate the current window by using keyboard shortcut Command + Shift + T before hitting run.
That way when the breakpoint hits the offending line, it will happen in the new window which you can simply close, and resume work in your old, organised editor environment.

How can I specify on which monitor the console window is opened?

I've currently connected two monitors via a dock to my notebook.
When I'm running my console application, the console window always pops up on the first monitor. How can I change that it's automatically opened on another monitor, e.g. on monitor 3? Maybe there is a property I need to modify?
It's very annoying to always drag the console window onto the monitor on which my IDE is opened.
Console applications (unlike GUI applications) don't create their own window; that's done by Windows, and in the case when you're running in an already created console, then you kinda inherit, e.g., cmd's window.
What you can do, though, is to find your window and move it to a different monitor.
Another option is to change the window manager settings for that application in the properties of the console window under Layout. Especially the check box »Let system position window«. To do so, first move the window where you'd like it to appear, then open the properties, go to the Layout tab, and just click »OK«.

Automatically switch XCode to Project Navigator after debugging

Upon hitting a break point in XCode it switches the left most panel to the Debug Navigator. If I then stop debugging the panel maintains the Debug view and contains the text...
No Debug Session
Then I like to manually switch the panel back to the Project Navigator in order to carry on developing.
Is there a way of configuring XCode such that it automatically switches to the panel layout it had when I started debugging the app?
In Xcode, go to Xcode -> Behaviors -> Edit Behaviors. Select Running | Pauses in the left section of the dialog. In the main section, choose Show Project Navigator.
The Behaviors feature in Xcode is quite powerful for customizing the workflow. I actually like to have separate tabs for editing code, building and running. You can configure the behaviors to switch to the appropriate tab (which is configured to your liking) whenever you build or run the app. Really useful. I think I've learned about it from one of the older WWDC videos about the efficient use of Xcode.

How to show Xcode debugger in a window separate from Xcode?

I was watching a video lecture from iTunes U., where instructor showed how one can take a debugger section of the Xcode and was able to pull that window away from the main.
Unfortunately, video showed instructions on how to do it in Xcode3. How might one do it in Xcode4?
How can one either detach a debugger section or, possibly, configure preferences to do it automatically?
Open a new tab, show the debugger (cmd-shift-Y) and drag the divider all the way to the top. Close the navigator (cmd-0) and inspector windows (cmd-opt-0), then drag the tab off into a new window.
If you name the tab before you tear it off, e.g., "Debugger", then set up a Behavior in Xcode's preferences ( Preferences -> Behaviors -> Run Starts -> Show Tab "Debugger" ), it'll show that window when you run your app. It'll even recreate it if you close it.
If you have access to the WWDC 2011 videos, "Maximizing Productivity in Xcode 4" has a lot of great info.
Here's a screenshot before tearing the tab off:
I know it's a little too late, but I'm going to be borrowing from this answer. Go to your preferences, go to the behaviour tab. Change the running behaviour to show a new window.
If you don't want the window to have an editor or toolbar, you can customise it that way too.
Xcode 11
Change behaviour
Xcode -> Preferences... -> Behaviors -> Running -> Starts -> Show tab named <tab_name> in active window
After that <tab_name> tab will be opened automatically
To create a new tab manually:
Create a new tab
File -> New -> Tab
Rename the tab
Window -> Rename Tab... -> <tab_name>

Xcode 4 - detach the console/log window

Is it possible to detach the console/log window in Xcode 4?
Even better, how?
Go to Xcode preferences, and open the Behavior tab.
Tell Xcode to open a tab called "Debugger" when "Run Pauses" or "Run Starts". Then run it, and break that Debugging tab out into another window (drag it off the tab bar into its own window by just letting it drop outside the current window). Now reform it to your hearts content; it will stay that way. Also don't forget the little controls at the top right of the console window that slide the local variable display out of the way so you can have a full-width console on demand. I am not sure about keyboard shortcuts for that yet.
I usually keep the Debugging tab and one other tab in a separate window, for debugging tasks, and all my other editing tabs in a different window (and the debugging window on a separate monitor with the simulator). With the settings above it also means that, while editing a debugger reaching a breakpoint, it will not interrupt my editing by suddenly bringing forth the console.
Sure, create a new tab, drag it off the original window, and expand the debugger area to be the whole tab. Now, whether Xcode will remember that tab and its placement is another matter. File a bug with Apple to let them know your displeasure.
Taking jshier's advice a step further, you can do File -> New Window, and expand the debug window to take up the entire window. But you have to manually expand it every time you open it. Ugh.

Resources