[Base] No.1 Ionic environment configuration

Node Installation

git clone https://github.com/nodejs/node
cd node
./configure
make
sudo make install
node -v
npm -v

 npm set up Taobao mirror

npm config set registry https://registry.npm.taobao.org
npm config set disturl https://npm.taobao.org/dist

IOS Simulator

sudo npm install -g ios-sim
sudo npm install -g ios-deploy
##如果失败用下面的命令
sudo npm install -g ios-deploy --unsafe-perm=true

Ionic basic environmental

npm install -g cordova ionic

Quick Start

ionic start myApp tabs  #初始化一个有tab的项目
cd myApp  
ionic platform add ios  # 添加ios 平台
ionic build ios  # build ios
ionic emulate ios  # 使用模拟器运行ios
ionic emulate ios --target iPhone-5s # 指定模拟器型号运行
ionic run ios # 使用真机运行IOS

Directory Structure

  • hooks after // google this directory should be a script command when compiling cordova customizable, easy to integrate into our build system and version control system

  • plugins // directory cordova plug-in, plug-in installation in detail in the next section

  • scss // scss file, when you publish output files in this directory to compile the css directory www

  • www // our development directory, page, style, script and pictures are placed in this directory

  • --css

  • --img

  • --js

  • --lib

  • --index.html

  • bower.json // bower profile

  • config.xml // Ionic profile ⱃ can configure the app id, name, description and together with the other configuration Home

  • gulpfile.js // gulp build executable files tool, create a task to achieve scss compiled in this document, css, js optimization

  • ionic.project // Ionic Ionic project file can be configured to monitor file command livereload

  • package.json // npm profile

High Command

View the current project supported platforms and ionic supported platforms

ionic platform list

Add Item support platform

ionic platform add ios/android

build project

ionic build ios/android
ionic build android -release  #发布正式版等待签名


Simulator to run the project

ionic  emulate  ios/android
ionic  emulate  ios/android --target iPhone-5s

Real machine running

ionic run ios --device
ionic run android

View project is mirrored

./platforms/ios/cordova/lib/list-emulator-image #ios
./platforms/android/cordova/lib/list-emulator-image #android

problem

Question one

Today I upgraded to 8 xcode, and then use the ionic-device debugging some errors, the following error

(lldb)     run

Traceback (most recent call last):
  File "/tmp/63F258A0-629C-48E0-894B-CF5B2803E750/fruitstrap_819e1be07f922f85816eb033fd16e5d9a81a10da.py", line 36, in run_command

    lldb.target.Launch(lldb.SBLaunchInfo(shlex.split(args[1] and args[1] or '')), error)
IndexError: list index out of range

(lldb)     safequit

Application has not been launched


Ios-deply upgrade to 1.8.7 above, it was 1.8.6


Reference material


Original Address: [] No.1 Ionic basis of environment configuration
label: Ionic    the Node    npm    cordova    ios    Android    Hybrid    ios the SIM-    ios-Deploy   

Intelligent Recommendation

Reproduced in: https: //my.oschina.net/54php/blog/757190

Guess you like

Origin blog.csdn.net/weixin_33743248/article/details/91518071