Android Studio has a lot of shortcuts to offer. Today, we will be sharing some useful shortcuts which can enhance and boost your productivity. We will be sharing commands for both the Mac and Windows environment. Ready. Get. Set. Go!
Lookup any Action
Mac – Cmd + Shift + A
Windows – Control + Shift + A
Using this command you can search for any action you want to do. This command is the mother of all dragons.
Very useful for beginners who are starting to adopt shortcuts and know what Android Studio has in store.
Lookup methods/Code Completion
You can autocomplete method, lookup variables, methods available using the below command.
Mac – Command + Space
Windows – Control + Space
This is a very common command and is available in most IDEs.
Press Shift Twice and lookup in your whole project ( Mac and Windows)
Search only files –
Mac: Shift + Command + O
Win: Ctrl + Shift + N
To open “class” only use :
Mac: Command + O
You can create methods quickly from a selected block of the code as shown below:
Mac – Cmd + Option + M
Windows – Ctrl + Alt + M
To add a single parameter in the method use the following alternative shortcut:
Mac – Cmd + Option + P
Windows – Ctrl + Alt + P
You can enclose a bunch of code in blocks such as if else etc as shown below:
Mac – Cmd + Option + T
Windows – Ctrl + Alt + T
For deleting a line:
mac: Cmd + Backspace
Windows: Ctrl + Y
mac: Cmd + D
Windows: Ctrl + D
You can toggle variables and string case easily using the following:
mac: Cmd + Shift + U
Windows: Ctrl + Shift + U
Use Command + 7 or Ctrl + 7 to list the structure (methods and instance variables present in the file):
Android Studio stores all your copied stuff in clipboard. To access them, use
Mac : Shift + Command + V
Windows : Shift + Ctrl + V
This is my personal favourite!
You can make selections for the next occurrence of the keyword as shown below:
To do the above just start selecting and dragging down pressing the Alt button.
Alternatively, we can use:
Mac : Ctrl + G
Windows : Alt + J
Goto Next Error
Use the F2 button to goto the next error in your code as shown below:
Mac: Shift + Cmd + ↓/↑
Windows: Shift + Ctrl + ↓/↑
You can autogenerate code such as getters and setters using the below commands:
Mac: Ctrl + Enter
You can override methods as shown below:
Mac: Command + O
Windows: Ctrl + O
Change Method Signature
Mac:Cmd + f6
Windows:Control + f6
Live Templates can be enabled/disabled from Android Studio preferences.
I’m using Tabs for live templates.
Let’s see what happens when I press tab while creating a Toast.
Another important shortcut:
Last Edited location:
That’s a wrap on this article. Keep exploring shortcuts that boost your speed.