1.建立項目node
ionic start TallyBook blank 建立一個空的項目android
ionic cordova platform add android 添加andorid平臺ios
ionic serve 瀏覽器查看git
ionic cordova build android --prod --release 編譯apk 安裝運行typescript
備註:若是有問題找對應的腳本執行npm
npm config set registry https://registry.npm.taobao.org 代理設置json
modules 錯誤:瀏覽器
npm install rimraf -g app
rimraf node_modulesionic
npm clean cache
npm update
android update sdk --no-ui --filter android-26
2.建立項目目錄說明
node_modules:node 各種依賴包
platforms:項目添加的平臺 通常就android ios
plugins:項目中的插件
resources:資源文件 通常有啓動畫面 和圖標
src:項目代碼 app( 應用根目錄)、 assets(資源目錄)、 pages( 頁面文件)、 theme(主題文件)
www:靜態文件
.editorconfig:編輯器的配置文件
.gitignore:git 配置文件
config.xml:打包成 app 的配置文件
package.json:配置項目的元數據和管理項目所須要的依賴
tsconfig.json:typeScript 項目的根目錄,指定用來編譯這個項目的根文件和編譯選項
tslint.json:格式化和校驗 typescript
3.建立頁面和組件命令
ionic g page 頁面名稱
ionic g component 組件名稱
4.替換圖標和啓動頁
替換 icon.png 文件 替換 splash.png
在根目錄下面運行 ionic cordova resources andorid (須要登陸 ionic signup)