Android Studio shortcuts like Eclipse
Asked Answered
M

20

132

I am new to Android Studio and want to know about shortcuts. In Eclipse we use shift-ctrl-O for importing. In Android Studio we use alt-enter. My question about importing override methods and unimplemented methods. Is there a shortcut for these in Android Studio?

Meretricious answered 26/12, 2014 at 12:18 Comment(4)
Try this. It will help to change ur shortcuts to your favorite IDE https://mcmap.net/q/53682/-what-is-the-shortcut-to-auto-import-all-in-android-studioDenaedenarius
another answer with most votes is the correct answer.Chinese
check this answerNicely
Just in case if you want to go with existing shortcuts then they are very easy to find - Just press Ctrl + Shift + A search for the action you want to perform.Dygal
F
137

Yes, the list of keyboard shortcuts for Android Studio is at https://developer.android.com/studio/intro/keyboard-shortcuts.html.

Here are a few that I know.

Check :File ->Settings ->Keymap -> <Choose Eclipse from Keymaps dropdown> or

Add unimplemented methods: CTRL + I

Override methods: CTRL + O

Format code: CTRL + ALT + L

Show project: ALT + 1

Show logcat: ALT + 6

Hide project - logcat: SHIFT + ESC

Build: CTRL + F9

Build and Run: CTRL + F10

Expand all: CTRL + SHIFT + NumPad +

Collapse all: CTRL + SHIFT + NumPad -

Find and replace: CTRL + R

Find: CTRL + F

In case I'm missing any shortcut that you need you can ask here and for more check implink!! or link!!:)

Frida answered 26/12, 2014 at 12:31 Comment(2)
List of shortcuts for Mac and Windows.Precess
https://mcmap.net/q/152405/-is-there-anything-like-ctrl-shift-t-of-eclipse-in-android-studio-to-see-open-type-window This is Ctrl + N replace Ctrl + Shift + T in Eclipse ==> Find ClassEnervated
A
253

You can use Eclipse Short-cut key in Android Studio too.

File -> Settings -> Keymap -> <Choose Eclipse from Keymaps dropdown> 

For Mac OS :

Android Studio -> Preferences or Properties -> Keymap -> <Choose Eclipse from Keymaps dropdown> 
Amen answered 9/4, 2015 at 13:0 Comment(6)
@TomaszGawel corrected answer marking depends on Answer as per the particular question when asked. Question asked in Dec and Answer in next june.. any Idea hw it can help me ?Meretricious
This doesn't seem to map all the short cuts from Eclipse, the ones like Cmd+Shift+R to search all classes, Cmd+O to search for methods in a class etc. Do we need to add these manually?Extrovert
@FauxPas: Which version Android studio has you working now? Bcz, this shortcut is working with my Android Studio.Amen
1.2.1.1 Actually Ctrl+O etc works, I just needed to add Cmd+O manuallyExtrovert
There is option <Eclipse for Mac> too. Had you try that?Amen
you made my day, sir.Botello
F
137

Yes, the list of keyboard shortcuts for Android Studio is at https://developer.android.com/studio/intro/keyboard-shortcuts.html.

Here are a few that I know.

Check :File ->Settings ->Keymap -> <Choose Eclipse from Keymaps dropdown> or

Add unimplemented methods: CTRL + I

Override methods: CTRL + O

Format code: CTRL + ALT + L

Show project: ALT + 1

Show logcat: ALT + 6

Hide project - logcat: SHIFT + ESC

Build: CTRL + F9

Build and Run: CTRL + F10

Expand all: CTRL + SHIFT + NumPad +

Collapse all: CTRL + SHIFT + NumPad -

Find and replace: CTRL + R

Find: CTRL + F

In case I'm missing any shortcut that you need you can ask here and for more check implink!! or link!!:)

