1. Install Nodejs plug-in
The official website (http://www.nodejs.org/) is inaccessible in China and can be downloaded and installed via (http://nodejs.cn/).
After installation at the command Terminal input: Node-v to see if the installation was successful
When the installation succeeds, the version information appears, and my Nodejs version is as follows:
2. Installation of Cordova and Ionic environment
1), install Cordova
sudo npm install-g Cordova
2), install Ionic
sudo npm install-g Ionic
3), note that when installing Cordova or ionic may be unable to install because of network problems, the workaround is as follows:
A. Through the Config command
Registry https://
Info underscore (if configured correctly this command will have string response)
B. Command-line designation
NPM--registry https://registry.npm.taobao.org Info underscore
C. Edit ~/.NPMRC Add the following:
Registry = https://registry.npm.taobao.org
After completion, you can view ionic information, enter ionic info
3. Create a project
Now, we need to create a new project using Cordova:
ionic start myApp blank
A command that runs in the folder directory named Todo is created. Next, we will enter the directory:
cd myApp
4. Configuration Platform
Now we need to tell Ionic that we want to make iOS and Android platforms. Note: Unless you are on Mac OS, do not use the iOS platform:
ionic platform ios (如果用的是Mac OS 创建工程的时候会默认添加ios 所以这步可以忽略)ionic platform android
5. Build and run the project
ionic build iosionic emulate ios
若在“ionic build ios”时候出现xcode-select: error:错误提示,
Xcodebuild can't find the original Xcode.
Workaround: Enter the command in the terminal
Xcode-select-switch the new Xcode path
For example: sudo xcode-select--switch/applications/xcode.beat.app/contents/developer/
If you get an error when "Ionic emulate iOS", you'll need to install the iOS emulator
sudo npm install -g ios-sim
This is the perfect solution!!!
The next step is to run:
Ionic run (you can see the effect on the simulator)
If you need browser debugging, you can:
Ionic serve
Ionic Mac OS Environment configuration