美文网首页
zsh: command not found: adb

zsh: command not found: adb

作者: Sophia_dd35 | 来源:发表于2021-09-03 11:25 被阅读0次

    一、背景

    最近一直被这个问题困扰着,每次重启终端都会出现这个问题,开始觉得是自己的环境配置错了,反复检查之后,发现环境变量没有配置错。反过来想如果环境变量没有配置错,那就是应该没有生效吧,于是又重新source .bash_profile了一下,竟然成了!于是每次重启终端都需要执行source .bash_profile....,这肯定不行呀,如果你也遇到此类问题可以参考如下解决方案。

    二、解决方法

    step1:进入用户根目录,使用如下命令
    cd /User/XXX  
    
    step2:检查用户根目录下是否有.zshrc文件,使用如下命令
    ls -a
    
    step3:如果没有就新建个.zshrc,使用如下命令
    touch .zshrc
    
    step4:打开.zshrc文件,使用如下命令
    open -e .zshrc
    
    step5:在.zshrc文件中添加如下内容,然后保存
    source .bash_profile
    
    step6:最后一步,在命令行执行如下命令
    source .bash_profile
    

    执行完上述步骤之后,就大功告成啦,下次再进入终端也不要手动执行source .bash_profile了。

    相关文章

      网友评论

          本文标题:zsh: command not found: adb

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