美文网首页
mac电脑搭建Appium环境遇到的那些坑

mac电脑搭建Appium环境遇到的那些坑

作者: 菜鸟来到请多指教 | 来源:发表于2020-07-28 15:11 被阅读0次

以下仅是我安装的时候踩到的一些坑,仅供参考:

一.安装homebrew提示Failed to connect to raw.githubusercontent.com port 443: Connection refused的几种解决方式 

      转载链接:https://www.jianshu.com/p/c2e829027b0a

    方法1.修改host文件

        首先打开网站https://www.ipaddress.com/

        查询一下raw.githubusercontent.com对应的IP 地址

2.替换系统的host文件

注意:最好复制一份出来在更改

然后执行安装

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

解释一下: 这一行/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"命令,其实是 安装Homebrew的命令,官网地址大家可以自行查看。

   方法2   命令

执行命令   sudo gem install redis

执行          /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)

方法3 翻墙

   方法4  brew_install.rb文件

brew_install.rb文件,就是前面说的,打不开的网址,就是这个网址https://raw.githubusercontent.com/Homebrew/install/master/install,对应的内容就是brew_install.rb

百度云下载,提取码: 4eti

如果下载成功就后,

1.进入 存放brew_install.rb的目录中,

2.执行ruby brew_install.rb,根据提示 安装就行了

注意: 如果在桌面摸个文件夹内,使用ls查看目录。一般会存在桌面cd Desktop

以上我用第一个方法就可以了,大家可尝试一下

二.安装homebrew失败 出现 press return continue or any other ... git init -q

解决方法:

1.在命令行中输入  sudo chown -R $USER /usr/local

2.安装brew  /usr/bin/ruby -e "$(curl -fsSL             https://raw.githubusercontent.com/Homebrew/install/master/install)" 即可

三.brew install XXX出现下边的warning

     Error: You are using macOS 10.15.4

     We do not provide support for this pre-release version.You may encounter build failures    or other breakages.Please create pull-requests instead of filing issues.

    解决方法:

   先卸载Homebrew:

  /usr/bin/ruby -e "$(curl -fsSL   https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"

  再重新安装Homebrew:

  /usr/bin/ruby -e "$(curl -fsSL  https://raw.githubusercontent.com/Homebrew/install/master/install)"

之后再使用brew命令安装应该就可以了

四.brew install XXX 出现you have unlinked kegs in your cellar

解决方法:

按照他的提示  重新建立和软件之间的关联 如: brew link go

五.brew install xxx提示 the following directors are not writable by your user

解决方法:

按照他下边的提示命令,一步步输入就可以

六.brew install xxx时

                      homebrew长时间停留在Updaing Homebrew 这个步骤

     方法 1:按住 control + c 取消本次更新操作 ,之后他会自动执行真正需要安装的步骤了

     方法 2:使用 Alibaba 的 Homebrew 镜像源进行加速 

                    原文参考https://www.cnblogs.com/tulintao/p/11134877.html

                   平时我们执行 brew 命令安装软件的时候,跟以下 3 个仓库地址有关:

                   brew.git

                   homebrew-core.git

                   homebrew-bottles

通过以下操作将这 3 个仓库地址全部替换为 Alibaba 提供的地址

1. 替换 / 还原 brew.git 仓库地址

# 替换成阿里巴巴的 brew.git 仓库地址:cd"$(brew --repo)"git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git#=======================================================# 还原为官方提供的 brew.git 仓库地址cd"$(brew --repo)"git remote set-url origin https://github.com/Homebrew/brew.git

2. 替换 / 还原 homebrew-core.git 仓库地址

# 替换成阿里巴巴的 homebrew-core.git 仓库地址:cd"$(brew --repo)/Library/Taps/homebrew/homebrew-core"git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git#=======================================================# 还原为官方提供的 homebrew-core.git 仓库地址cd"$(brew --repo)/Library/Taps/homebrew/homebrew-core"git remote set-url origin https://github.com/Homebrew/homebrew-core.git

3. 替换 / 还原 homebrew-bottles 访问地址

这个步骤跟你的 macOS 系统使用的 shell 版本有关系

所以,先来查看当前使用的 shell 版本

echo$SHELL# 如果你的输出结果是 /bin/zsh,参考?的 zsh 终端操作方式# 如果你的输出结果是 /bin/bash,参考?的 bash 终端操作方式

3.1 zsh 终端操作方式

# 替换成阿里巴巴的 homebrew-bottles 访问地址:echo'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles'>> ~/.zshrcsource ~/.zshrc#=======================================================# 还原为官方提供的 homebrew-bottles 访问地址vi ~/.zshrc# 然后,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置source ~/.zshrc

3.2 bash 终端操作方式

# 替换 homebrew-bottles 访问 URL:echo'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles'>> ~/.bash_profilesource ~/.bash_profile#=======================================================# 还原为官方提供的 homebrew-bottles 访问地址vi ~/.bash_profile# 然后,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置source ~/.bash_profile

七.ios自动化构建出现xcode-select:error tool Xcodebuild requires Xcode...如下

解决方法如下

八.权限问题

解决方法:

直接在你要输入的命令前边加上sudo 如:sudo gem install xcpretty

相关文章

网友评论

      本文标题:mac电脑搭建Appium环境遇到的那些坑

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