views:

33

answers:

2

I am developing an iOS application. I spend a lot of time in the simulator and it would be really helpful if I didn't have to switch back to Xcode to access the debuggers step in/out/over/continue controls. Is there a way to do this without Xcode being the application with focus?

(I know about the mini debugger, but that doesn't have step controls on it, and I'd prefer keyboard shortcuts.)

I thought it might be scriptable, but it didn't seem like there was a hook for it in the Xcode AppleScript dictionary. (I'm definitely not an AppleScript expert by any means, though.)

I don't think GUI scripting would get me what I want since it would switch to Xcode step and switch back. But it might be better than nothing if it was fast enough.

Is there a way to send a keyboard command to an application that's doesn't have focus?

Any other ideas?

A: 

To see Xcode's scripting support, launch Script Editor, find the Open Dictionary command, and select Xcode.

TotalForge
I did mention in the original post that I checked the dictionary and couldn't find anything about stepping through the debugger, but thanks anyways.
zekel
A: 

As others mentioned use UI scripting. So to step through code in the debugger you'd use this in Applescript:

tell application "XCode"
    activate
    tell application "System Events" to keystroke "i" using {command down, shift down}
end tell

And this in Appscript:

app(u'Xcode').activate()
app(u'System Events').keystroke(u'i', using=[k.command_down, k.shift_down])
Clark