In Android Studio, launch AVD Manager, I choose one of my virtual device and click Play button to start it.
Then I get this error message
"Cannot launch AVD in emulator.
sh: file: command not found
sh: grep: command not found
echo 'export PATH=/Users/xxx/Library/Android/sdk/tools' >> ~/.bash_profile
echo 'export PATH=/Users/xxx/Library/Android/sdk/platform-tools' >> ~/.bash_profile
You are setting your path wrong. In fact you are just replacing it. What you need to do is to add to path. Like this:
echo 'export PATH=$PATH:/Users/xxx/Library/Android/sdk/platform-tools' >> ~/.bash_profile
Be sure to view ~/.bash_profile in editor and remove previous PATH entries.
Note the added $PATH. This way it takes the previous path and appends the new one.