macos nodejs开发及打包 iphone app环境,涉及brewvscodenodejscordovapm2jdk8gradle

Posted 博客园you

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了macos nodejs开发及打包 iphone app环境,涉及brewvscodenodejscordovapm2jdk8gradle相关的知识,希望对你有一定的参考价值。

============================================================================================
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 ’
安装依赖
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环境,涉及brewvscodenodejscordovapm2jdk8gradle的主要内容,如果未能解决你的问题,请参考以下文章

MacOS Docker安装

Ionic环境配置及android打包

Mac10.6操作系统下怎样将xcoder开发的程序打包为ipa安装到iphone OS3.13上?(免证书真机联调)(还可加分)

NW.js 简介与使用

linux服务器node打包失败

jenkins 之 iOS 打包及上传至蒲公英