---
# System prepended metadata

title: Xcode Keyboard Shortcut List
tags: [Xcode, Shortcut]

---

# Xcode Keyboard Shortcut List
Xcode(Version 10.0)常用快捷鍵列表
==***(太多不及備載～其他可用 "⌘+," 查詢)***==
>*(如果想要客製化 key binding 可以參考下面的連結)*
>*(可能會依據Xcode版本不同而有所差異)*

<br/>

 ## **Symbol**
 
| Symbol | Name          |
| ------ |:------------- |
| ⌘      | Command       |
| ⌃      | Control       |
| ⌥      | Option/Alt    |
| ⇧      | Shift         |
| ⏎      | Return/Enter  |
| ⇥      | Tab           |
| ⎋      | Escape        |
| ↘︎     | Xcode: fn + → |

<br/>

## **General**

| Key   | Command       | Note   |
| ----- | ------------- |:------ |
| ⌘+,   | Preferences   |        |
| ⌘+⇧+0 | Documentation | zero 0 |
| ⌘+?   | Quick help    |        |



<br/>

## **ToolBar**
![](https://i.imgur.com/CwNUCd1.png)


### **- Build & RUN**

| Key   | Command              | Note |
| ----- | -------------------- | ---- |
| ⌘+B   | Build                |      |
| ⌘+⇧+B | Analyze              |      |
| ⌘+⌃+B | Compile file         |      |
| ⌘+R   | Run                  |      |
| ⌘+⇧+K | Clean  build         |      |
| ⌘+⌃+R | Run without building |      |
| ⌘+.   | Stop                 |      |

<br/>

### **- Test**

| Key     | Command    | Note                           |
| ------- | ---------- |:------------------------------ |
| ⌃+⌥+⌘+G | Test Again | 重跑上次測試範圍, TDD時好用 |
| ⌃+⌥+⌘+U | Test       | 只跑目前游標測試項目        |


<br/>

### **- Schema Menu**

| Key          | Command            | Note   |
| ------------ | ------------------ |:------ |
| ⌃+0          | Choose Scheme      | zero 0 |
| ⌃+⌘+[ or ]   | Select Scheme      |        |
| ⌃+⌥+⌘+[ or ] | Select destination |        |

  
<br/>

### **- Editor & Workspace Configuration**

| Key        | Command                  | Note                                                                      |
| ---------- | ------------------------ |:------------------------------------------------------------------------- |
| ⌘+⇧+L      | Open snippets or objects | ![](https://i.imgur.com/iGK24VG.png) ![](https://i.imgur.com/Q3qGd6m.png) |
| ⌘+⏎        | Standard editor          | ![](https://i.imgur.com/kmLJHJ7.png)                                      |
| ⌘+⌥+⏎        | Assistant editor         | ![](https://i.imgur.com/3KZg5Ia.png)                                   |
| ⌘+⌥+⇧+⏎       | Version editor           | ![](https://i.imgur.com/JLqevVi.png)                                |
| ⌘+T        | Create tab               |                                                                           |
| ⌘+⇧+[ or ] | Switch tab           |                                                                           |

<br/>

## **Navigator Area**

| Key     | Command               | Note   |
| ------- | --------------------- |:------ |
| ⌘+0     | Toggle navigator area | zero 0 |
| ⌘+(1-9) | Switch navigators     |        |
| ⌘+⌥+J   | Filter in navigator   |        |

<br/>

### **- Find**
| Key     | Command                                | Note                 |
| ------- | -------------------------------------- |:-------------------- |
| ⌘+⇧+F   | Search in the whole project            |                      |
| ⌘+⌥+F   | Search & replace in the whole project |                      |
| ⌘+⌃+⇧+H | Find call hierarchy                    | 維護和追蹤Code時好用 |

<br/>

## **Inspector Area**

| Key     | Command               | Note   |
| ------- | --------------------- |:------ |
| ⌥+⌘+0   | Toggle inspector area | zero 0 |
| ⌥+(1-6) | Switch inspectors     |        |

<br/>

## **Debug Area**

| Key   | Command                | Note |
| ----- | ---------------------- |:---- |
| ⌘+⇧+Y | Toggle debug area      |      |
| ⌘+⇧+C | Activate console       |      |
| ⌘+K   | Clear console          |      |
| ⌘+⌥+K | Reload console         |      |
| ⌘+\   | Add breakpoint |      |
| ⌘+Y   | Deactivate breakpoints |      |
| ⌘+⌃+Y | Continue / Pause debug |      |
| F6    | Debug step over        |      |

<br/>

## **Editor Area**

<br/>

### **- File Navigation**

| Key                                 | Command                       | Note                           |
| ----------------------------------- | ----------------------------- |:------------------------------ |
| ⌃+⌘+← or →                          | Navigate - Go forward / back  |                                |
| ⌃+5                                 | Show group file               | 在Jump bars上顯示              |
| ⌃+6                                 | Show document item            | 在Jump bars上顯示，可輸入搜尋  |
| ⌘+⇧+O                               | Search/Open file quickly      | English's o, not zero number 0 |
| ⌘+⌥+, <br/>Or ⌘+⇧+O followed by ⌥+⏎ | Open file is Assistant Editor |                                |



<br/>

### **- Code(Navigate & Editor)**
| Key                     | Command                         | Note                                                    |
| ----------------------- | ------------------------------- |:------------------------------------------------------- |
| ⌃+⌥+⌘+F                 | Fix all issues                  |                                      |
| ⌘+L                     | Jump to line in file            |                                                         |
| ⌃+⌘+E                   | Edit all in scope / refactor    | renaming a variable or function                         |
| ⌥+⌘+E (⇧+⌥+⌘+E)       | Select next/previous occurrence    |                        |
| ⌘+J                     | Move focus to editor            | ![Move To Editor View](https://i.imgur.com/eFTmCDM.png) |
| ⌃+⌘+Click <br/>Or ⌃+⌘+J | Jump to definition              |                                    |
| ⌃+⌘+? <br/>Or ⌥+Click   | Documentation for selected text |                                                     |
| ⎋ <br/>Or ⌥+⎋           | Show completion list            | Or ⌃+space                                          |
| ⌃+space                 | Show completions                | Editor menu for source code                             |
| ⌥+⌘+[ or ]              | Move line up / down             |                                                         |
| ⌥+⌘+← or →              | Fold / Unfold                   | Xcode: Editor -> Code Folding                        |
| ⇧+⌥+⌘+← or →            | Fold / Unfold all               |                                                    |


<br/>

## **Swift UI**

| Key   | Command                   | Note                      |
| ----- | ------------------------- |:------------------------- |
| ⌘+⌥+P | Resume automatic previews | Swift UI Preview 繼續執行 |
| ⌘+⌥+⏎ | Toggle canvas             |                           |


<br/>
<br/>

## **Other**

| Key                    | Command                                       | Note                                      |
| ---------------------- | --------------------------------------------- |:----------------------------------------- |
| ⌥+⌘+← or →             | 將游標移到一個字的開頭或結尾                | +⇧則反灰選擇一個字                        |
| fn+delete <br/>⌃+D     | 在沒有往前刪除鍵的鍵盤上執行往前刪除          |                                           |
| ⌥+delete <br/>⌃+delete | Delete one word at time                       | 一次向左刪除一個單詞                      |
| ⌘+delete               | Delete one sentence at time                   | 一次向左刪除一行                          |
| ⌘+←                    | 跳到游標那行的開頭                            |                                           |
| ⌃+A                    | 跳到一整句的開頭                              |                                           |
| ⌃+\                    | Jump to next change                           | 移動游標至下一個編輯的位置<br/>可循環切換 |
| ⌃+I                    | Jump to previous change                       | 移動游標至上一個編輯的位置<br/>可循環切換 |
| ⌃+I                    | Select all and re-indent.(same with previous) | 自動縮排或排版                            |
| ⌃+⌘+Q                  | Lock Mac                                      | 鎖定螢幕                                  |
| ⌃+⌘+Space bar          | Emoji, character viewer                       | 打開字元顯示器                            |
| ⌘+⇧+3                  | take a screenshot                             | 螢幕全景截圖                              |
| ⌘+⇧+4                  | capture a portion of the screen               | 部分截圖                                  |
| ⌘+⇧+4+Space bar        | capture a window or menu                      | 視窗截圖                                  |
| ⌥+⌘+⎋                  | force an app to quit                          | 強制結束                                  |


<br/>
<br/>

##### Reference resources: 
- [XcodeKeyboardShortcuts.pdf](https://swifteducation.github.io/assets/pdfs/XcodeKeyboardShortcuts.pdf)
- [Xcode shortcuts and custom key bindings](https://diamantidis.github.io/2018/12/07/xcode-shortcuts-and-custom-key-bindings)
- [13 Xcode Shortcuts To Boost Your Productivity](https://www.iowncode.com/13-xcode-shortcuts-to-boost-your-productivity-329c90512309/)
- [Apple Screenshot](https://support.apple.com/en-us/HT201361)
- [Mac keyboard shortcuts](https://support.apple.com/zh-tw/HT201236)

<br/>

### Application App
* [CheatSheet](https://mediaatelier.com/CheatSheet/)

###### tags: `Xcode` `Shortcut`

{%hackmd theme-dark %}

