Android Studio Cheat Sheet

Here’s a cheat sheet for some commonly used commands and shortcuts in Android Studio:

General Shortcuts

  • Build and Run:
    • Build: Ctrl + F9 (Windows/Linux) or Cmd + F9 (Mac)
    • Run: Shift + F10
  • Debugger:
    • Toggle Breakpoint: Ctrl + F8 (Windows/Linux) or Cmd + F8 (Mac)
    • Step Over: F8
    • Step Into: F7
    • Resume: F9
  • Code Navigation:
    • Go to Class: Ctrl + N (Windows/Linux) or Cmd + O (Mac)
    • Go to File: Ctrl + Shift + N (Windows/Linux) or Cmd + Shift + O (Mac)
    • Go to Symbol: Ctrl + Alt + Shift + N (Windows/Linux) or Cmd + Opt + O (Mac)

Editing Shortcuts

  • Code Completion:
    • Basic Completion: Ctrl + Space
    • Smart Completion: Ctrl + Shift + Space
  • Refactoring:
    • Rename: Shift + F6
    • Extract Method: Ctrl + Alt + M (Windows/Linux) or Cmd + Alt + M (Mac)
    • Extract Variable: Ctrl + Alt + V (Windows/Linux) or Cmd + Alt + V (Mac)
  • Commenting:
    • Comment/Uncomment: Ctrl + / (Windows/Linux) or Cmd + / (Mac)
    • Block Comment: Ctrl + Shift + / (Windows/Linux) or Cmd + Shift + / (Mac)

Navigation

  • File Navigation:
    • Toggle Project View: Alt + 1
    • Navigate Between Tabs: Ctrl + Tab (Windows/Linux) or Cmd + (Mac)
  • Code Navigation:
    • Go to Declaration: Ctrl + B (Windows/Linux) or Cmd + B (Mac)
    • Find Usages: Alt + F7 (Windows/Linux) or Cmd + F7 (Mac)
  • Usage Search:
    • Find Usages: Alt + F7 (Windows/Linux) or Cmd + F7 (Mac)
    • Show Usages: Ctrl + Alt + F7 (Windows/Linux) or Cmd + Opt + F7 (Mac)

Productivity Shortcuts

  • Live Templates:
    • Surround with: Ctrl + Alt + T (Windows/Linux) or Cmd + Alt + T (Mac)
    • Expand Live Template: Tab
  • Run Configurations:
    • Edit Configurations: Shift + Alt + F10 (Windows/Linux) or Ctrl + Option + R (Mac)
    • Select Configuration: Shift + Alt + F10 (Windows/Linux) or Ctrl + Option + R (Mac)
  • Database Tools:
    • Open Database Tool: Alt + 9
    • Execute Query: Ctrl + Enter (Windows/Linux) or Cmd + Enter (Mac)

Version Control

  • Git:
    • Commit Changes: Ctrl + K (Windows/Linux) or Cmd + K (Mac)
    • Update Project: Ctrl + T (Windows/Linux) or Cmd + T (Mac)
  • GitHub Integration:
    • Push Commits: Ctrl + Shift + K (Windows/Linux) or Cmd + Shift + K (Mac)
    • Pull Commits: Ctrl + T (Windows/Linux) or Cmd + T (Mac)

Feel free to explore more shortcuts based on your specific needs. You can find the full list of shortcuts in Android Studio by navigating to Help -> Keymap Reference.