简体   繁体   中英

How to search all files for a string in Android Studio?

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

You can do it in two ways,

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

在此处输入图片说明

Or use the shortcut,

ctrl+shift+f

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

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

菜单栏->编辑->查找->在路径中查找...

按两次 Shift 按钮并在搜索框中输入它将在整个 Android Studio 中搜索。

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. 在此处输入图片说明

在 Android Studio 4.1 更新中,Mac 用户的组合发生了变化,现在您应该使用Control + Shift + f

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM