Introduction
Android Studio is the official integrated development environment (IDE) for Android app development. Mastering its keyboard shortcuts can dramatically improve your productivity by reducing the time spent on repetitive tasks and navigation. This comprehensive cheat sheet compiles the most useful shortcuts to help both beginners and experienced developers work more efficiently.
General Shortcuts
Action | Windows/Linux | macOS |
---|---|---|
Save all files | Ctrl+S | ⌘S |
Settings/Preferences | Ctrl+Alt+S | ⌘, |
Project structure | Ctrl+Alt+Shift+S | ⌘; |
Build project | Ctrl+F9 | ⌘F9 |
Run app | Shift+F10 | ^R |
Debug app | Shift+F9 | ^D |
Stop app | Ctrl+F2 | ⌘F2 |
Recent files | Ctrl+E | ⌘E |
Quick documentation | Ctrl+Q | F1 or ⌃J |
Find action | Ctrl+Shift+A | ⌘⇧A |
Code Navigation
Action | Windows/Linux | macOS |
---|---|---|
Go to class | Ctrl+N | ⌘O |
Go to file | Ctrl+Shift+N | ⌘⇧O |
Go to symbol | Ctrl+Alt+Shift+N | ⌘⌥O |
Go to line | Ctrl+G | ⌘L |
Navigate back/forward | Ctrl+Alt+Left/Right | ⌘⌥←/→ |
Next/previous method | Alt+Up/Down | ⌃Up/Down |
Jump to source | F4 or Ctrl+Enter | F4 or ⌘↓ |
Find usages | Alt+F7 | ⌥F7 |
Navigate to declaration | Ctrl+B | ⌘B |
Show implementation | Ctrl+Alt+B | ⌘⌥B |
Code Editing
Action | Windows/Linux | macOS |
---|---|---|
Basic code completion | Ctrl+Space | ^Space |
Smart code completion | Ctrl+Shift+Space | ⌃⇧Space |
Complete statement | Ctrl+Shift+Enter | ⌘⇧Enter |
Parameter info | Ctrl+P | ⌘P |
Quick fix / Show intention actions | Alt+Enter | ⌥Enter |
Reformat code | Ctrl+Alt+L | ⌘⌥L |
Auto-indent lines | Ctrl+Alt+I | ⌃⌥I |
Duplicate line/selection | Ctrl+D | ⌘D |
Delete line | Ctrl+Y | ⌘⌫ |
Comment/uncomment line | Ctrl+/ | ⌘/ |
Comment/uncomment block | Ctrl+Shift+/ | ⌘⌥/ |
Select increasingly larger code blocks | Ctrl+W | ⌥↑ |
Shrink selection | Ctrl+Shift+W | ⌥↓ |
Refactoring
Action | Windows/Linux | macOS |
---|---|---|
Rename | Shift+F6 | ⇧F6 |
Extract method | Ctrl+Alt+M | ⌘⌥M |
Extract variable | Ctrl+Alt+V | ⌘⌥V |
Extract field | Ctrl+Alt+F | ⌘⌥F |
Extract constant | Ctrl+Alt+C | ⌘⌥C |
Extract parameter | Ctrl+Alt+P | ⌘⌥P |
Inline | Ctrl+Alt+N | ⌘⌥N |
Refactor this | Ctrl+Alt+Shift+T | ^T |
Debugging
Action | Windows/Linux | macOS |
---|---|---|
Toggle breakpoint | Ctrl+F8 | ⌘F8 |
View breakpoints | Ctrl+Shift+F8 | ⌘⇧F8 |
Step over | F8 | F8 |
Step into | F7 | F7 |
Smart step into | Shift+F7 | ⇧F7 |
Step out | Shift+F8 | ⇧F8 |
Resume program | F9 | ⌘⌥R |
Evaluate expression | Alt+F8 | ⌥F8 |
Run to cursor | Alt+F9 | ⌥F9 |
Version Control
Action | Windows/Linux | macOS |
---|---|---|
Commit changes | Ctrl+K | ⌘K |
Update project | Ctrl+T | ⌘T |
Push commits | Ctrl+Shift+K | ⌘⇧K |
Show VCS operations | Alt+` (backtick) | ^V |
Show diff | Ctrl+D | ⌘D |
VCS quick popup | Alt+BackQuote | ^V |
Revert | Alt+Shift+Z | ⌘⌥Z |
Layout and Views
Action | Windows/Linux | macOS |
---|---|---|
Toggle Project view | Alt+1 | ⌘1 |
Toggle Logcat | Alt+6 | ⌘6 |
Toggle Terminal | Alt+F12 | ⌥F12 |
Toggle Favorites | Alt+2 | ⌘2 |
Hide all tool windows | Ctrl+Shift+F12 | ⌘⇧F12 |
Maximize/restore editor | Ctrl+Shift+F12 | ⌘⇧F12 |
Split vertically/horizontally | Ctrl+(or Shift+)\ | ⌘(or ⌥+)\ |
Next/previous tab | Alt+Right/Left | ^→/← |
Close active tab | Ctrl+F4 | ⌘W |
Layout Editor Shortcuts
Action | Windows/Linux | macOS |
---|---|---|
Toggle between Design/Text views | Ctrl+Shift+G | ⌃⌘G |
Toggle component tree | Alt+Shift+G | ⌃⌘] |
Zoom in | Ctrl+Plus | ⌘+ |
Zoom out | Ctrl+Minus | ⌘- |
Fit to screen | Ctrl+0 | ⌘0 |
Toggle device orientation | Ctrl+Alt+R | ⌘⌥R |
Select parent | Ctrl+Up | ⌘↑ |
Select next component | Tab | Tab |
Select previous component | Shift+Tab | ⇧Tab |
Emulator Shortcuts
Action | Windows/Linux/macOS |
---|---|
Home button | Home |
Back button | Escape |
Menu button | F2 or Page Up |
Recent apps | F1 or Page Down |
Volume up/down | F3/F4 |
Rotate screen | Ctrl+F11 or Ctrl+F12 |
Power button | F7 |
Take screenshot | Ctrl+S |
Enter text | Tab to select field, then type |
Common Challenges and Solutions
Challenge: Slow Emulator Performance
- Solution:
- Use hardware acceleration (HAXM or KVM)
- Reduce emulator RAM allocation
- Use physical device instead of emulator
- Try a lighter emulator like Genymotion
Challenge: IDE Freezing or High CPU Usage
- Solution:
- Increase memory allocation in
studio.vmoptions
- Disable unused plugins
- Clean and rebuild project
- Invalidate caches (File > Invalidate Caches / Restart)
- Increase memory allocation in
Challenge: Missing Shortcuts
- Solution:
- Check for keyboard conflicts with OS or other applications
- Restore default keymap (Settings > Keymap > Restore Defaults)
- Create custom keymaps for frequently used actions
Challenge: XML Layout Editing Frustrations
- Solution:
- Toggle between Design and Code views (Ctrl+Shift+G)
- Use “Preview All Screen Sizes” feature
- Learn ConstraintLayout specific shortcuts
- Use Component Tree for complex hierarchies
Best Practices and Tips
Customize Your Shortcuts: Create custom shortcuts for your most frequently used actions in Settings > Keymap.
Learn Incrementally: Focus on learning 3-5 new shortcuts per week rather than trying to memorize them all at once.
Use the Search Everywhere Feature (Double-tap Shift): This powerful search helps you find anything within your project or the IDE.
Create Live Templates: For frequently typed code patterns (Settings > Editor > Live Templates).
Utilize Multiple Clipboards: Use Ctrl+Shift+V (⌘⇧V) to access clipboard history.
Leverage Code Generation: Use Alt+Insert (⌘N) to generate constructors, getters/setters, overrides, etc.
Use Multi-Cursor Editing: Press Alt+Shift+Click (⌥⇧Click) to add multiple cursors for simultaneous editing.
Pair Shortcuts with Code Templates: Combine custom file templates with navigation shortcuts for rapid development.
Use the Quick Documentation Feature: Ctrl+Q (F1) to see documentation without leaving your code.
Learn to Navigate by Structure: Use Ctrl+F12 (⌘F12) to quickly jump to different methods in a file.
Resources for Further Learning
- Official Android Studio Keyboard Shortcuts Documentation
- Android Studio Tips and Tricks
- Key Promoter X Plugin – Helps learn shortcuts by showing notifications
- Official IntelliJ IDEA Shortcuts Cheat Sheet (most shortcuts apply to Android Studio)
- Android Studio Shortcuts Keymap Poster
- Udacity’s Android Development for Beginners – Contains sections on Android Studio tips
By incorporating these shortcuts into your daily workflow, you’ll significantly boost your development speed and efficiency with Android Studio. Remember that mastering shortcuts is a gradual process—start with the ones that align with your most frequent tasks and gradually expand your repertoire.