Mac开发使用相关

文|Seraph

01 | brew

一、 替换/还原brew相关仓库
  1. 替换 / 还原 brew.git 仓库地址
cd "$(brew --repo)"
git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git  #阿里仓库地址
git remote set-url origin https://mirrors.ustc.edu.cn/brew.git #中科大
git remote set-url origin https://github.com/Homebrew/brew.git  #原仓库地址
  1. 替换 / 还原 homebrew-core.git 仓库地址
cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core"
git remote set-url origin https://mirrors.aliyun.com/homebrew/homebrew-core.git #阿里
git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git  #中科大
git remote set-url origin https://github.com/Homebrew/homebrew-core.git

  1. 替换 / 还原 homebrew-bottles 访问地址
# bash终端
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile #阿里 
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.ustc.edu.cn/homebrew-bottles' >> ~/.bash_profile  #中科大
source ~/.bash_profile
二、brew问题解决
  1. brew install过程中提示Error: Permission denied @ apply2files - /usr/local/lib/docker/cli-plugins
    解决:输入sudo chown -R $(whoami) $(brew --prefix)/*

  2. 安装homebrew时报错:

==> Downloading and installing Homebrew...
HEAD is now at 7fd508580 Merge pull request #12564 from Homebrew/dependabot/bundler/Library/Homebrew/sorbet-0.5.9452
error: Not a valid ref: refs/remotes/origin/master
fatal: ambiguous argument 'refs/remotes/origin/master': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

解决:先卸载homebrew,再重新安装。

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/uninstall.sh)"
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. brew install Error: No available formula with the name “xxx”
    解决:更新home-brew-core
rm -rf /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core
brew update

02 | Xcode

一、xcodebuild
  1. 报错:xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Deve
    解决:使用sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer/命令切换到xcode环境下。
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值