用于切换构建目标目的地的 Xcode 4 键盘快捷键

发布于 2024-11-19 17:56:58 字数 56 浏览 4 评论 0原文

Xcode 4 中是否有键盘快捷键可以切换构建目标目的地;也就是说,从模拟器切换到设备,反之亦然?

Is there a keyboard shortcut in Xcode 4 to switch the build target destination; that is, to switch from simulator to device and vice versa?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(9

小嗲 2024-11-26 17:56:59

有一个叫Destination>选择下一个目的地。进入 xcode 中的首选项,然后在键绑定选项卡中搜索它,它将显示它设置的键。

对我来说,是 cmd+alt+ctrl+][ 进行切换。非常有用,节省了几秒钟。

There is, is called Destination>select next destination. Go in the prefs in xcode and then in the key bindings tab, search for that, it will show what key it is set at.

For me, is cmd+alt+ctrl+] and [ to switch. Is quite useful, saves a few seconds.

岛徒 2024-11-26 17:56:59

在 Xcode 4.6 中,快捷方式为 ctrl+option+cmd+[ctrl+选项+cmd+]

In Xcode 4.6, the shortcut is ctrl+option+cmd+[ and ctrl+option+cmd+]

第几種人 2024-11-26 17:56:59

您可以使用 ctrl + cmd + [ctrl + cmd + ] 选择方案,或使用 ctrl + cmd + [alt] [ctrl + cmd + [alt] ] 选择产品
或者您可以在键绑定的首选项面板中搜索以获取更多信息

You can use ctrl + cmd + [ or ctrl + cmd + ] to select scheme, or use ctrl + cmd + [alt] [ or ctrl + cmd + [alt] ] to select product
Or you can just search in the preference panel of key bindings for more information

樱桃奶球 2024-11-26 17:56:59

您可以编写 applescript 并将其绑定到某些热键(例如使用 FastScripts - 释放最多十个绑定)。
下一个脚本将为您点击 Xcode 工具栏中的方案按钮:

tell application "System Events"
    tell process "Xcode"
        click ((pop up buttons of list 1 of group 2 of tool bar 1 of front window) whose description is "Active Run Destination")
    end tell
end tell

然后您只需使用向上/向下切换目标即可。
请注意,您需要在系统偏好设置 -> 下启用对辅助设备的访问。无障碍

You can write applescript and bind it to some hotkey (using FastScripts for example - free up to ten bindings).
Next script will click for you on your scheme button in the Xcode toolbar:

tell application "System Events"
    tell process "Xcode"
        click ((pop up buttons of list 1 of group 2 of tool bar 1 of front window) whose description is "Active Run Destination")
    end tell
end tell

then you can just use Up/Down to switch destination.
Note that you need to enable access for assistive devices under the SystemPreferences -> Accessibility

柠檬心 2024-11-26 17:56:59

您可以使用 cmd+< 进入编辑方案菜单,它实际上是 cmd+shift+.

你应该知道

  • 构建: cmd+B
  • 运行: cmd+R
  • 测试:cmd+U
  • 配置文件:cmd+
  • 分析:shift+cmd+B

但是没有一个命令在 iPhone 模拟器、iPad 模拟器和所有外部模拟器之间切换。

You can go to the edit scheme menu with cmd+< which is actually cmd+shift+.

You should know

  • Build: cmd+B
  • Run: cmd+R
  • Test: cmd+U
  • Profile: cmd+I
  • Analyze: shift+cmd+B

But there isn't a command just to switch between the iPhone simulator, iPad simulator, and all of your external.

云胡 2024-11-26 17:56:59

我有一个稍微不同的问题,但它也可能对你有帮助。
我只有一台物理设备,它始终位于顶部。
选择顶部列表设备作为目标非常简单。

执行:

  1. 弹出目标设备列表

    CTRL + SHIFT + 0

  2. 带您到第一个设备

    CMD + UPARROW

  3. 选择该设备

    空格

Apple 脚本如下:

tell application "Xcode" to activate


tell application "System Events"
 tell process "Xcode"
    keystroke "0" using {control down, shift down}
    delay 0.55
    keystroke (ASCII character 29)
    delay 0.55
    keystroke (ASCII character 30) using command down
    delay 0.55
    keystroke (ASCII character 32)
    delay 0.55
    keystroke "r" using command down
 end tell
end tell

I have a slightly different problem but it might help you as well.
I have only one physical device which always stays at the top.
Its super simple to select top list device as a target.

Do:

  1. pops up the list for target devices

    CTRL + SHIFT + 0

  2. takes you to the first device

    CMD + UPARROW

  3. selects that device

    SPACE

Apple Script goes:

tell application "Xcode" to activate


tell application "System Events"
 tell process "Xcode"
    keystroke "0" using {control down, shift down}
    delay 0.55
    keystroke (ASCII character 29)
    delay 0.55
    keystroke (ASCII character 30) using command down
    delay 0.55
    keystroke (ASCII character 32)
    delay 0.55
    keystroke "r" using command down
 end tell
end tell
赤濁 2024-11-26 17:56:59

重复一下 Comradsky,答案是:

Cmd+Shift+, 然后 Tab 然后 Up /向下

Riffing on off Comradsky, the answer is then:

Cmd+Shift+, then Tab then Up/Down

泪冰清 2024-11-26 17:56:59

您还可以按住 Option 键单击标题栏中的方案以直接打开该方案的设置(而普通单击会打开显示所有方案列表的上下文菜单)。

You can also option-click on the scheme in the title bar to directly open the settings for the scheme (whereas a normal click opens the context menu that displays a list of all the schemes).

欲拥i 2024-11-26 17:56:59

显示目的地

要显示目的地列表,请使用 ⤵︎

^ + Shift + 0

Show Destinations

To bring up the list of destinations use ⤵︎

^ + Shift + 0

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文