Search all the occurrences of a string in the entire project in Android Studio

Android StudioSearchIntellij Idea

Android Studio Problem Overview


I've just started using Android Studio (IntelliJ), and I now look for the feature to find the occurrence of a string in any of the files in my project. For example: I want to find all the files that contain the string ".getUuid()"

The search at the top right doesn't give me the correct results, and I don't think I can find this feature under Edit > Find.

Could anybody point me at the right direction?

Android Studio Solutions


Solution 1 - Android Studio

TLDR: ⌃⇧F on MacOS will open "Find in path" dialog.

First of all, this IDEA has a nice "Find Usages" command. It can be found in the context menu, when the cursor is on some field, method, etc.

It's context-aware, and as far as I know, is the best way to find class, method or field usage.

Alternatively, you can use the

> Edit > Find > Find in path…

dialog, which allows you to search the whole workspace.

Also in IDEA 13 there is an awesome "Search Everywhere" option, by default called by double Shift. It allows you to search in project, files, classes, settings, and so on.

Also you can search from Project Structure dialog with "Find in Path…". Just call it by right mouse button on concrete directory and the search will be scoped, only inside that directory and it's sub-directory.

Enjoy!

Solution 2 - Android Studio

In Android Studio on a Windows, macOS 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.

Solution 3 - Android Studio

Press Shift twice and a Search Everywhere dialog will appear.

Solution 4 - Android Studio

Use Ctrl + Shift + F combination for Windows and Linux to search everywhere, it shows preview also.

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

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

Solution 5 - Android Studio

You can open the Find in Path dialog by pressing:

Ctrl + Shift + F

Solution 6 - Android Studio

Android Studio 3.3 seems to have changed the shortcut to search for all references (find in path) on macOS.

In order to do that you should use Ctrl + Shift + F now (instead of Command + Shift + F as wrote on the previous answers):

UPDATE

To replace in path just use Ctrl + Shift + R.

enter image description here

Solution 7 - Android Studio

Android Studio Version 4.0.1 on Mac combination is for me:

Shift + Control + F

Solution 8 - Android Studio

And for all of us who use Eclipse keymaps the shortcut is Ctrl+H. Expect limited options compared to eclipse or you will be disappointed.

Solution 9 - Android Studio

In Android Studio on a Windows or Linux based machine use shortcut Ctrl + Shift + R to search and replace any string in the whole project.

Solution 10 - Android Studio

What you want to reach is that, I believe:

  • cmd + O for classes.
  • cmd + shift + O for files.
  • cmd + alt + O for symbols. "wonderful shortcut!"

Besides shift + cmd + f for find in path && double shift to search anywhere. Play with those and you will know what satisfy your need.

Solution 11 - Android Studio

use ctrl + shift + f on windows

Solution 12 - Android Studio

Press SHIFT 2 times and you can search Every-where , both Class and Method() in the project.

Ctrl + N for finding only Class name.

Ctrl + E for Recent Files.

Solution 13 - Android Studio

Use Ctrl + Alt + F combination in Ubuntu.

Solution 14 - Android Studio

On a mac use shift + cmmd + f

To get rid of the screen press esc

I use IntelliJ IDEA version: 2019.2.3 (Community Edition) Build #IC-192.6817.14, built on September 24, 2019 Runtime version: 11.0.4+10-b304.69 x86_64

Solution 15 - Android Studio

In Android 3.6 on a Mac if you want to export the results to a text file then do the following

Command+Shift+F then enter the text you want to search

Then on Bottom Right click on "Open In Find Window"

Then Right Click On Found Occurrences

Then Export To Text File

Once in text file you can find and replace to remove, sort lines etc... please see screenshots for assistance.

enter image description here

enter image description here

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
Questionkramer65View Question on Stackoverflow
Solution 1 - Android StudioSeagullView Answer on Stackoverflow
Solution 2 - Android StudioJakub MichalkoView Answer on Stackoverflow
Solution 3 - Android StudionickView Answer on Stackoverflow
Solution 4 - Android StudioJitesh PrajapatiView Answer on Stackoverflow
Solution 5 - Android StudioWilli MentzelView Answer on Stackoverflow
Solution 6 - Android StudioFilipe BritoView Answer on Stackoverflow
Solution 7 - Android StudioEntertainView Answer on Stackoverflow
Solution 8 - Android StudioJanPlView Answer on Stackoverflow
Solution 9 - Android StudioMadhan MView Answer on Stackoverflow
Solution 10 - Android StudioaselimsView Answer on Stackoverflow
Solution 11 - Android StudioQuadri IsmailView Answer on Stackoverflow
Solution 12 - Android StudiorhaldarView Answer on Stackoverflow
Solution 13 - Android StudioOzgurView Answer on Stackoverflow
Solution 14 - Android StudioLance SamariaView Answer on Stackoverflow
Solution 15 - Android StudioDragonFireView Answer on Stackoverflow