Android Studio Cheatsheet

IDE keyboard shortcuts (macOS / Windows)

Shortcuts
Contents
⌨️

General

⌘⇧A / Ctrl+Shift+A   Find Action
⌘, / Ctrl+Alt+S       Settings
⌘; / Ctrl+Alt+Shift+S Project Structure
⌘1 / Alt+1             Project panel
⌘7 / Alt+7             Structure panel
⌘9 / Alt+9             Version control
⌘⇧F12                 Toggle maximize editor
⌘E / Ctrl+E           Recent files
⌘⇧E / Ctrl+Shift+E   Recent locations
⌘` / Ctrl+`           Quick switch scheme
✏️

Editing

⌘⇧Enter / Ctrl+Shift+Enter  Complete statement
⌥Enter / Alt+Enter         Quick fix / intention
⌘P / Ctrl+P                Parameter info
⌘⇧↑ / Alt+Shift+↑         Move line up
⌘⇧↓ / Alt+Shift+↓         Move line down
⌘D / Ctrl+D                Duplicate line
⌘⌫ / Ctrl+Y                Delete line
⌘/ / Ctrl+/                Line comment
⌘⌥/ / Ctrl+Shift+/         Block comment
⌥↑ / Ctrl+W                Extend selection
⌥↓ / Ctrl+Shift+W          Shrink selection
⌘⌥L / Ctrl+Alt+L           Reformat code
⌘⌥O / Ctrl+Alt+O           Optimize imports
Tab / ⇧Tab                 Indent / unindent
🔄

Refactoring

⇧F6 / Shift+F6             Rename
⌘F6 / Ctrl+F6              Change signature
F6                          Move
⌘⌥M / Ctrl+Alt+M           Extract method
⌘⌥V / Ctrl+Alt+V           Extract variable
⌘⌥F / Ctrl+Alt+F           Extract field
⌘⌥C / Ctrl+Alt+C           Extract constant
⌘⌥P / Ctrl+Alt+P           Extract parameter
⌘⌥N / Ctrl+Alt+N           Inline
🏃

Run & Debug

⌃R / Shift+F10             Run
⌃D / Shift+F9              Debug
⌘F9 / Ctrl+F9              Build project
⌘⇧F9                       Rebuild
⌘R / Ctrl+F5               Rerun
⌘F2 / Ctrl+F2              Stop
⌃⌥R / Alt+Shift+F10        Run config

# Debug
F8                          Step over
F7                          Step into
⇧F8                         Step out
F9                          Resume
⌘F8 / Ctrl+F8              Toggle breakpoint
⌘⇧F8                       View breakpoints
⌥F8 / Alt+F8               Evaluate expression
📱

Emulator

# Emulator shortcuts
⌘⇧L                        Rotate left
⌘⇧R                        Rotate right
⌘=                          Zoom in
⌘-                          Zoom out
⌘⇧S                        Screenshot

# ADB commands
adb devices                 List devices
adb install app.apk         Install APK
adb logcat                  View logs
adb shell                   Shell access
adb push local remote       Push file
adb pull remote local       Pull file
adb reverse tcp:8080 tcp:8080  Port forward
🐘

Gradle

# Sync project
File → Sync Project with Gradle
⌘⇧I / Ctrl+Shift+O        Sync now

# Common tasks
./gradlew build             Build
./gradlew clean             Clean
./gradlew assembleDebug     Debug APK
./gradlew assembleRelease   Release APK
./gradlew test              Run tests
./gradlew lint              Run lint
./gradlew dependencies      Show deps
./gradlew tasks             List tasks