Cheatsheet Android Studio
IDE oficial do Google para desenvolvimento Android (Kotlin/Java/Flutter)
Android Studio
File and Project
New (generate)
Alt + Insert
Generates class, file, constructor, etc.
Settings
Ctrl + Alt + S
Opens the IDE settings.
New class
Ctrl + N (in the project panel)
Creates a new Kotlin/Java class.
Project structure
Ctrl + Alt + Shift + S
Opens the project structure (SDK, modules).
Save all
Ctrl + S
Saves all files.
Recent files
Ctrl + E
Lists the recently opened files.
Close tab
Ctrl + F4
Closes the active tab.
Edition
Undo / Redo
Ctrl + Z (undo)
Ctrl + Shift + Z (redo)
Reverts or reapplies actions.
Move line
Alt + Shift + ↑ / ↓
Moves the current line.
Cut / Copy / Paste
Ctrl + X (cut)
Ctrl + C (copy)
Ctrl + V (paste)
Clipboard.
Comment line
Ctrl + /
Comments or uncomments the line.
Duplicate line
Ctrl + D
Duplicates the current line.
Comment block
Ctrl + Shift + /
Comments the selected block.
Delete line
Ctrl + Y
Removes the current line.
Toggle case
Ctrl + Shift + U
Toggles uppercase/lowercase.
Navigation
Search everywhere
Shift + Shift (double)
Searches classes, files, symbols and actions.
Go to line
Ctrl + G
Jumps to a line number.
File structure
Ctrl + F12
Lists the members of the current file.
Go to class
Ctrl + N
Searches for a class by name.
Go to definition
Ctrl + B (or Ctrl + Click)
Jumps to the symbol declaration.
Go to file
Ctrl + Shift + N
Searches for a file by name.
Go to implementation
Ctrl + Alt + B
Jumps to the implementations.
Go to symbol
Ctrl + Alt + Shift + N
Searches for methods and variables.
Back / forward
Ctrl + Alt + ← (back)
Ctrl + Alt + → (forward)
Navigates through the position history.
Search and Replace
Search
Ctrl + F
Searches in the current file.
Next / previous
F3 (next)
Shift + F3 (previous)
Navigates through the results.
Replace
Ctrl + R
Replaces in the current file.
Actions (Find Action)
Ctrl + Shift + A
Searches for IDE commands and actions.
Search in project
Ctrl + Shift + F
Searches across the whole project.
Replace in project
Ctrl + Shift + R
Replaces across the whole project.
Code and Refactoring
Autocomplete
Ctrl + Space
Basic code suggestions.
Refactor this
Ctrl + Alt + Shift + T
Menu of available refactorings.
Quick documentation
Ctrl + Q
Shows the symbol documentation.
Smart autocomplete
Ctrl + Shift + Space
Suggestions by expected type.
Format code
Ctrl + Alt + L
Formats the file according to the style.
Fold / expand
Ctrl + - (fold)
Ctrl + + (expand)
Collapses or shows blocks.
Quick fix
Alt + Enter
Shows intentions and fixes.
Optimize imports
Ctrl + Alt + O
Removes unused imports.
Rename
Shift + F6
Renames the symbol across the whole project.
Override methods
Ctrl + O
Generates superclass methods.
Build and Execution
Build project
Ctrl + F9
Builds the project (Make).
Stop
Ctrl + F2
Stops the running execution.
Run app
Shift + F10
Runs the current configuration.
Sync Gradle
Ctrl + Shift + O (notification bar)
Syncs the project with the Gradle files.
Debug app
Shift + F9
Starts in debug mode.
Run in context
Ctrl + Shift + F10
Runs the test/class under the cursor.
Debugging
Toggle breakpoint
Ctrl + F8
Adds/removes a breakpoint on the line.
Step out
Shift + F8
Steps out of the current function.
Continue / resume
F9
Resumes execution until the next breakpoint.
Evaluate expression
Alt + F8
Evaluates an expression at runtime.
Step over
F8
Advances one line (without stepping in).
View breakpoints
Ctrl + Shift + F8
Lists all breakpoints.
Step into
F7
Steps into the called function.
Views and Tools
Project panel
Alt + 1
Shows/hides the project explorer.
Commit (Git)
Ctrl + K
Opens the commit window.
Terminal
Alt + F12
Opens the integrated terminal.
Push (Git)
Ctrl + Shift + K
Pushes the commits to the remote.
Logcat
Alt + 6
Opens the Android logs panel.
VCS operations
Alt + `
Version control pop-up menu.
Hide panels
Shift + Esc
Hides the active tool window.