26

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?

0

9 Answers 9

32

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.

15

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

14

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

6

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

4

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.

1
  • Edit scheme menu is cmd + shift + <
    – pronebird
    Oct 3, 2015 at 8:28
4

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
2

Riffing on off Comradsky, the answer is then:

Cmd+Shift+, then Tab then Up/Down

0

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).

0

Show Destinations

To bring up the list of destinations use ⤵︎

^ + Shift + 0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.