Android Studio Cheatsheet - Android IDE Shortcut Reference
Android work is build-loop heavy, and Android Studio’s shortcuts condense that loop. This reference covers Kotlin/Java generation and navigation, the layout editor, Gradle sync, emulator controls, run/debug, and Logcat/Profiler access. The high-yield ones are navigation to implementation, quick build/run, and jumping from an AndroidX call to source. For anyone iterating on screens and APIs all day. After reading you keep the build-test-debug cycle moving mostly with the keyboard.
Typical Use Case
For engineers doing Android work day to day. Android Studio sits on the IntelliJ platform, so its shortcut system overlaps heavily with WebStorm and PhpStorm and one set of habits transfers. The groups most worth learning together are code generation and refactoring (generate, extract method, extract variable, extract constant); navigation, including go to declaration, superclass, implementation and the type hierarchy; Gradle build and sync, which means every change to build.gradle needs a sync and the command palette is the universal entry point; debugging with the step trio and run to cursor; and the emulator keys, Logcat and the Profiler.
Kotlin/Java Development 10
Cmd + NCmd + Option + TCmd + Option + MCmd + Option + VCmd + Option + CCmd + PCmd + BCmd + UCmd + Option + BCmd + Option + HLayout Editor 10
Cmd + Option + →Cmd + Option + ←Cmd + Shift + ACmd + Option + ICmd + Option + LCmd + Option + Shift + ICmd + Option + CCmd + Option + VCmd + Option + XCmd + Option + ZGradle Build 7
Cmd + Shift + ACmd + F9Cmd + F5Cmd + Option + Shift + SCmd + Option + GCmd + Shift + F9Cmd + Shift + F10Emulator & Device 8
Cmd + Shift + ACmd + Option + ←Cmd + Option + →Cmd + Option + ↑Cmd + Option + ↓Cmd + Option + MCmd + Option + BCmd + Option + PDebug & Run 11
Ctrl + RCtrl + DCmd + F2F8F7Shift + F8Alt + F9Cmd + F8Cmd + Shift + F8Cmd + Option + RCmd + Option + ELogcat & Performance 6
Cmd + 6Cmd + Option + LCmd + Shift + ACmd + 7Cmd + Option + PCmd + Option + RParameter matrix
| Parameter | Effect | Example |
|---|---|---|
Cmd + N | Generate code (constructor, getter/setter, equals/hashCode) | With the cursor inside the class body, press Cmd + N |
Cmd + Option + T | Surround the selection with code (if/for/try/catch) | Select a statement then press Cmd + Option + T |
Cmd + Option + M | Extract method | Select a piece of logic then press Cmd + Option + M |
Cmd + Option + V | Extract variable | Select an expression then press Cmd + Option + V |
Cmd + Option + C | Extract constant | Select a literal then press Cmd + Option + C |
Cmd + P | View parameter info | Cmd + P |
Cmd + B | Go to declaration | Place the cursor on a symbol and press Cmd + B |
Cmd + U | Go to superclass/interface | Cmd + U |
Cmd + Option + B | Go to implementation class | Cmd + Option + B |
Cmd + Option + H | View type hierarchy | Cmd + Option + H |
Cmd + Shift + A | Find Action catch-all palette (Gradle tasks, AVD, Logcat filters) | Cmd + Shift + A |
Cmd + Option + Shift + S | Sync Gradle files | Cmd + Option + Shift + S |
Cmd + F9 / Cmd + F5 | Build project / refresh Gradle dependencies | Cmd + F9 |
Cmd + Option + L / + I | Format XML / auto-indent XML | Cmd + Option + L |
Cmd + Option + → / ← | Switch to the next/previous tab (Design/Text) | Cmd + Option + → |
Ctrl + R / Ctrl + D | Run current configuration / debug current configuration | Ctrl + D |
F7 / F8 / Shift + F8 | Step into / step over / step out | F7 |
Alt + F9 | Run to the cursor line | Alt + F9 |
Cmd + F8 | Toggle breakpoint | Cmd + F8 |
Cmd + Option + E | Evaluate expression while debugging | Cmd + Option + E |
Cmd + 6 / Cmd + 7 | Open the Logcat panel / open the Profiler panel | Cmd + 6 |
Common pitfalls
SymptomYou changed a dependency in build.gradle but the IDE still compiles against the old version.
CauseGradle sync did not run, so the IDE's project model is still the old one.
FixRun Gradle sync (Cmd + Option + Shift + S), or refresh dependencies with Cmd + F5.
SymptomRotation, volume, and back-key actions on the emulator do nothing at all.
CauseThe emulator window does not have focus, or you pressed editor shortcuts instead of emulator keys.
FixFirst switch focus to the emulator window; on Mac use Cmd + Option + arrow keys, on Windows use Ctrl + Alt + arrow keys.
SymptomLogcat scrolls endlessly and you cannot see the few lines you want.
CauseNo filtering by tag or package name, so the output far exceeds reading speed.
FixOpen the Logcat panel (Cmd + 6) and filter tags with conditions; when needed clear the panel (Cmd + Option + L) and reproduce once more.
SymptomWhile debugging the program runs away and you cannot tell which layer the problem is in.
CauseOnly step over was used, without breakpoints and the breakpoints view to help locate.
FixUse Cmd + F8 to set breakpoints on key lines, Cmd + Shift + F8 to view all breakpoints, Alt + F9 to run to cursor, and Cmd + Option + E to evaluate on the spot.
SymptomThe layout preview looks fine but on a device it is misaligned or flickers.
CauseThe layout XML lacks formatting/indentation standards and the nesting is messy, so rendering takes a different measurement path.
FixIn the layout editor run Cmd + Option + L to format and Cmd + Option + I to auto-indent, then switch between the Design/Text tabs to check the structure.
SymptomA Gradle task or tool cannot be found, and it is nowhere in the menus.
CauseHunting through menus level by level is very inefficient; many actions exist only in the command palette.
FixAlways open the Find Action palette with Cmd + Shift + A and type keywords such as Gradle, AVD, or Logcat.
Troubleshooting
1Locate any action with the command palette
Press Cmd + Shift + A then type the action nameGradle tasks, AVD management, and Logcat filters are all searchable; search first to confirm a feature exists.
2Sync Gradle files
Press Cmd + Option + Shift + SMust be run after changing build.gradle; it only takes effect once the build progress bar at the bottom finishes.
3Clean and rebuild the project cache
Press Cmd + Shift + A then search "Invalidate Caches / Restart"The standard action when the index is corrupt or dependency resolution is abnormal; it rebuilds the index after restart.
4View runtime logs
Press Cmd + 6 to open the Logcat panelFilter by tag with conditions; after reproducing the issue look back at the latest output immediately.
5Locate performance bottlenecks
Press Cmd + 7 to open the Profiler panelCheck CPU, memory, and network usage; jank or memory growth issues should be captured at this stage.
Command Examples
Extract refactorings: variable, method, constant
Cmd + Option + V // extract variable
Cmd + Option + M // extract method
Cmd + Option + C // extract constantAndroid Studio remaps the IntelliJ extract refactorings onto Mac-style Option chords. Extract Variable turns a magic value into a named local, Extract Constant hoists a repeated literal into the companion object, and Extract Method splits an oversized function.
Sync Gradle vs. refresh dependencies
Cmd + F5 // refresh Gradle dependencies
Cmd + Option + Shift + S // sync Gradle files (equivalent to File > Sync Project with Gradle Files)Cmd + F5 only re-resolves artifacts already in the dependency cache, which refreshes the Gradle dependency view. A full Gradle sync is what realigns the IDE model with the scripts. After touching build.gradle, settings.gradle, or a version catalog (libs.versions.toml), sync first — otherwise the IDE keeps showing the previous model.
Run to cursor instead of littering breakpoints
Ctrl + D // debug current configuration
Alt + F9 // run to cursor
F7 // step into
F8 // step over
Shift + F8 // step outInstead of setting a chain of breakpoints deep in the call stack, Alt + F9 runs straight to the cursor line and stops there. Use F7 / F8 / Shift + F8 to confirm the remaining questions one step at a time — far faster than waiting for each breakpoint to hit.
Toggle a breakpoint before launching the debugger
Cmd + F8 // toggle breakpoint
Cmd + Shift + F8 // view all breakpoints
Ctrl + R // run current configurationCmd + Shift + F8 opens the breakpoints panel where you can inspect each breakpoint's condition, suspend policy, and binding. It is also the only way to diagnose "I set a breakpoint and it never fires" — a disabled breakpoint is otherwise invisible next to the line number.
Logcat panel plus command-palette filtering
Cmd + 6 // open Logcat
Cmd + Option + L // clear Logcat
Cmd + Shift + A // search Logcat filter (type logcat in action)Once the panel fills with history, clear it before reproducing so stale output from the previous run does not drown the signal. Do not type filter expressions by hand — search for logcat actions in the Find Action dialog and pick a built-in by package or tag, which avoids debugging a bad regex.
Formatting versus re-indenting XML
Cmd + Option + I // auto-indent XML (whitespace only)
Cmd + Option + L // format XML (reorders the whole file)Use Cmd + Option + I when you only need whitespace fixes — the diff stays clean. Reach for Cmd + Option + L only when you want attributes, quotes, and line breaks rewritten; it reformats the entire file and can produce a huge meaningless diff on a large layout.
Common Pitfalls
- Cmd + Option + M means two different things: Extract Method in the editor, but the emulator menu key once the emulator has focus. A stray press pops the emulator menu mid-debugging.
- Without a Gradle sync after editing build.gradle, settings.gradle, or a version catalog, the IDE model disagrees with the scripts and errors point at unrelated files.
- Cmd + Option + L on a layout file reformats the whole XML and can bury your functional diff; check the change scope in Version Control before committing.
- Cmd + F8 is a single-key toggle. Hammering it down a keyboard-dense code line leaves stray breakpoints that silently stop the next debugging session somewhere unrelated.
- When the same app runs on emulator and device at once, Logcat output interleaves — filter by package first or you cannot tell which device the crash came from.
- Searching actions with Cmd + Shift + A relies on the index; right after a cold start, Gradle tasks may be missing. Sync once before searching.
Tips
- Android Studio is built on the IntelliJ platform; most shortcuts match WebStorm and PhpStorm.
- Cmd+Shift+A is the Command Palette; search any action, including Gradle tasks and AVD management.
- Cmd+Option+Shift+S syncs Gradle files; run it after editing build.gradle.
- Emulator shortcuts are Cmd+Option+Arrow on Mac, Ctrl+Alt+Arrow on Windows.
- The Logcat panel (Cmd+6) shows app logs; filter by tag to narrow down.
- The Profiler panel (Cmd+7) shows CPU, memory, and network performance - essential for optimization.
FAQ
My build.gradle change seems to have no effect — what do I run next?
Trigger a Gradle sync with Cmd + Option + Shift + S, which re-resolves the Gradle files and pulls in the new dependencies. Use Cmd + F9 to rebuild after code changes and Cmd + F5 when the dependency cache itself looks suspect. If you cannot remember a task name, press Cmd + Shift + A to open the command palette and search for it, or open the dedicated panel with Cmd + Option + G. If the sync still fails, read the Gradle panel message: it distinguishes a parsing error from a repository access failure.
What makes the command palette so useful, and when should I reach for it?
Cmd + Shift + A opens the command palette: type a keyword and every IDE action becomes searchable, which makes it the right move whenever you cannot recall a shortcut. The cheatsheet lists it for finding Gradle tasks, opening the AVD Manager for emulator devices, filtering Logcat, and locating layout tools across the Design and Text editor tabs. Related navigation keys: Cmd + Option + H for the type hierarchy, Cmd + Option + B to jump to an implementation, and Cmd + B to jump to a declaration.
When should I press F7 versus F8 versus Shift+F8 while debugging?
F7 is step into: it descends into the method invoked on the current line. F8 is step over: the line runs to completion without entering the callees, which is what you want when crossing loops or assignments. Shift + F8 is step out: from inside a method it returns you to the caller, and it pairs naturally with F7 when you have gone too deep. To stop at the caret line instead, use Alt + F9. Toggle a breakpoint with Cmd + F8, review all of them with Cmd + Shift + F8, and evaluate a one-off expression with Cmd + Option + E.
Which shortcuts simulate rotation and volume on the emulator?
On macOS, hold Cmd + Option with the arrow keys: Cmd + Option + → rotates right, Cmd + Option + ← rotates left, Cmd + Option + ↑ raises the volume and Cmd + Option + ↓ lowers it. The three system keys are Cmd + Option + M for menu, Cmd + Option + B for back and Cmd + Option + P for power. On Windows, swap Cmd + Option for Ctrl + Alt, so Ctrl + Alt + ←/→ rotates and Ctrl + Alt + ↑/↓ changes volume. You can also reach the AVD Manager for the device list with Cmd + Shift + A.
When should I use the Logcat panel versus the Profiler panel?
Start with correctness: Cmd + 6 opens Logcat, which shows what the app logged at runtime, with Cmd + Option + L to clear it and Cmd + Shift + A to search for a Logcat filter that narrows output to a specific tag. Once behaviour is right, move to performance: Cmd + 7 opens the Profiler for CPU, memory and network figures, and during a recording Cmd + Option + P pauses while Cmd + Option + R resumes (the same key resumes a paused program in the debugger). The two have distinct jobs — do not open the Profiler while still hunting for functional bugs.
Official References
Each command links to its official documentation below, so you can verify the latest usage and read deeper.
Maintained by LaoHand
Publicly updated on Jul 21, 2026, continuously proofread against official docs.
Contact Us
Wrong command or description? Send us corrections, business inquiries or product feedback by email.
Contact Us