Make Xcode return to code editor after running

0

This is about how to change the default behavior of Xcode 5.1.1. When I'm running/debugging an application, Xcode shows the console output in its main view. After quitting the app, Xcode still shows the log. I would like to change this so that Xcode returns to the code file I was working on before running the app.

I have looked in the "behavior" settings of Xcode and found out that the log is displayed because the configuration is Running: Starts -> Navigate to 'current log'. When I remove this setting, Xcode won't switch to the log when running starts, and after running, the main view still shows the same code file as before.

However, I find switching to the log very useful and would like to keep that behavior. Is it possible to make Xcode show the log when running starts, and going back to the code editor when it ends?

waldrumpus

Posted 2014-06-22T09:24:18.043

Reputation: 439

Answers

0

I have found a workaround using named tabs.

First, make sure the tab bar is visible. If not, use View > Show Tab Bar. Next, rename one of the tabs by double-clicking its title. Enter the name Code Editor. Next, add a new tab using File > New > Tab; name this one Debugger.

Now the behaviors come into play. In the preferences, tab Behaviors, section Running > Start, check Show tab named and enter Debugger for the name. Also check Navigate to and select the option Current log.

Now switch to Behaviors section Running > Completes, and activate Show tab named, Code Editor.

This behavior configuration will switch to the Debugger tab when execution (run/debug) starts and display console output. Once execution ends, it switches back to the Code Editor tab and show the exact same code file and place you where at when you began execution.

waldrumpus

Posted 2014-06-22T09:24:18.043

Reputation: 439