开启显示隐藏文件:
defaults write com.apple.finder AppleShowAllFiles -bool TRUE
关闭显示隐藏文件:
defaults write com.apple.finder AppleShowAllFiles -bool FALSE
brew
brew update
brew uninstall --ignore-dependencies libimobiledevice
brew uninstall --ignore-dependencies usbmuxd
brew install --HEAD usbmuxd
brew unlink usbmuxd
brew link usbmuxd
brew install --HEAD libimobiledevice
brew install ideviceinstaller
brew update
brew install --HEAD libimobiledevice
brew install ideviceinstaller ios-deploy cocoapods
pod setup
brew doctor
# 替换成阿里巴巴的 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
# 替换成阿里巴巴的 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
echo $SHELL
# 如果你的输出结果是 /bin/zsh,参考下方的 zsh 终端操作方式
# 如果你的输出结果是 /bin/bash,参考下方的 bash 终端操作方式
#/bin/bash
# 替换成阿里巴巴的 homebrew-bottles 访问地址:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.zshrc
source ~/.zshrc
#=======================================================
# 还原为官方提供的 homebrew-bottles 访问地址
vi ~/.zshrc
# 然后,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置
source ~/.zshrc
# 替换 homebrew-bottles 访问 URL:
echo 'export HOMEBREW_BOTTLE_DOMAIN=https://mirrors.aliyun.com/homebrew/homebrew-bottles' >> ~/.bash_profile
source ~/.bash_profile
#=======================================================
# 还原为官方提供的 homebrew-bottles 访问地址
vi ~/.bash_profile
# 然后,删除 HOMEBREW_BOTTLE_DOMAIN 这一行配置
source ~/.bash_profile
RVM
curl -L get.rvm.io | bash -s stable
source ~/.bashrc
source ~/.bash_profile
rvm -v
rvm list known
rvm install 2.7
command line tools
sudo xcode-select --switch /Library/Developer/CommandLineTools/
git
ruby
ruby -v
gem
// 删除镜像
gem sources --remove https://gems.ruby-china.org/
// 添加镜像
gem sources -a https://gems.ruby-china.com/
// 查看镜像
gem sources -l
// 更新gem
sudo gem update --system
cocoa pods
sudo gem install cocoa pods
sudo gem install cocoapods --pre
chmod
sudo chmod go-w /usr/local/bin
sudo chmod 775 /usr/local
gradlew常用命令
./gradlew -v 版本号
./gradlew clean 清除工程目录下的build文件夹
./gradlew build 检查依赖并编译打包
这里注意的是 gradlew build 命令把debug、release环境的包都打出来。
./gradlew assembleDebug 编译并打Debug包
./gradlew assembleRelease 编译并打Release的包
打渠道包(如百度)
./gradlew assembleBaiduRelease 编译并打Release的百度包
除此之外,assemble还可以和productFlavors结合使用,比如定义了 installRelease ,uninstallRelease 两个productFlavors,则可以如下命令:
./gradlew installRelease Release 模式打包并安装
./gradlew uninstallRelease 卸载Release模式包
需要说明的是这些命令可以叠加使用,例如:
./gradlew clean build --info > bugtags.log
./gradlew uninstallDebug installDebug
网友评论