felix-cao / Blog

A little progress a day makes you a big success!
31 stars 4 forks source link

Mac 命令行翻墙 #81

Open felix-cao opened 5 years ago

felix-cao commented 5 years ago

在处理 react-native 开发进行Xcode打包时,出现 Error installing FBAudienceNetwork 错误,根据错误提示,我们应该清楚命令行也是要翻墙的,本文旨在处理 Mac 电脑下的命令行翻墙!代理、翻墙的原理介绍 请移步 Shadowsocks与git的代理设置

确定命令行端口

curl 命令行翻墙配置

vi ~/.bash_profile
# my proxy
alias proxy='export http_proxy=127.0.0.1:1081;export https_proxy=$http_proxy' 
alias proxyOff='unset http_proxy;unset https_proxy'

配置生效

$ source ~/.bash_profile
$ proxy
$ echo $http_proxy
$ curl -I https://google.com

配置 Git 代理

查看代理命令

git config --global --list
或
git config --global http.proxy
git config --global https.proxy

设置代理

git config --global http.proxy http://127.0.0.1:1081
git config --global https.proxy https://127.0.0.1:1081
# 或(带用户密码)
git config --global http.proxy http://user:password@proxyhost:port
git config --global https.proxy https://user:password@proxyhost:port

取消代理

git config --global --unset http.proxy
git config --global --unset https.proxy

配置 npm 代理

npm config set proxy http://localhost:8080/
npm config set https-proxy http://localhost:8080/
npm config set strict-ssl false

取消代理

npm config delete proxy
npm config delete https-proxy

Reference

317482454 commented 5 years ago

头疼的问题,我已经尝试了,还是无法正确下载,使用openvpn也是一样的

felix-cao commented 5 years ago

头疼的问题,我已经尝试了,还是无法正确下载,使用openvpn也是一样的

提示什么?

psygames commented 4 years ago

因为 .bash_profile 只对当前终端有效,如果是程序调用终端则proxy并不会生效。建议在.bashrc 文件下配置:proxy (启动)

psygames commented 4 years ago

Unity环境下,即使配置.bashrc 仍然不能下载某些 cocoapods 源,比如facebook,建议使用vpn,或者关闭iOS Resolver gen podfiles,然后修改facebook 源(~/.cocoapods/repos/Specs/2/1/5/FBAduienceNetwork/x.x.x/podspec.json) source 改为 git:l本地地址(仅针对Unity)

GITHUB243884919 commented 4 years ago

在处理 react-native 开发进行Xcode打包时,出现 Error installing FBAudienceNetwork 错误,根据错误提示,我们应该清楚命令行也是要翻墙的,本文旨在处理 Mac 电脑下的命令行翻墙!代理、翻墙的原理介绍 请移步 Shadowsocks与git的代理设置

确定命令行端口

curl 命令行翻墙配置

vi ~/.bash_profile
# my proxy
alias proxy='export http_proxy=127.0.0.1:1081;export https_proxy=$http_proxy' 
alias proxyOff='unset http_proxy;unset https_proxy'

配置生效

$ source ~/.bash_profile
$ proxy
$ echo $http_proxy
$ curl -I https://google.com

配置 Git 代理

查看代理命令

git config --global --list
或
git config --global http.proxy
git config --global https.proxy

设置代理

git config --global http.proxy http://127.0.0.1:1081
git config --global https.proxy https://127.0.0.1:1081
# 或(带用户密码)
git config --global http.proxy http://user:password@proxyhost:port
git config --global https.proxy https://user:password@proxyhost:port

取消代理

git config --global --unset http.proxy
git config --global --unset https.proxy

Reference

请问第一个截图:确定命令行端口。mac里从哪里打开? 谢谢~ 遇到同样的问题,也是用暗影翻墙,

top-comengineer commented 11 months ago

Hello. @felix-cao . I read your post carefully. I face the same error that you posted in the past. https://github.com/expo/expo/issues/2392 Please help me. image