Useful Android Studio Shortcuts to Increase Your Productivity

Remembering and using shortcuts frequently will reduce your work time a lot, esp. for repetitive tasks. The following are the most useful shortcuts/hotkeys in Android Studio:

Editor

  • Alt + Left / Right: Switch to the previous/next tab
  • Ctrl + Alt + Left / Right: Reversed version of Alt + Left / Right
  • Ctrl +Left / Right: Navigate within code word-by-word
  • F2: Go to the next syntax error
  • Ctrl + F4 : Close tab. I don’t use this because I’m too familiar with Alt+F4 to close anything in Windows.

Search and Replace

  • Double Shift: Multi-purpose searching. I use this shortcut a lot to search for files in res folder
  • Ctrl + F : Find string in the current file
  • Ctrl + R : Find and replace the string in the current file
  • Ctrl + Shift + F : Find string in project files

Code / Comment

  • Ctrl + D : Duplicate the current line of code
  • Ctrl + Y : Remove the current line of code
  • Ctrl + + / – : Expand / collapse code block
  • Alt + Shift + Left Click: Place an extra cursor.
  • Ctrl + Left Click: Go to the Class file of clicked object, method, or property.
  • Ctrl + / : Comment / uncomment a line of code
  • Ctrl + Shift + / : Comment / uncomment a block of code
  • Ctrl + Alt + L : Reformat code
  • Shift + F6: Refactor name replacement. This can be used in project view and code lines
  • Ctrl + Alt + O: Optimize imports. It removes unused imports.

Build/Debug

  • Shift + F10 : Run selected build
  • Shift + F9 : Debug selected build
  • Ctrl + F2 : Stop build

Leave a Comment

Your email address will not be published. Required fields are marked *


Scroll to Top

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close