I have my behaviours set up so that on successfully running a build, Xcode will open a custom debug window. I would like to then close this window when the run completes, however I cannot see an option for this. The best I can manage is returning focus to my main window without closing the debug window.
I have a two monitor setup and most the time use the second monitor for the Xcode organiser. Obviously the debug window is of more use to me when running the application, however I would like to have my organiser back on top afterwards.
Is there any 'Close Tab' behaviour or similar in Xcode 4.1?
Thanks
Update:
Just to say that I've filed a feature request with Apple. Since most of the other behaviours have options (a pop-down menu) to show/hide, it seems only natural that this should be an option for tabs/windows also.
I developed an Xcode plugin (Code on Github) that closes the debug window automatically after the debug session has ended. The plugin was developed and tested with Xcode 4.2.1 but should work with 4.1.
Download "Xcode Auto Close Debug"
Unzip it.
Move XcodeAutoCloseDebug.xcplugin
to ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/
Restart Xcode
Open menu "Xcode" -> "Preferences" -> "Behaviors" -> "Run Starts".
Activate "Show tab" and set the tab name "XcodeAutoCloseDebug" (this exact name is important!)
Run the executable and detach the debugger window (drag the tab out of Xcode to create an own window).
Stop the executable and the window should close automatically.
... let me know if you experience any problems.
You can run a shell script when run completes (don't forget to make it executable) :
#!/bin/sh osascript ~/Documents/close-xcode-tab.scpt &
And the I use the AppleScript Editor to create the scpt file :
tell application "System Events" tell application "Xcode" to activate tell process "Xcode" tell menu bar 0 click menu item "Close Tab" of menu "File" end tell end tell #keystroke "w" using {command down} end tell
It will take 1-2 seconds to close the tab (but if you edit the script to only send the keystroke, it'll close quickly). The limits are that we can't be sure to close the "good" tab as xcode4 don't let retrieve tab name (it's possible with safari).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With