Frida answered 26/12, 2014 at 12:31 Comment(2)
List of shortcuts for Mac and Windows.Precess
https://mcmap.net/q/152405/-is-there-anything-like-ctrl-shift-t-of-eclipse-in-android-studio-to-see-open-type-window This is Ctrl + N replace Ctrl + Shift + T in Eclipse ==> Find ClassEnervated
C
28

If you use Android Studio with Mac OS X these are some shortcuts:

- Compile java sources SHF+CMD+F9

- Build the project CMD+F9

- Run the current configuration CTR+R

- Run in debugger CTR+D

- Open project properties CMD++;

- Open Android Studio preferences CMD++,

- Find any command SHF+CMD+A

- Auto-format code OPT+CMD+L

- Delete line CMD+DELETE or CMD+Backspace

- Duplicate line/selection CMD+D

- Copy line CMD+C (with nothing selected)

- Select next occurance(s) CTR+G

Scope based selection

  • Select next higher scope Option+UP

  • Select next lower scope Option+DOWN

enter image description here

Navigating the code

- Open class CMD+O

- Open file SHF+CMD+O

- Navigate back to last position CMD+[

- Navigate forward to previous position CMD+]

- Switch to recently used files CRT+TAB

Intention Actions

  • If/Switch actions Option+RETURN

enter image description here

Create method CMD+N

or

enter image description here

Loop an array of ints

enter image description here

  • Generate Logs usin logd, loge, logi, logt, logm and logr

enter image description here

- Project quick fix ALT+ENTER

- Show docs for selected API F1

- Jump to source CMD+down-arrow

Most of them I found on this really good article and Android Studio Tips and Tricks

Countermand answered 17/6, 2015 at 12:43 Comment(0)
E
23

Yes you can go to File -> Settings -> Editor -> Auto Import -> Java and make the following changes:

1.change Insert imports on paste value to All in drop down option.

2.markAdd unambigious imports on the fly option as checked.(For Window or linux user)

On a Mac, do the same thing in Android Studio -> Preferences

3.You can also use Eclipse shortcut key in Android Studio just go to in Android Studio

File -> Settings -> KeyMap -> Keymaps dropdown Option. Select from them

Thankyou

Electrum answered 14/2, 2015 at 9:12 Comment(0)
B
19

Important Android Studio Shortcuts You Need the Most


Navigation Shortcuts

  • Go to class : CTRL + N

  • Go to file : CTRL + SHIFT + N

  • Navigate open tabs : ALT + Left-Arrow; ALT + Right-Arrow

  • Lookup recent files : CTRL + E

  • Go to line : CTRL + G

  • Navigate to last edit location : CTRL + SHIFT + BACKSPACE

  • Go to declaration : CTRL + B

  • Go to implementation : CTRL + ALT + B

  • Go to source : F4

  • Go to super Class : CTRL + U

  • Show Call hierarchy : CTRL + ALT + H

  • Search in path/project : CTRL + SHIFT + F


Programming Shortcuts

  • Reformat code : CTRL + ALT + L

  • Optimize imports : CTRL + ALT + O

  • Code Completion : CTRL + SPACE

  • Issue quick fix : ALT + ENTER

  • Surround code block : CTRL + ALT + T

  • Rename and refactor : SHIFT + F6

  • Line Comment or Uncomment : CTRL + /

  • Block Comment or Uncomment : CTRL + SHIFT + /

  • Go to previous/next method : ALT + UP/DOWN

  • Show parameters for method : CTRL + P

  • Quick documentation lookup : CTRL + Q


General Shortcuts

  • Delete line : CTRL + Y

  • Safe Delete : ALT + DELETE

  • Close Active Tab : CTRL + F4

  • Build and run : SHIFT + F10

  • Build : CTRL + F9

  • All purpose (Meta)Shortcut : CTRL + SHIFT + A

Bentonbentonite answered 20/5, 2016 at 7:40 Comment(1)
Most helpful answer to eliminate use of mouseSubsistence
D
17

Another option is :

