美文网首页我爱编程
mac下android环境配置中踩过的那些坑

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

作者: 简书Boss | 来源:发表于2018-05-25 16:48 被阅读0次

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文件

隐藏内容无权查看哈


相关文章

网友评论

    本文标题:mac下android环境配置中踩过的那些坑

    本文链接:https://www.haomeiwen.com/subject/qlxujftx.html