如何通过 Applescript 进入/退出/越过 Xcode 调试器?
我正在开发一个 iOS 应用程序。我在模拟器上花了很多时间,如果我不必切换回 Xcode 来访问调试器单步进入/退出/结束/继续控制,那将会非常有帮助。有没有办法在 Xcode 不成为焦点应用程序的情况下做到这一点?
(我知道迷你调试器,但它没有步骤控件,而且我更喜欢键盘快捷键。)
我认为它可能是可编写脚本的,但似乎在Xcode AppleScript 字典。 (无论如何,我绝对不是 AppleScript 专家。)
我认为 GUI 脚本不会得到我想要的东西,因为它会切换到 Xcode 步骤并切换回来。但如果速度足够快,可能总比没有好。
有没有办法将键盘命令发送到没有焦点的应用程序?
还有其他想法吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
要查看 Xcode 的脚本支持,请启动脚本编辑器,找到“打开词典”命令,然后选择 Xcode。
To see Xcode's scripting support, launch Script Editor, find the Open Dictionary command, and select Xcode.
正如其他人提到的,使用 UI 脚本。因此,要在调试器中单步执行代码,您可以在 Applescript 中使用此代码:
在 Appscript 中使用此代码:
As others mentioned use UI scripting. So to step through code in the debugger you'd use this in Applescript:
And this in Appscript:
如果不使用 UI 脚本,您似乎无法做到这一点,我试图避免这样做。 (不过,如果您想这样做,请参阅 Clark 的回答。) Xcode 3 和 Xcode 4.3.1 似乎就是这种情况。
It doesn't seem like you can do this without using UI scripting, which I try to avoid. (See Clark's answer if you want to do that, though.) This appears to be the case for Xcode 3 and Xcode 4.3.1.