71

I'm posting a quick reference for "How can I show line numbers in Android Studio?" See answer below.

NOTE: This question has been marked as a duplicate because Android Studio is based on IntelliJ. In future, if you have a similar question, it's probably worth looking for the IntelliJ setting.

JsAndDotNet
  • 16,260
  • 18
  • 100
  • 123
  • 1
    @Sumurai8. As an Android newbie, I had forgotten Android Studio is based on IntelliJ. I didn't think to look for IntelliJ settings and googled for Android studio. Very little was returned. I will keep the post here to help other newbies and have updated the question with a note to point others in the right direction for similar queries. Thanks – JsAndDotNet May 10 '15 at 07:55

3 Answers3

199

In Windows

1.Press Ctrl+Shift+A

enter image description here 2.Input following string: "show line numbers"

enter image description here And you will see the setting, this method can find all the settings easily!

MAC

1.Press Command+Shift+A 2.Input following string: "show line numbers"

and following same flow of android studio.

einverne
  • 6,454
  • 6
  • 45
  • 91
codezjx
  • 9,012
  • 5
  • 47
  • 57
44

It's simple. Just Right click in left side of Workspace area and choose Show line number.

enter image description here

Yuva Raj
  • 3,881
  • 1
  • 19
  • 30
  • 3
    This shows the line numbers. But only for the current file. If you need to show it to all files, then you should use @HockeyJ's solution below! – Ruchira Randana Jun 22 '16 at 12:20
38
  1. Go to File > Settings
  2. In the dialog, select 'Editor', then the sub-option for 'General', and then the sub-option for 'Appearance'.
  3. Select 'Show line numbers' as shown below.
  4. Click Ok.

enter image description here

Source

UPDATE The location for this setting has been changed to Editor -> General -> Appearance.

ban-geoengineering
  • 18,324
  • 27
  • 171
  • 253
JsAndDotNet
  • 16,260
  • 18
  • 100
  • 123