mac下創建nativescript angular項目
阿新 • • 發佈:2018-08-16
con dep hat ocs ccf native new led bre 1 . set up your system
step 1: install node.js
step 2: install the nativescript cli
2.1
npm install -g nativescript
2.2 verify the nativescript cli
tns
step 3: install ios and android requirements
3.1 window
3.2 macos
3.2.1
ruby -e "$(curl -fsSL https://www.nativescript.org/setup/mac)"
3.2.2
Do you have Xcode installed? (y/n)
error:
xcode-select: error: tool ‘xcodebuild‘ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools‘ is a command line tools instance
Xcode is not installed or not configured properly. Download, install, set it up and run this script again.
執行一下命令,修改安裝的位置
sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
If you do not have Xcode installed, download and install it from App Store and run it once to complete its setup.
3.2.3
Allow the script to install Homebrew?
(Y)es/(N)o
3.2.4
Allow the script to install Google Chrome?
(Y)es/(N)o
You have chosen not to install Google Chrome. Some features of NativeScript may not work correctly if you haven‘t already installed it
3.2.5
Allow the script to install Java SE Development Kit 8?
(Y)es/(N)o
3.2.6
Allow the script to install Android SDK?
Note that if you type all you won‘t be prompted for subsequent installations
(Y)es/(N)o/(A)ll
3.2.7
Allow the script to install CocoaPods?
Note that if you type all you won‘t be prompted for subsequent installations
(Y)es/(N)o/(A)ll
(1) Install CocoaPods
sudo gem install cocoapods
(2) Setup CocoaPods
pod setup
CocoaPods是OS X和iOS下的一個第三類庫管理工具
3.2.8
Allow the script to install pip?
Note that if you type all you won‘t be prompted for subsequent installations
(Y)es/(N)o/(A)ll
https://pypi.python.org/simple/pip/
3.2.9
Allow the script to install six?
Note that if you type all you won‘t be prompted for subsequent installations
(Y)es/(N)o/(A)ll
‘six‘ python package
3.2.10
Allow the script to install xcodeproj?
Note that if you type all you won‘t be prompted for subsequent installations
(Y)es/(N)o/(A)ll
(1) Install
brew install xcproj
step 4: verify the set up
tns doctor
2 . basics of the nativescript command-line interface
step 1: creating apps
tns create HelloWorld --template tns-template-blank-ng
step 2: navigate into your new app’s folder
cd HelloWorld
step 3: running apps
3.1 ios
tns run ios
3.2 Android
tns run android
3 . nativescript advanced setup: macos
mac下創建nativescript angular項目