Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Android Studio Shortcuts (Mac)

Android Studio Shortcuts (Mac)

Notes:

  • Two of the most useful shortcuts utilize the Fn (function) keys. It is therefore recommended that you enable the "Use all F1, F2, etc. keys as standard function keys" option [System Preferences > Keyboard].
  • Be sure to enable the Mac OS X 10.5+ keymap in Android Studio [Preferences > Keymap].
  • A fairly complete shortcut list can be found here.

Useful symbols:

⌘ = Command Key
⌥ = Option Key
⇧ = Shift Key
⌃ = Control Key

Essential Shortcuts:

Learn these shortcuts right away.

Description Shortcut
Display list of available auto-fixes for code warning/error at cursor Option-Enter
Go to the declaration of the variable/method/class at cursor Command-B
Rename all copies of the variable/method/class at cursor Shift-F6
List all usages of the variable/method/class at cursor Command-Option-F7
Generate code (incl. getters, setters, constructors, method overrides) Command-N
Search for and open any file by name (filters as you type) Command-Shift-O
Find text in the current file (Enter = cycle through results, Esc. = cancel) Command-F

Frequently Useful Shortcuts:

Learn these shortcuts once you have the essential shortcuts nailed.

Description Shortcut
View javadoc of symbol at cursor in pop-up F1
View definition of method at cursor in pop-up Command-Y
Skip back/forward through cursor position history Command-[, Command-]
Search for and list any occurrences of text Command-Shift-F
Go to next highlighted error in current file F2
Run Control-R
Comment/Uncomment all selected lines (also works in xml files) Command-/
Show available parameters for current method (must be inside parentheses) Command-P
Find and replace in current file Command-R

Shortcuts For Wizards:

Check these shortcuts out if you are bored. To use 'navigate through open tabs', you will have to change or disable the corresponding Mission Control shortcuts [System Preferences > Keyboard > Keyboard Shortcuts > Mission Control].

Description Shortcut
Go to given line number in current file Command-L
Duplicate current line Command-D
Format code to conform to Android Studio's default style Command-Option-L
List implementations/overrides of class/interface/method at cursor Command-Option-B
Search for and go to any symbol (incl. variables and methods) Command-Option-O
Show class structure in pop-up Command-F12
List recently viewed files in pop-up Command-E
List recently edited files in pop-up Command-Shift-E
View code hierarchy for symbol in pop-up Control-Option-H
Move code block at cursor up/down ⌘-⇧-up arrow, ⌘-⇧-down arrow
Navigate through open tabs ⌃-left arrow, ⌃-right arrow
View full refactor menu Control-T
Collapse all code blocks / Expand all code blocks ⌘⇧+, ⌘⇧-
Insert new line below current cursor position Shift-Enter
Complete statement (add braces, parentheses, semi-colon) Command-Shift-Enter
Toggle scheme Control-`
@macklinu

This comment has been minimized.

Copy link

macklinu commented Jul 22, 2014

Another good pair of keyboard shortcuts is ⌘[ or ⌘]. Say I ⌘B to go to the implementation of a method and I want to jump right back to the last piece of code my cursor was at - boom, ⌘[. Makes navigating even easier. Can find in the Navigate menu -> Back or Forward. 👍

@stkent

This comment has been minimized.

Copy link
Owner Author

stkent commented Jul 29, 2014

Oh yeah, totally true, I should learn to use those!

Edit: done.

@kutsan

This comment has been minimized.

Copy link

kutsan commented Feb 26, 2016

Thanks! It was useful for me.

@stkent

This comment has been minimized.

Copy link
Owner Author

stkent commented Apr 1, 2016

Glad it helped!

@LeoYe168

This comment has been minimized.

Copy link

LeoYe168 commented May 11, 2016

how to switch edit window

@einverne

This comment has been minimized.

Copy link

einverne commented May 18, 2016

@LeoYe168 You can use Command + Shift + [ and Command + Shift + ] to switch between opened Editor Tabs. Link

@azlanjamal

This comment has been minimized.

Copy link

azlanjamal commented Jun 1, 2016

Awesome guide. Help me in speed up my development. Big Thanks.

@rajajawahar

This comment has been minimized.

Copy link

rajajawahar commented Aug 11, 2016

That really awesome.. Finding errors in a file. key F2

@developer1011

This comment has been minimized.

Copy link

developer1011 commented Aug 26, 2016

Really awesome guide.
To find parent implementation of an overridden method use key Command-U

@brunogabriel

This comment has been minimized.

Copy link

brunogabriel commented Nov 12, 2016

Real nice, thanks.

@amajeedmuazu

This comment has been minimized.

Copy link

amajeedmuazu commented Dec 8, 2016

So how can I insert a for loop (auto complete) by typing 'for' then ...

@huseyinbarin

This comment has been minimized.

Copy link

huseyinbarin commented Apr 22, 2017

⌃-left arrow, ⌃-right arrow will cause the switching operating system's windows. How can handle with this?

@stkent

This comment has been minimized.

Copy link
Owner Author

stkent commented Apr 27, 2017

@mahrezzz I've since switched to a tabless configuration, so I'm not sure any longer. Sorry!

@hendercine

This comment has been minimized.

Copy link

hendercine commented Jun 26, 2017

@mahrezzz Command + shift + [ and Command + shift + ] or Navigate-Back and Navigate-Forward will switch between tabs in the editor.

@haxpor

This comment has been minimized.

Copy link

haxpor commented Aug 5, 2017

Split vertically, and horizontally are good to have too, but you need to set it manually via Cmd+, to open Preferences. Then click on Keymap. Enter in text field to search for Split horizontally or Split vertically. Add your keymap there.

@Violet-Bora-Lee

This comment has been minimized.

Copy link

Violet-Bora-Lee commented Aug 6, 2017

I've changed OS from Windows to MacOS. Is there anyone who knows same shortcut of alt up(or down) arrow in MacOS?
This shortcut makes u move upper or below methods.

@mehulparmar4ever

This comment has been minimized.

Copy link

mehulparmar4ever commented Sep 8, 2017

Good work man.

@aalap03

This comment has been minimized.

Copy link

aalap03 commented Jan 23, 2018

I have a weird problem, in my android studio in MAC I am not able to print "|" (OR) symbol, (In both french and english key board), I tried all the pairings with using command, alter and ctrl but doesn't work, thus I have to go to other editor, and type "|" (Using alt + / (key besides 1)) and copy paste in android studio. Any solutions ?

@Lavanyagaur22

This comment has been minimized.

Copy link

Lavanyagaur22 commented Jul 14, 2018

Really helpful . Thanks!

@Lavanyagaur22

This comment has been minimized.

Copy link

Lavanyagaur22 commented Jul 14, 2018

Really helpful . Thanks!

@andbulavkin

This comment has been minimized.

Copy link

andbulavkin commented Jul 19, 2018

+1

@Melanie918

This comment has been minimized.

Copy link

Melanie918 commented Aug 9, 2018

This is very helpful 👍

@Nunens

This comment has been minimized.

Copy link

Nunens commented Jan 8, 2019

Thanks, this is really helpful....

@andrewclam1991

This comment has been minimized.

Copy link

andrewclam1991 commented Jun 27, 2019

Thanks man, helps so much for moving from PC to MAC for android dev.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.