use*_*950 5 debugging shell xcode applescript process
我想从命令行启动一个应用程序,并立即将 XCode 4 中的图形调试器附加到它,而无需单击 Xcode 菜单“产品”->“附加到进度”。是否可以使用 bash 或 Apple 脚本编写此脚本?
这似乎适用于 Xcode-Beta 版本 6.2 (6C121)。对于 Xcode,只需将“Xcode-Beta”更改为 Xcode。此外,您还需要将进程名称“Staging”更改为您想要附加的进程。
\n\ntell application "Xcode-Beta"\nactivate\nend tell\n\ntell application "System Events"\n    tell application process "Xcode"\n        click (menu item "By Process Identifier (PID) or Name\xe2\x80\xa6" of menu 1 of menu item "Attach to Process" of menu 1 of menu bar item "Debug" of menu bar 1)\n    end tell\n    tell application process "Xcode"\n        set value of text field 1 of sheet 1 of window 1 to "Staging"\n    end tell\n    tell application process "Xcode"\n        click button "Attach" of sheet 1 of window 1\n    end tell\nend tell\n