View  >  Quick Switch Scheme  >  Keymap  >  Eclipse
Dirham answered 4/5, 2015 at 5:9 Comment(0)
S
15

Android Studio is built on IntelliJ IDEA Community Edition, the popular Java IDE by JetBrains. This allows the user to select their own keymap (supporting different IDE shortcuts in your IDE).

You can use "Mac os X, Visual studio, Eclipse, Netbeans etc.. shortcuts in your Android Studio by doing the following:

File -> Settings -> Keymap -> choose "Eclipse" from dropdown.

OR press Ctrl+Alt+S -> keymap -> choose "Eclipse" from dropdown like this.

enter image description here

Stint answered 24/8, 2015 at 11:31 Comment(3)
What is the default keymap in Android Studio Mac ? For me "Ctrl+R"(To Run) shortcut are not working. This and some other shortcuts are not working. I'm currently having "Eclipse (Mac OS X)" as keymap. Then I can't switch to next tab in android studio by clicking "Ctrl+right or left arrow key" it takes me to next desktop instead of next tab in Android Studio.. Help me. ?Planimeter
Have you tried to use keymap as "Eclipse" instead of "Eclipse(Mac OS X)"Stint
All I wanna click the run button instead of shortcut keysPlanimeter
S
5

You can change your keymap to use eclipse shortcuts. You can see here how to change keymap. https://stackoverflow.com/a/25419358

Sosthenna answered 26/12, 2014 at 12:24 Comment(0)
M
5

View > Quick Switch Scheme > Keymap > Eclipse
use this option for eclipse keymap or if u want to go with AndroidStudio keymap then follow below link

Click here for Official Android Studio Keymap Refference guide

you may find default keymap referrence in

AndroidStudio --> Help-->Default keymap refrence

Multiplier answered 29/5, 2015 at 8:32 Comment(0)
P
5

These are some of the useful shortcuts for Android studio (Windows)

  • Double Shift - Search EveryWhere

  • Ctrl + Shift+A - quick command search

  • Ctrl +N - Find Class (capable of finding internall classes aswell)

  • Ctrl +Shift+N - Find File

  • Alt+F7 - Find Uses (To get the call hierarchy)

  • Ctrl+B - goto class definition.

  • Ctrl+LeftClick - goto to symbol(variable, method, class) definition/definition.

  • Ctrl+Alt+Left - Back

  • Ctrl+Alt+Right - Right

  • Shift+f6 - Refactor/Rename

Pamphylia answered 25/6, 2015 at 3:21 Comment(0)
M
3

Update

From Android Studio v3.0.1:

In Android Studio, by pressing ALT + INSERT (or + N for MacOS), you will have following choices (including your solution!):

  • Constructor
  • Getter
  • Setter
  • Getter and Setter
  • equals() and hashCode()
  • toString()
  • Override Methods...
  • Implement Methods...
  • Delegate Methods...
  • Super Method Call (When inside an Override Method)
  • Copyright
  • App Indexing API Code (Not available inside class extending Fragment.)

Note: Some methods are auto implemented but you can select Override Methods... option to implement other unimplemented methods.

Mawkish answered 21/9, 2015 at 9:4 Comment(0)
P
2

you can not remember all shortcuts :)
android studio(actually intellij) has a solution

quick command search : ctrl+shift+A

enter image description here

Phonon answered 21/3, 2015 at 23:18 Comment(0)
R
2

Not eclipse like you can do eclipse shot cuts just do the following

File ->Settings ->keymap -> in the drop down "KeyMaps" select  Eclipse ->
Apply ->ok.
Rennin answered 6/8, 2015 at 4:30 Comment(0)
M
2

Android Studio(IntelliJ IDEA) Search

