Android Studio Useful Shortcuts

IDE shortcuts can really make your development workflow fast and smooth. Android Studio comes perfectly in this aspect. Ideally, you should make it a habit to not pick up the mouse to perform most of your actions and slowly migrate towards a mouseless-workflow. Here are some of the most useful shortcuts for you to get started.

Shortcut Key For Android Studio

(Currently, only Mac shortcuts are available. Windows and Linux shortcuts coming soon.)

Must-Know Shortcuts:

Never-ever-ever forget these shortcuts.

DescriptionShortcut
Find everything (like files, classes, symbols, etc.)Shift + Shift
Show a list of automatic fixes and IDE suggestions at the cursorOption + Enter
Rename all copies of the variable/method/class at the cursorShift + F6
List all usages of the variable/method/class at the cursorCommand + Option + F7
Generate code (like getters, setters, constructors, method overrides)Command + N
Search for any action in Android StudioCommand + Shift + A
Find text occurencesin the current file (Enter = cycle through results, Esc. = cancel)Command + F
Show the list of recently used files in the IDECommand + E
Run the app or testControl + R

Frequently Used Shortcuts:

You will surely need these quite often.

DescriptionShortcut
Search for and open any file by nameCommand + Shift + O
Move a piece of code in upward/downward directionCommand + Shift + Up/Down
View javadoc of symbol at cursor in pop-upF1
View definition of method at cursor in pop-upCommand + Y
Search for and list any occurrences of textCommand + Shift + F
Comment/Uncomment all selected lines (also works in xml files)Command + /
Show available parameters for current method (must be inside parentheses)Command + P
Format code to match Android Studio’s default styleCommand + Option + L
Delete a complete line at one goCommand + Delete
Navigate through classes and methodsCommand + Left Click

Useful Shortcuts:

These can help you level up your development workflow.

DescriptionShortcut
Go to next highlighted error in current fileF2
Go to the declaration of the variable/method/class at cursorCommand + B
Go to given line number in current fileCommand + L
Duplicate current lineCommand + D
Search for and go to any symbol (incl. variables and methods)Command + Option + O
Show class structure in pop-upCommand + F12
List recently edited files in pop-upCommand + Shift + E
View full refactor menuControl + T
Collapse/expand all code blocksCommand + Shift + +/-
Collapse/expand individual code blockCommand + +/-
Insert new line below current cursor positionShift + Enter
Complete statement (add braces, parentheses, semi-colon)Command + Shift + Enter

View And Add Shortcuts in Android Studio

By going to Settings >> Keymap A window will popup showing All the Editor Actions with the their name and shortcuts. Some of the Editor Actions do not have shortcuts. So right click on that and add a new shortcut to that.

You May Also Like

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.