http://www.jianshu.com/p/5df88764f024
http://www.jianshu.com/p/b9757a5bcb07
首先更新了JDK直接在原目錄安裝 在改一下 環境變量 即檢測成功。
安裝Android sdk 如圖 有顯示成功 有的安裝底高兩個版本:
安裝后 配置環境變量:
我的電腦 - 右鍵屬性 - 高級系統設置 - 環境變量
新建變量名 變量值
ANDROID_HOME D:\ionic\androidsdk(你sdk的路徑)
然后在path里添加(注意前面的分號)
;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools
執行android -h看到命令即安裝設置成功
2)執行androidsdk目錄下的SDK Manager.exe即可打開工具包(若打不開,請用管理員權限運行!);
最后用項目測試打包 apk 出現了報錯
1 For example, an unrecognized jvm option is used. 2 Please refer to the user guide chapter on the daemon at https://docs.gradle.org/ 3 2.14.1/userguide/gradle_daemon.html 4 Please read the following process output to find out more: 5 ----------------------- 6 Error occurred during initialization of VM 7 Could not reserve enough space for 2097152KB object heap 8 9 10 * Try: 11 Run with --stacktrace option to get the stack trace. Run with --info or --debug 12 option to get more log output. 13 14 Error: cmd: Command failed with exit code 1 Error output: 15 FAILURE: Build failed with an exception. 16 17 * What went wrong: 18 Unable to start the daemon process. 19 This problem might be caused by incorrect configuration of the daemon. 20 For example, an unrecognized jvm option is used. 21 Please refer to the user guide chapter on the daemon at https://docs.gradle.org/ 22 2.14.1/userguide/gradle_daemon.html 23 Please read the following process output to find out more: 24 ----------------------- 25 Error occurred during initialization of VM 26 Could not reserve enough space for 2097152KB object heap
解決辦法;
最后用個心項目 后 打包 在手機上運行成功。
常用命令:
npm install -g cnpm --registry=https://registry.npm.taobao.org(npm鏡像源指向淘寶)
cnpm install -g cordova ionic(安裝cordova ionic)
cnpm update -g cordova ionic(更新cordova ionic)
ionic -help(查看幫助)
ionic -v(查看版本)
ionic start myApp blank(空項目)
ionic start myApp tabs(帶導航條)
ionic start myApp sidemenu(帶側滑菜單)
ionic platform add android(添加android平台)
ionic platform remove android(移除android平台)
ionic build android(編譯項目apk)
ionic emulate android(運行項目apk 手機連接在手機運行 模擬器連接在模擬器運行)
ionic run android(相當於build + emulate)
ionic serve(開啟服務調試)