37

In Android Studio (IntelliJ) how do you execute a 'File Search' for a string within a Scope of files? Can Search Everywhere do this, I only see how to use it to search 'code', not 'files'

Example: Search for the string "Dummy Button" in the 'Workspace Scope'.

Expected Response: res/values/string.xml:line4

J-Dizzle
  • 4,861
  • 4
  • 40
  • 50

7 Answers7

73

You can do it in two ways,

Goto Menu -> Edit -> Find -> Find in Path

enter image description here

Or use the shortcut,

ctrl+shift+f

Sajeetharan
  • 216,225
  • 63
  • 350
  • 396
  • 1
    I am well aware of Find in Path, but I struggle when trying to find something, a class name for example, within the dependencies of my project (generally things I see in "External Libraries" portion of the file list). Any tips for making that work? An example would be search for "FirebaseAuthException" in a project which includes firebase-auth-interop, which contains a class named FirebaseAuthException. – TahoeWolverine Jun 12 '19 at 14:29
  • If you want to export the results into a text file please see here : https://stackoverflow.com/a/61691027/3904109 – DragonFire May 09 '20 at 05:10
  • Is there a way to `add search path` to existing search path? – zionpi Aug 25 '22 at 06:08
18

In Android Studio,

  1. On a Windows or Linux based machine use shortcut Ctrl + Shift + F to search any string in whole project. It's easy to remember considering Ctrl + F is used to search in the current file. So just press the Shift as well.

  2. On OSX use the Command key instead of Ctrl.

  3. Use Ctrl + F combination for Windows and Linux to search in current file.

  4. Use Shift + Shift (Double Tap Shift) combination for Windows and Linux to search Project File of Project.

  5. Command+Shift+F on Mac to find in path

Developer Guy
  • 2,318
  • 6
  • 19
  • 37
Karan sharma
  • 1,511
  • 1
  • 13
  • 37
11

In Android Studio 4.1 update, the combination for Mac users changed, now you should use Control + Shift + f.

Gianluca Veschi
  • 1,239
  • 1
  • 14
  • 20
rockar06
  • 454
  • 3
  • 14
  • 1
    In Android 4.1.3 the combination for Mac users is slightly different: `Control` + `Shift` + `f`. – Nahuel Roldan Apr 06 '21 at 18:15
  • The same is true for replacements, which for one file is `Cmd`+`R` but for "in files" it's `Ctrl`+`Shift`+`R`. Completely unintuitive, luckily one can use BetterTouchTool or similar tools to add a custom keyboard shortcut to translate the `Cmd` variant into the other. – Sahbi Jul 23 '22 at 15:43
10

Try this. Enter your string name in dialogue box after pressing ctrl+shift+f

Mohammad Tauqir
  • 1,817
  • 1
  • 18
  • 53
  • 1
    if you had any idea how happy the speed and clarity have now made my Saturday AM. THANK YOU!!!! :) – J-Dizzle Sep 12 '15 at 15:44
8

Menu Bar->Edit->Find->Find in Path...

J-Dizzle
  • 4,861
  • 4
  • 40
  • 50
7

Press Two times Shift button and write in search box it will search in whole Android studio.

Raj Turakhia
  • 245
  • 2
  • 8
  • please accept my answer so also help to other developer – Raj Turakhia Sep 12 '15 at 16:04
  • 6
    please remove this option, this is for 'Search Everywhere', which does not allow you to 'search files'! Or alternatively please show how to achieve the 'Expected Response' above. I just tried your methodology and came up empty – J-Dizzle Sep 13 '15 at 16:51
5

In my case, I accidentally checked the box of "File mask". So all xml files are not searchable in Find in Path. Maybe this can help you. enter image description here

Wu Yuan Chun
  • 1,116
  • 11
  • 11