1

When using react native cli to convert the Hermes tracing profile to chrome tracing profile and pull it to local machine using the command

npx react-native profile-hermes [destinationDir]

Am getting the error like this. I am using Windows 10 and react native version 0.66

'grep' is not recognized as an internal or external command, operable program or batch file. error Error: Command failed: adb shell run-as com.madhusona ls cache/ -tp | grep -v /$ | grep -E '.cpuprofile' | head -1

I issued the command after login to adb shell, grep is working

D:\madhusona> adb shell
generic_x86:/ $ run-as com.madhusona
generic_x86:/data/user/0/com.madhusona $ ls cache/ -tp | grep -v /$ | grep -E '.cpuprofile' | head -1
sampling-profiler-trace767276177515590089.cpuprofile
generic_x86:/data/user/0/com.madhusona $
Madusudhanan
  • 339
  • 2
  • 14

1 Answers1

1

I might have found a related Question that partially (or totally, I'm not sure) explain your problem.

I know you found a way to get around it but it still might be helpful for you or for other ;)

https://stackoverflow.com/a/40983617/8687881

EDIT:

I figure it out using git bash. It is bundled with a number of POSIX (UNIX/Linux/etc.) utilities, such as grep. Because grep is not a Windows function, you will not be able to easily replace grep (then 'head' function) for Windows.

JB Lecoin
  • 21
  • 3
  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/32982569) – Iva Oct 25 '22 at 06:56