1。
bogon:~ hanxia$ android
-bash: android: command not found
2。查看环境变量
vim ~/.bash_profile
发现没有andorid的,
插入:
export ANDROID_HOME=D:javaandroid-sdk
export PATH=$ANDROID_HOMEtools:$PATH
export PATH=$ANDROID_HOMEplatform-tools:$PATH
保存退出,
echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/apache-maven-3.6.1/bin:/usr/local/mysql/bin:/Users/hanxia/.npm-global/bin
发现,还是没有
是因为没有source
于是,source一下,成功
bogon:~ hanxia$ source ~/.bash_profile
bogon:~ hanxia$ source ~/.bash_profile
bogon:~ hanxia$ echo $PATH
/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/apache-maven-3.6.1/bin:/usr/local/mysql/bin:/Users/hanxia/.npm-global/bin:/Users/hanxia/Library/Android/sdk/tools:/Users/hanxia/Library/Android/sdk/platform-tools
bogon:~ hanxia$ android
*************************************************************************
The "android" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
*************************************************************************
Invalid or unsupported command ""
Supported commands are:
android list target
android list avd
android list device
android create avd
android move avd
android delete avd
android list sdk
从以下文档获得了帮助,感谢博主!
android: command not foundstackoverflow.com![ed10b745a5dbe7356523b40371b1f929.png](https://i-blog.csdnimg.cn/blog_migrate/6191a026f47e0641634fcbc2baf25c2a.png)