============================================================================================
appstore 安装 xcode
============================================================================================
安装 brew
在https://www.ipaddress.com/ 上查询 raw.githubusercontent.com 的IP,并添加么/etc/hosts中
sudo vi /etc/hosts
添加以下内容
199.232.68.133 raw.githubusercontent.com
安装 brew 执行
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
如果卡在 Cloning into ‘/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core‘
执行以下命令
手动执行下面这句命令,更换为中科院的镜像:
git clone git://mirrors.ustc.edu.cn/homebrew-core.git/ /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core --depth=1
brew -v
============================================================================================
安装 node及相关包
brew install -g node
node -v
npm -v
sudo npm install -g pm2
pm2 -v
sudo npm install yarn -g
sudo yarn -v
sudo npm install -g cordova
cordova -v
============================================================================================
安装java https://www.oracle.com/java/technologies/javase-jdk8-downloads.html 下载 jdk-8u251-macosx-x64.dmg
双击安装
java –version
安装gradle
brew install -g gradle
gradle -v
============================================================================================
下载vscode code.visualstudio.com
sudo yarn install
sudo yarn build
sudo yarn cordova-build
cd cordova-app
sudo cordova build ios
#sudo cordova platform rm ios
#sudo cordova platform add ios
#sudo cordova build ios
#cordova requirements
#cordova platform add ios
#cordova run ios
#https://cordova.apache.org/#getstarted
#http://cordova.axuer.com/
#http://cordova.axuer.com/docs/zh-cn/latest/guide/cli/index.html
cordova run ios 报 CordovaError: Promise rejected with non-error: ‘xcode-select: error: tool \’xcodebuild\’ requires Xcode, but active developer directory \’/Library/Developer/CommandLineTools\’ is a command line tools instance\n’
安装依赖
brew install ios-deploy
设置Actiove developer directory
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
cordova build ios 报如下错误
CompileSwift normal x86_64 /Users/dnj/ziyo-app-feature-locales/cordova-app/platforms/ios/ZIYO/Plugins/cordova-plugin-qrscanner/QRScanner.swift
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler
yarn build
执行
cordova plugin add cordova-plugin-qrscanner
sudo npm audit fix
sudo npm audit fix --force
macos nodejs开发及打包 iphone app环境,涉及brew、vscode、nodejs、cordova、pm2、jdk8、gradle