Keyboard Shortcuts for Android Studio

Android Studio includes keyboard shortcuts for different actions. Here is some default keyboard shortcuts of Android Studio for Windows/Linux and Mac operating systems.

  1. Find: ctrl + F in Windows/Linux and cmd + F in Mac
  2. Replace: ctrl + R in Windows/Linux and cmd + R in Mac
  3. Find class: ctrl + N in Windows/Linux and cmd + O in Mac
  4. Find file: ctrl + shift+ N in Windows/Linux and cmd + shift+ N in Mac
  5. Zoom in/out: ctrl + plus/minus in Windows/Linux and cmd + plus/minus in Mac
  6. Fit to screen: ctrl + 0 in Windows/Linux and cmd + 0 in Mac
  7. Go to xml: ctrl + B in Windows/Linux and cmd + B in Mac
  8. Toggle device: D in Windows/Linux and D in Mac
  9. Override methods: ctrl + O in Windows/Linux and cmd + O in Mac
  10. Implement methods: ctrl + I in Windows/Linux and cmd + I in Mac
  11. Generate code: alt + ins in Windows/Linux and cmd + N in Mac
  12. Start new line: shift + enter in Windows/Linux and shift + enter in Mac
  13. Debug: shift + F9 in Windows/Linux and ctrl + D in Mac
  14. Copy: F5 in Windows/Linux and F5 in Mac
  15. Commit project in VCS: ctrl + K in Windows/Linux and cmd + K in Mac


General

Description Windows/Linux Mac
Save allControl + SCommand + S
SynchronizeControl + Alt + YCommand + Option + Y
Maximize/minimize editorControl + Shift + F12Control + Command + F12
Add to favoritesAlt + Shift + FOption + Shift + F
Inspect current file with current profileAlt + Shift + IOption + Shift + I
Quick switch schemeControl + ` (backquote)Control + ` (backquote)
Open settings dialogueControl + Alt + SCommand + , (comma)
Open project structure dialogControl + Alt + Shift + SCommand + ; (semicolon)
Switch between tabs and tool windowControl + TabControl + Tab


Navigating and searching within Studio

Description Windows/Linux Mac
Search everything (including code and menus)Press Shift twicePress Shift twice
FindControl + FCommand + F
Find nextF3Command + G
Find previousShift + F3Command + Shift + G
ReplaceControl + RCommand + R
Find actionControl + Shift + ACommand + Shift + A
Search by symbol nameControl + Alt + Shift + NCommand + Option + O
Find classControl + NCommand + O
Find file (instead of class)Control + Shift + NCommand + Shift + O
Find in pathControl + Shift + FCommand + Shift + F
Open file structure pop-upControl + F12Command + F12
Navigate between open editor tabsAlt + Right/Left ArrowControl + Right/Left Arrow
Jump to sourceF4 / Control + EnterF4 / Command + Down Arrow
Open current editor tab in new windowShift + F4Shift + F4
Recently opened files pop-upControl + ECommand + E
Recently edited files pop-upControl + Shift + ECommand + Shift + E
Go to last edit locationControl + Shift + BackspaceCommand + Shift + Backspace
Close active editor tabControl + F4Command + W
Return to editor window from a tool windowEscEsc
Hide active or last active tool windowShift + EscShift + Esc
Go to lineControl + GCommand + L
Open type hierarchyControl + HControl + H
Open method hierarchyControl + Shift + HCommand + Shift + H
Open call hierarchyControl + Alt + HControl + Option + H


Viewing layouts

Description Windows/Linux Mac
Zoom in/outControl + plus/minusCommand + plus/minus
Fit to screenControl + 0Command + 0
Actual sizeControl + Shift + 1Command + Shift + 1


Design tools: Layout Editor

Description Windows/Linux Mac
Toggle between Design and Blueprint modesBB
Toggle between Portrait and Landscape modesOO
Toggle devicesDD
Force refreshRR
Toggle render errors panelEE
Delete constraintsDelete or Ctrl + ClickDelete or Command + Click
Zoom inCtrl + plusCommand + plus
Zoom outCtrl + minusCommand + minus
Zoom to fitCtrl + 0Command + 0
PanHold Space + Click and dragHold Space + Click and drag
Go to XMLCtrl + BCommand + B
Select all componentsCtrl + ACommand + A
Select multiple componentsShift + Click or Ctrl + ClickShift + Click or Command + Click


Design tools: Navigation Editor