enter image description here

  • All - Search Everywhere

    Double Shift

  • Classes - Find class:

    Mac: ⌘ Command + O
    Windows/Linux: Ctrl + N

  • Files - Find file:

    Mac: ⌘ Command + Shift + O
    Windows/Linux: Ctrl + Shift + N

  • Symbols - Search by symbol name:

    Mac: ⌘ Command + ⌥ Option + O
    Windows/Linux: Ctrl + Alt + Shift + N

  • Action - Find action:

    Mac: ⌘ Command + Shift + A
    Windows/Linux: Ctrl + Shift + A

Mastery answered 7/9, 2020 at 11:18 Comment(0)
L
1

Alt+enter is a 'fast solving problems option'. If you try it over class name after writing 'implements XXXX' it will suggest you to autoimplemnt that methods.

The correct shortcut for 'Organice imports' is Ctrl+Alt+O

You can find a really good Android Studio/IntellyJ shortcuts cheatsheet here: IntellyJ shortcut cheatsheet

------Hint-----

Give a try to Live Templates in Android Studio (It's like magic). Just press Ctrl+J

Lenz answered 26/12, 2014 at 12:23 Comment(0)
H
1

If you're looking for a shortcut in Android studio and can't quite remember the command, simply click Ctrl+Shift+A to launch the command search. From here, you can search for any shortcut you want.

Merry coding!

Hluchy answered 27/9, 2018 at 14:55 Comment(1)
this is best one.Threemaster
S
0

These are for shortcuts specific to android studio.And since it is based on IntelliJ Idea studio,these will work too

answering your specific question,Android Studion is quite logical wrt to shortcuts,for eg for all the situations you asked,try alt-insert

Suppressive answered 26/12, 2014 at 12:24 Comment(0)
R
0

Using Eclipse key mapping inside Android Studio is the better choice. It will easily adapt to existing key structure. But all the new persons are using new shortcut key structures in Android Studio has. So we will learn and follow Android Studio itself contain shortcuts will help easily interact the team mates.

If you use Android Studio in Max OS X mean to follow the below link. It works for me. https://mcmap.net/q/152207/-android-studio-shortcuts-like-eclipse

Roth answered 29/8, 2017 at 14:31 Comment(0)
M
0

in androidstudio 3.0(>=) in menu bar go to help-> keymap Reference It will give all the shortcuts .. link

Manufactory answered 20/2, 2018 at 4:34 Comment(0)
P
0

Save all Control + S Command + S

Synchronize Control + Alt + Y Command + Option + Y

Maximize/minimize editor Control + Shift + F12 Control + Command + F12

Add to favorites Alt + Shift + F Option + Shift + F

Inspect current file with current profile Alt + Shift + I Option + Shift + I

Quick switch scheme Control + (backquote) Control + (backquote)

Open settings dialogue Control + Alt + S Command + , (comma)

Open project structure dialog Control + Alt + Shift + S Command + ; (semicolon)

Switch between tabs and tool window Control + Tab Control + Tab

Navigating and searching within Studio

Search everything (including code and menus) Press Shift twice Press Shift twice

Find Control + F Command + F

Find next F3 Command + G

Find previous Shift + F3 Command + Shift + G

Replace Control + R Command + R

Find action Control + Shift + A Command + Shift + A

Search by symbol name Control + Alt + Shift + N Command + Option + O

Find class Control + N Command + O

Find file (instead of class) Control + Shift + N Command + Shift + O

Find in path Control + Shift + F Command + Shift + F

Open file structure pop-up Control + F12 Command + F12

Navigate between open editor tabs Alt + Right/Left Arrow Control + Right/Left Arrow

Jump to source F4 / Control + Enter F4 / Command + Down Arrow

Open current editor tab in new window Shift + F4 Shift + F4

Recently opened files pop-up Control + E Command + E

Recently edited files pop-up Control + Shift + E Command + Shift + E

Go to last edit location Control + Shift + Backspace Command + Shift + Backspace

Close active editor tab Control + F4 Command + W

Return to editor window from a tool window Esc Esc

Hide active or last active tool window Shift + Esc Shift + Esc

Go to line Control + G Command + L

Open type hierarchy Control + H Control + H

Open method hierarchy Control + Shift + H Command + Shift + H

Open call hierarchy Control + Alt + H Control + Option + H

Writing code

Generate code (getters, setters, constructors, hashCode/equals, toString, new file, new class) Alt + Insert Command + N

Override methods Control + O Control + O

Implement methods Control + I Control + I

Surround with (if...else / try...catch / etc.) Control + Alt + T Command + Option + T

Delete line at caret Control + Y Command + Backspace

Collapse/expand current code block Control + minus/plus Command + minus/plus Collapse/expand all code blocks Control + Shift + minus/plus Command + Shift +

minus/plus

Duplicate current line or selection Control + D Command + D

Basic code completion Control + Space Control + Space

Smart code completion (filters the list of methods and variables by expected type)
Control + Shift + Space Control + Shift + Space

Complete statement Control + Shift + Enter Command + Shift + Enter

Quick documentation lookup Control + Q Control + J

Show parameters for selected method Control + P Command + P

Go to declaration (directly) Control + B or Control + Click Command + B or Command + Click

Go to implementations Control + Alt + B Command + Alt + B

Go to super-method/super-class Control + U Command + U

Open quick definition lookup Control + Shift + I Command + Y

Toggle project tool window visibility Alt + 1 Command + 1

Toggle bookmark F11 F3

Toggle bookmark with mnemonic Control + F11 Option + F3

Comment/uncomment with line comment Control + / Command + /

Comment/uncomment with block comment Control + Shift + / Command + Shift + /

Select successively increasing code blocks Control + W Option + Up

Decrease current selection to previous state Control + Shift + W Option + Down

Move to code block start Control + [ Option + Command + [

Move to code block end Control + ] Option + Command + ]

Select to the code block start Control + Shift + [ Option + Command + Shift + [

Select to the code block end Control + Shift + ] Option + Command + Shift + ]

Delete to end of word Control + Delete Option + Delete

Delete to start of word Control + Backspace Option + Backspace

Optimize imports Control + Alt + O Control + Option + O

Project quick fix (show intention actions and quick fixes) Alt + Enter Option + Enter

Reformat code Control + Alt + L Command + Option + L

Auto-indent lines Control + Alt + I Control + Option + I

Indent/unindent lines Tab/Shift + Tab Tab/Shift + Tab

Smart line join Control + Shift + J Control + Shift + J

Smart line split Control + Enter Command + Enter

Start new line Shift + Enter Shift + Enter

Next/previous highlighted error F2 / Shift + F2 F2 / Shift + F2

Build and run

Build Control + F9 Command + F9

Build and run Shift + F10 Control + R

Apply changes (with Instant Run) Control + F10 Control + Command + R

Debugging

Debug Shift + F9 Control + D

Step over F8 F8

Step into F7 F7

Smart step into Shift + F7 Shift + F7

Step out Shift + F8 Shift + F8

Run to cursor Alt + F9 Option + F9

Evaluate expression Alt + F8 Option + F8

Resume program F9 Command + Option + R

Toggle breakpoint Control + F8 Command + F8

View breakpoints Control + Shift + F8 Command + Shift + F8

Refactoring

Copy F5 F5

Move F6 F6

Safe delete Alt + Delete Command + Delete

Rename Shift + F6 Shift + F6

Change signature Control + F6 Command + F6

Inline Control + Alt + N Command + Option + N

Extract method Control + Alt + M Command + Option + M

Extract variable Control + Alt + V Command + Option + V

Extract field Control + Alt + F Command + Option + F

Extract constant Control + Alt + C Command + Option + C

Extract parameter Control + Alt + P Command + Option + P

Version control / local history

Commit project to VCS Control + K Command + K

Update project from VCS Control + T Command + T

View recent changes Alt + Shift + C Option + Shift + C

Open VCS popup Alt + ` (backquote) Control + V

Purport answered 20/6, 2018 at 10:31 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.