Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to search a file with adb.exe?

Tags:

android

adb

Unix/Linux contains "find" command for searching files, but I do not know which command in android can be used to search for a file. Please give me an example.

like image 883
Shaahin Ashayeri Avatar asked Jun 17 '13 13:06

Shaahin Ashayeri


People also ask

How do I search for a file in adb shell?

I used adb shell "ls -lR [ top-level-dir ]/[ varying number of */ ]/[ known part of filename ]> to find a glob pattern that matches the file, then started putting subdirs in the pattern - if the glob doesn't match, try the next subdir. It looked something like this: /lib/libSmth*.

How do I run adb EXE?

Open a command window in the folder by holding shift and right-clicking in an empty spot in the folder and selecting "Open command prompt/PowerShell here" in the menu. Then you can start using ADB — connect your phone and try . ADB devices to see if it's working. A list with attached devices should show up.


1 Answers

You may not find find and grep on all devices, so probably your safe bet is

   $ adb shell ls -lR | grep filename_you_want 

on Linux/OSX, or

   > adb shell ls -lR | find "filename_you_want" 

on Windows.

like image 68
Diego Torres Milano Avatar answered Sep 28 '22 18:09

Diego Torres Milano