Android Studio provides keyboard shortcuts for many common operations. Table 1 shows the default keyboard shortcuts by operating system.

Note: In addition to the default key mappings in Table 1 below, you can choose from a variety of preset key mappings or create custom key mappings. For more information on custom keyboard shortcuts, see Configuring Custom Key Mappings below.

Table 1.  Default keyboard shortcuts for Windows/Linux and Mac operating systems.

DescriptionWindows/LinuxMac
conventional
Save allControl + SCommand + S
SynchronizeControl + Alt + YCommand + Option + Y
Maximize/minimize editorControl + Shift + F12Control + Command + F12
Add to FavoritesAlt + Shift + FOption + Shift + F
Check the current file with the current configuration fileAlt + Shift + IOption + Shift + I
Fast switching modeControl + ` (backquote)Control + ` (backquote)
Open the settings dialogControl + Alt + SCommand + , (comma comma)
Open project structure dialogControl + Alt + Shift + SCommand + ; (English semicolon)
Switch between tabs and tool windowsControl + TabControl + Tab
Navigating and searching within Studio
Search all content (including code and menus)Press Shift twicePress Shift twice
FindControl + FCommand + F
Find the next oneF3Command + G
Find the previous oneShift + F3Command + Shift + G
replaceControl + RCommand + R
Find operationControl + Shift + ACommand + Shift + A
Search by symbol nameControl + Alt + Shift + NCommand + Option + O
Lookup classControl + NCommand + O
Find files (not classes)Control + Shift + NCommand + Shift + O
Find in the pathControl + Shift + FCommand + Shift + F
Open file structure popup menuControl + F12Command + F12
Navigate before the open editor tabAlt + right / left arrowControl + right / left arrow
Jump to source codeF4 / Control + EnterF4 / Command + Down Arrow
Open the current editor tab in a new windowShift + F4Shift + F4
Recently opened file popup menuControl + ECommand + E
Recently edited file popup menuControl + Shift + ECommand + Shift + E
Go to the previous edit locationControl + Shift + BackspaceCommand + Shift + Backspace
Close the event editor tabControl + F4Command + W
Return to the editor window from the tool windowEscEsc
Hide event or previous activity tool windowShift + EscShift + Esc
Go to the lineControl + GCommand + L
Open type hierarchyControl + HControl + H
Open method hierarchyControl + Shift + HCommand + Shift + H
Open the call hierarchyControl + Alt + HControl + Option + H
Write code
Generate code (getter, setter, constructor, hashCode/equals, toString, new file, new class)Alt + InsertCommand + N
Replacement methodControl + OControl + O
ImplementationControl + IControl + I
Control statement (if…else / try…catch / etc.)Control + Alt + TCommand + Option + T
Delete the line at the caretControl + YCommand + Backspace
Collapse/expand the current code blockControl + minus / plusCommand + minus / plus
Collapse/expand all code blocksControl + Shift + minus / plusCommand + Shift + minus / plus
Copy current line or selectControl + DCommand + D
Basic code is done automaticallyControl + space barControl + space bar
Smart code auto-completion (filtering methods and variable lists by expected type)Control + Shift + SpacebarControl + Shift + Spacebar
Completion statementControl + Shift + EnterCommand + Shift + Enter
Quick document searchControl + QControl + J
Display the parameters of the selected methodControl + PCommand + P
Go to the statement (direct)Control + B or Control + clickCommand + B or Command + click
Go to implementationControl + Alt + BCommand + Alt + B
Go to superclass method / super classControl + UCommand + U
Open quick definition lookupControl + Shift + ICommand + Y
Switch visibility of project tool windowsAlt + 1Command + 1
Switch bookmarksF11F3
Switch bookmarks with mnemonicsControl + F11Option + F3
Add comments/uncomment by line commentControl + /Command + /
Add comments/uncomment by block commentControl + Shift + /Command + Shift + /
Select consecutively increasing code blocksControl + WOption + Up
Return the current selection to the previous stateControl + Shift + WOption + Down
Move to the beginning of the code blockControl + [Option + Command + [
Move to the end of the code blockControl + ]Option + Command + ]
Select from the current position to the start of the code blockControl + Shift + [Option + Command + Shift + [
Select from the current position to the end of the code blockControl + Shift + ]Option + Command + Shift + ]
Remove from current position to end of wordControl + DeleteOption + Delete
Remove from current location to the beginning of the wordControl + BackspaceOption + backspace key
Optimize importControl + Alt + OControl + Option + O
Quick fix of project (showing intent operation and quick fix)Alt + EnterOption + Enter
Reformat the codeControl + Alt + LCommand + Option + L
Automatic shrinkingControl + Alt + IControl + Option + I
Indent/cancelTab/Shift + TabTab/Shift + Tab
Smart line mergeControl + Shift + JControl + Shift + J
Smart line splitControl + EnterCommand + Enter
Start a new lineShift + EnterShift + Enter
Next/previous highlighted errorF2 / Shift + F2F2 / Shift + F2
Build and run
ConstructControl + F9Command + F9
Build and runShift + F10Control + R
debugging
debuggingShift + F9Control + D
jump overF8F8
Step by stepF7F7
Smart step by stepShift + F7Shift + F7
Jump outShift + F8Shift + F8
Run to cursor positionAlt + F9Option + F9
Evaluation expressionAlt + F8Option + F8
Continue to run the programF9Command + Option + R
Switch breakpointControl + F8Command + F8
View breakpointsControl + Shift + F8Command + Shift + F8
Refactoring
copyF5F5
mobileF6F6
Safe deleteAlt + DeleteCommand + Delete
RenameShift + F6Shift + F6
Change signatureControl + F6Command + F6
InlineControl + Alt + NCommand + Option + N
method of extractionControl + Alt + MCommand + Option + M
Extract variableControl + Alt + VCommand + Option + V
Extract fieldControl + Alt + FCommand + Option + F
Extract constantControl + Alt + CCommand + Option + C
Extraction parameterControl + Alt + PCommand + Option + P
Version control / local history
Submit project to VCSControl + KCommand + K
Update project from VCSControl + TCommand + T
View recent changesAlt + Shift + COption + Shift + C
Open the VCS pop-up menuAlt + ` (backquote)Control + V

Configuring custom key mappings


You can choose from a variety of preset keymaps, or you can modify a preset keymap in Android Studio’s keymap settings to create a new custom keymap.

To open the key mapping settings, click  File > Settings > Keymap (on a Mac, click  File > Properties > Keymap ).

Figure 1.  Android Studio key mapping settings window.

  1. Keymap drop-down menu:  Select the desired keymap from this menu to toggle between preset keymaps.
  2. Action list:  Right click to modify it. You can add more keyboard shortcuts to your actions, add mouse shortcuts to associate an action with a mouse click, or remove the current shortcut. If you’re using a preset keymap, the shortcut to the edit action will automatically create a copy of the keymap and add your changes to the copy.
  3. Copy button:  Select a key map to use as a starting point from the drop-down menu and click  Copy  to create a new custom key map. You can modify the keymap name and shortcuts.
  4. Reset button:  Select a key map from the drop-down menu and click  Reset  to return it to its original configuration.
  5. Search box:  Type text here to search for keyboard shortcuts by action name.
  6. Search by shortcut :  Click  Find Actions by Shortcut  and type a shortcut to press the shortcut to search for the action.