title: Cannot launch AVD in emulator. sh: grep: command not found
body: <p>In Android Studio, launch AVD Manager, I choose one of my virtual device and click Play button to start it. </p>
  
  <p>Then I get this error message 
  <code>"Cannot launch AVD in emulator. 
  sh: file: command not found 
  sh: grep: command not found
   ... "</code></p>
  
  <p>It's fine all the while and I think I mess up with the PATH variable by running the following command. </p>
  
  <pre><code>echo 'export PATH=/Users/xxx/Library/Android/sdk/tools' &gt;&gt; ~/.bash_profile
  echo 'export PATH=/Users/xxx/Library/Android/sdk/platform-tools' &gt;&gt; ~/.bash_profile
  </code></pre>
  
  <p>After executing these, I couldn't find simple command like <code>ls</code> in Terminal too. 
  Then I fixed it by running</p>
  
  <pre><code>PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/X11/bin
  </code></pre>
  
  <p>After that, <code>ls</code>, <code>grep</code> etc are working fine again. 
  I check it in the Terminal windows, it is showing the same error before, running the above command fixed it. </p>
  
  <p>However, when I try to launch AVD, it still failed with the error message above. 
  Try to restart, invalidate cahce, nothing help. </p>