mac下android环境配置中踩过的那些坑

zsh: command not found: adb

首先确保你已经在bash的 .bash_profile 配置相关android tool的环境变量了,从而才能使用adb命令

其次在使用zsh shell的时候,需要把相关的环境变量的配置设置到 .zshrc 中(功能上类似bash 的.bash_profile)具体操作如下

解决办法

既然是.zshrc 没有配置相关环境变量设置,把 bash 中.bash_profile 全部环境变量加入就好

open .zshrc

然后找到# User configuration部分,添加

 source ~/.bash_profile

执行

 source .zshrc

注意不是执行source ~/.zshrc这个命令,刚开始时我是执行的这条命令依然是不行的,后来执行了上面👆的source .zshrc这条命令,终于皇天不负有心人,成功了


Could not install the app on the device, read the error above for details.

image.png

cyprusglobe commented on 19 Jul 2016

you might check the permissions on android/gradlew
they should be 755 not 644

run chmod 755 android/gradlew inside your app root folder
then run react-native run-android

and it should work again.
image.png

用终端在项目根目录下

run chmod 755 android/gradlew 
然后就可以跑起项目了哈
run react-native run-android

还有一点是需要在项目android文件夹下配置android sdk的路径

在项目下的android文件夹下新建local.properties文件
在文件里引入android sdk 的路径
android文件夹下新建local.properties文件

隐藏内容无权查看哈


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容