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.

Dev Tools·52 commands·Last updated 2026-07-21

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 + N
Generate code (constructor, getter/setter, equals/hashCode)
Cmd + Option + T
Surround with (if/for/try/catch)
Cmd + Option + M
Extract method
Cmd + Option + V
Extract variable
Cmd + Option + C
Extract constant
Cmd + P
Parameter info
Cmd + B
Go to declaration
Cmd + U
Go to superclass/interface
Cmd + Option + B
Go to implementation
Cmd + Option + H
View type hierarchy

Layout Editor 10

Cmd + Option + →
Switch to next tab (Design/Text)
Cmd + Option + ←
Switch to previous tab
Cmd + Shift + A
Find action (search layout tools)
Cmd + Option + I
Auto-indent XML
Cmd + Option + L
Format XML
Cmd + Option + Shift + I
Preview layout
Cmd + Option + C
Copy view
Cmd + Option + V
Paste view
Cmd + Option + X
Cut view
Cmd + Option + Z
Undo

Gradle Build 7

Cmd + Shift + A
Search Gradle tasks
Cmd + F9
Build project
Cmd + F5
Refresh Gradle dependencies
Cmd + Option + Shift + S
Sync Gradle files
Cmd + Option + G
Open Gradle panel
Cmd + Shift + F9
Run current configuration
Cmd + Shift + F10
Run current app

Emulator & Device 8

Cmd + Shift + A
Search AVD manager
Cmd + Option + ←
Emulator rotate left
Cmd + Option + →
Emulator rotate right
Cmd + Option + ↑
Emulator volume up
Cmd + Option + ↓
Emulator volume down
Cmd + Option + M
Emulator menu key
Cmd + Option + B
Emulator back key
Cmd + Option + P
Emulator power key

Debug & Run 11

Ctrl + R
Run current configuration
Ctrl + D
Debug current configuration
Cmd + F2
Stop
F8
Step over
F7
Step into
Shift + F8
Step out
Alt + F9
Run to cursor
Cmd + F8
Toggle breakpoint
Cmd + Shift + F8
View all breakpoints
Cmd + Option + R
Resume program
Cmd + Option + E
Evaluate expression

Logcat & Performance 6

Cmd + 6
Open Logcat panel
Cmd + Option + L
Clear Logcat
Cmd + Shift + A
Search Logcat filter
Cmd + 7
Open Profiler panel
Cmd + Option + P
Profiler pause
Cmd + Option + R
Profiler resume

Parameter matrix

ParameterEffectExample
Cmd + NGenerate code (constructor, getter/setter, equals/hashCode)With the cursor inside the class body, press Cmd + N
Cmd + Option + TSurround the selection with code (if/for/try/catch)Select a statement then press Cmd + Option + T
Cmd + Option + MExtract methodSelect a piece of logic then press Cmd + Option + M
Cmd + Option + VExtract variableSelect an expression then press Cmd + Option + V
Cmd + Option + CExtract constantSelect a literal then press Cmd + Option + C
Cmd + PView parameter infoCmd + P
Cmd + BGo to declarationPlace the cursor on a symbol and press Cmd + B
Cmd + UGo to superclass/interfaceCmd + U
Cmd + Option + BGo to implementation classCmd + Option + B
Cmd + Option + HView type hierarchyCmd + Option + H
Cmd + Shift + AFind Action catch-all palette (Gradle tasks, AVD, Logcat filters)Cmd + Shift + A
Cmd + Option + Shift + SSync Gradle filesCmd + Option + Shift + S
Cmd + F9 / Cmd + F5Build project / refresh Gradle dependenciesCmd + F9
Cmd + Option + L / + IFormat XML / auto-indent XMLCmd + Option + L
Cmd + Option + → / ←Switch to the next/previous tab (Design/Text)Cmd + Option + →
Ctrl + R / Ctrl + DRun current configuration / debug current configurationCtrl + D
F7 / F8 / Shift + F8Step into / step over / step outF7
Alt + F9Run to the cursor lineAlt + F9
Cmd + F8Toggle breakpointCmd + F8
Cmd + Option + EEvaluate expression while debuggingCmd + Option + E
Cmd + 6 / Cmd + 7Open the Logcat panel / open the Profiler panelCmd + 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

  1. 1Locate any action with the command palette

    Press Cmd + Shift + A then type the action name

    Gradle tasks, AVD management, and Logcat filters are all searchable; search first to confirm a feature exists.

  2. 2Sync Gradle files

    Press Cmd + Option + Shift + S

    Must be run after changing build.gradle; it only takes effect once the build progress bar at the bottom finishes.

  3. 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.

  4. 4View runtime logs

    Press Cmd + 6 to open the Logcat panel

    Filter by tag with conditions; after reproducing the issue look back at the latest output immediately.

  5. 5Locate performance bottlenecks

    Press Cmd + 7 to open the Profiler panel

    Check 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 constant

Android 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 out

Instead 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 configuration

Cmd + 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