Description Windows/Linux Mac
Zoom inCtrl + plusCommand + plus
Zoom outCtrl + minusCommand + minus
Zoom to fitCtrl + 0Command + 0
PanHold Space + Click and dragHold Space + Click and drag
Go to XMLCtrl + BCommand + B
Toggle render errors panelEE
Group into nested graphCtrl + GCommand + G
Cycle through destinationsTab / Shift + TabTab / Shift + Tab
Select all destinationsCtrl + ACommand + A
Select multiple destinationsShift + Click or Ctrl + ClickShift + Click or Command + Click


Writing code

Description Windows/Linux Mac
Generate code (getters, setters, constructors, hashCode/equals, toString, new file, new class)Alt + InsertCommand + N
Override methodsControl + OControl + O
Implement methodsControl + IControl + I
Surround with (if…else / try…catch / etc.)Control + Alt + TCommand + Option + T
Delete line at caretControl + YCommand + Backspace
Collapse/expand current code blockControl + minus/plusCommand + minus/plus
Collapse/expand all code blocksControl + Shift + minus/plusCommand + Shift + minus/plus
Duplicate current line or selectionControl + DCommand + D
Basic code completionControl + SpaceControl + Space
Smart code completion (filters the list of methods and variables by expected type)Control + Shift + SpaceControl + Shift + Space
Complete statementControl + Shift + EnterCommand + Shift + Enter
Quick documentation lookupControl + QControl + J
Show parameters for selected methodControl + PCommand + P
Go to declaration (directly)Control + B or Control + ClickCommand + B or Command + Click
Go to implementationsControl + Alt + BCommand + Alt + B
Go to super-method/super-classControl + UCommand + U
Open quick definition lookupControl + Shift + ICommand + Y
Toggle project tool window visibilityAlt + 1Command + 1
Toggle bookmarkF11F3
Toggle bookmark with mnemonicControl + F11Option + F3
Comment/uncomment with line commentControl + /Command + /
Comment/uncomment with block commentControl + Shift + /Command + Shift + /
Select successively increasing code blocksControl + WOption + Up
Decrease current selection to previous stateControl + Shift + WOption + Down
Move to code block startControl + [Option + Command + [
Move to code block endControl + ]Option + Command + ]
Select to the code block startControl + Shift + [Option + Command + Shift + [
Select to the code block endControl + Shift + ]Option + Command + Shift + ]
Delete to end of wordControl + DeleteOption + Delete
Delete to start of wordControl + BackspaceOption + Backspace
Optimize importsControl + Alt + OControl + Option + O
Project quick fix (show intention actions and quick fixes)Alt + EnterOption + Enter
Reformat codeControl + Alt + LCommand + Option + L
Auto-indent linesControl + Alt + IControl + Option + I
Indent/unindent linesTab/Shift + TabTab/Shift + Tab
Smart line joinControl + Shift + JControl + Shift + J
Smart line splitControl + EnterCommand + Enter
Start new lineShift + EnterShift + Enter
Next/previous highlighted errorF2 / Shift + F2F2 / Shift + F2


Build and run

Description Windows/Linux Mac
BuildControl + F9Command + F9
Build and runShift + F10Control + R
Apply Changes and Restart ActivityControl + F10Control + Command + R
Apply Code ChangesControl + Alt + F10Control + Shift + Command + R


Debugging

Description Windows/Linux Mac
DebugShift + F9Control + D
Step overF8F8
Step intoF7F7
Smart step intoShift + F7Shift + F7
Step outShift + F8Shift + F8
Run to cursorAlt + F9Option + F9
Evaluate expressionAlt + F8Option + F8
Resume programF9Command + Option + R
Toggle breakpointControl + F8Command + F8
View breakpointsControl + Shift + F8Command + Shift + F8


Refactoring

Description Windows/Linux Mac
CopyF5F5
MoveF6F6
Safe deleteAlt + DeleteCommand + Delete
RenameShift + F6Shift + F6
Change signatureControl + F6Command + F6
InlineControl + Alt + NCommand + Option + N
Extract methodControl + Alt + MCommand + Option + M
Extract variableControl + Alt + VCommand + Option + V
Extract fieldControl + Alt + FCommand + Option + F
Extract constantControl + Alt + CCommand + Option + C
Extract parameterControl + Alt + PCommand + Option + P


Version control / local history

Description Windows/Linux Mac
Commit project to VCSControl + KCommand + K
Update project from VCSControl + TCommand + T
View recent changesAlt + Shift + COption + Shift + C
Open VCS popupAlt + ` (backquote)Control + V


Source: https://developer.android.com/studio/intro/keyboard-shortcuts

Leave a Reply

Your email address will not be published. Required fields are marked *