【发布时间】:2013-08-14 15:07:54
【问题描述】:
我想从命令行启动一个应用程序并立即将 XCode 4 中的图形调试器附加到它,而无需单击 Xcode 菜单 Product->Attach To Progress。是否可以使用 bash 或 Apple 脚本编写脚本?
【问题讨论】:
标签: xcode shell debugging process applescript
我想从命令行启动一个应用程序并立即将 XCode 4 中的图形调试器附加到它,而无需单击 Xcode 菜单 Product->Attach To Progress。是否可以使用 bash 或 Apple 脚本编写脚本?
【问题讨论】:
标签: xcode shell debugging process applescript
这似乎适用于 Xcode-Beta 版本 6.2 (6C121)。对于 Xcode,只需将“Xcode-Beta”更改为 Xcode。此外,您需要将流程名称“Staging”更改为您要附加的流程。
tell application "Xcode-Beta"
activate
end tell
tell application "System Events"
tell application process "Xcode"
click (menu item "By Process Identifier (PID) or Name…" of menu 1 of menu item "Attach to Process" of menu 1 of menu bar item "Debug" of menu bar 1)
end tell
tell application process "Xcode"
set value of text field 1 of sheet 1 of window 1 to "Staging"
end tell
tell application process "Xcode"
click button "Attach" of sheet 1 of window 1
end tell
end tell
【讨论】:
为 Xcode 12 工作
tell application "Xcode"
activate
end tell
tell application "System Events"
tell application process "Xcode"
click (menu item "Attach to Process by PID or Name…" of menu 1 of menu bar item "Debug" of menu bar 1)
end tell
tell application process "Xcode"
set value of text field 1 of sheet 1 of window 1 to "Your App/Process Name"
end tell
tell application process "Xcode"
click button "Attach" of sheet 1 of window 1
end tell
end tell
tell application "our App/Process Name"
activate
end tell
【讨论】: