{"id":222,"date":"2015-06-07T17:22:36","date_gmt":"2015-06-07T09:22:36","guid":{"rendered":"https:\/\/blog.kotori.moe\/?p=222"},"modified":"2015-06-07T17:22:36","modified_gmt":"2015-06-07T09:22:36","slug":"%e4%bd%bf%e7%94%a8ionic%e6%9e%84%e5%bb%ba%e7%ae%80%e5%8d%95%e7%9a%84androidios-app","status":"publish","type":"post","link":"https:\/\/sora.sound.moe\/?p=222","title":{"rendered":"\u4f7f\u7528Ionic\u6784\u5efa\u7b80\u5355\u7684Android\/iOS App"},"content":{"rendered":"<p>\u561b\uff0c\u8d77\u56e0\u662f\u56e0\u4e3a\u5f00\u7f51\u9875\u5f00\u4e09\u5c0f\u65f6\u9884\u62a5\u592a\u9ebb\u70e6\u4e86\uff0c\u5e02\u9762\u4e0a\u53c8\u6ca1\u6709\u4e00\u4e2a\u8f6f\u4ef6\u53bb\u663e\u793a\u4e09\u5c0f\u65f6\u9884\u62a5\u2026\u2026\u6240\u4ee5\u5c31\u81ea\u5df1\u82b1\u4e86\u534a\u5929\u65f6\u95f4\u505a\u4e86\u8fd9\u4e2a\u5c0f\u4e1c\u897f\u3002\u4e4b\u524d\u4ece\u6765\u6ca1\u6709\u63a5\u89e6\u8fc7app\u5f00\u53d1\u2026\u2026\u4f30\u8ba1\u4ee5\u540e\u4e5f\u4e0d\u4f1a\u78b0\u4e86&gt;.&lt;<\/p>\n<p><!--more--><\/p>\n<p>Ionic\u662f\u4e00\u4e2a\u8de8\u5e73\u53f0App Framework\uff0c\u4f7f\u7528HTML+JavaScript\u5c31\u53ef\u4ee5\u6784\u5efa\u60f3\u8981\u7684\u5e94\u7528\u3002\u4e0d\u8fc7\u561b\uff0c\u771f\u6b63\u590d\u6742\u7684\u5e94\u7528\uff0c\u80af\u5b9a\u8fd8\u662f\u5f97\u7528java\u2026\u2026<\/p>\n<p>\u9996\u5148\uff0c\u914d\u7f6e\u6240\u9700\u73af\u5883\u3002<\/p>\n<p>\u9700\u8981\u5b89\u88c5\u7684\u4e1c\u897f\u5f88\u591a\u3002\u9996\u5148\u5b89\u88c5Ionic\u3002\u53ef\u4ee5\u53c2\u8003\u8fd9\u91cc<a href=\"http:\/\/www.ionicframework.com\/getting-started\/\">http:\/\/www.ionicframework.com\/getting-started\/<\/a><\/p>\n<p>\u8fd9\u4e2a\u4e1c\u897f\u9700\u8981Apache cordova\u7684\u652f\u6301\uff0c\u800c\u4e14\u8fd9\u4e24\u8005\u90fd\u9700\u8981\u901a\u8fc7Node.js\u7684\u5305\u7ba1\u7406\u5668npm\u6765\u5b89\u88c5\u3002<\/p>\n<p>\u5728Windows\u4e0b\u76f4\u63a5\u5b89\u88c5Node.js\u7684.msi\u6587\u4ef6\uff0c\u7136\u540e\u76f4\u63a5<\/p>\n<pre><code class=\"language-bash\" data-lang=\"bash\">npm install -g cordova ionic<\/code><\/pre>\n<p>\u5c31\u53ef\u4ee5\u4e86\u3002\u7136\u540e\u8fd8\u6709\u5f00\u53d1Android App\u5fc5\u987b\u6709\u7684\u4e24\u6837\u4e1c\u897f\uff1aAndroid SDK\u548cJava Development Kit(jdk+jre)\uff0c\u8fd9\u4fe9\u90fd\u76f4\u63a5\u4e0a\u5b98\u7f51\u4e0b\u4e8c\u8fdb\u5236\u6587\u4ef6\u5b89\u88c5\u5c31\u884c\u3002<\/p>\n<p>\u5b89\u88c5\u597d\u4e4b\u540e\uff0c\u9700\u8981\u5728\u73af\u5883\u53d8\u91cf\u91cc\u52a0\u4e00\u4e2aANDROID_HOME\uff0c\u6307\u5411Android SDK\uff0c\u540c\u65f6\u628aAndroid SDK\u5b89\u88c5\u76ee\u5f55\u4e0b\u7684\/bin\u6587\u4ef6\u5939\u52a0\u5165Path<\/p>\n<p>\u8fd8\u6709\uff0c\u9700\u8981\u5728\u73af\u5883\u53d8\u91cf\u52a0\u4e00\u4e2aJAVA_HOME\uff0c\u6307\u5411jdk\u5b89\u88c5\u76ee\u5f55\u3002<\/p>\n<p>\u5728\u547d\u4ee4\u884c\u8fd0\u884cjava -version\u786e\u8ba4\u5b89\u88c5\u6b63\u786e\u3002\u5728\u547d\u4ee4\u884c\u8fd0\u884candroid\u786e\u8ba4Android SDK\u5b89\u88c5\u6b63\u786e\uff0c\u540c\u65f6\u53ef\u4ee5\u9009\u62e9\u4e0b\u8f7d\u4e00\u4e9bSystem Image\u548c\u5176\u4ed6\u4e00\u4e9bsdk\u3002<\/p>\n<p>\u8fd8\u662f\u547d\u4ee4\u884c\uff0c\u521b\u5efa\u4e00\u4e2aIonic\u5e94\u7528\u3002\u8fd9\u91cc\u6709\u51e0\u79cd\u6a21\u677f\u53ef\u4ee5\u9009\uff0c\u53ef\u4ee5\u4e0a\u5b98\u7f51\u770b\u770b\u3002\u6211\u9009\u7684\u662f\u7a7a\u767d\u3002<\/p>\n<pre><code>ionic start myAppName blank<\/code><\/pre>\n<p>\u7136\u540e\u8fdb\u5165\u5e94\u7528\u76ee\u5f55\uff0c\u914d\u7f6e\u76f8\u5173\u4e8b\u9879\u3002<\/p>\n<pre><code>cd myAppName\nionic platform add ios\n<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>\u7136\u540e\u5c31\u53ef\u4ee5\u968f\u4fbf\u7528\u4ec0\u4e48IDE\/\u7f16\u8f91\u5668\u6253\u5f00\u6587\u4ef6\u8fdb\u884c\u4fee\u6539\u4e86\u3002\u57fa\u672c\u4e0a\u4e5f\u6ca1\u4ec0\u4e48\u9650\u5236\u3002\u6211\u76f4\u63a5\u7528simple html dom\u6784\u5efa\u4e86\u4e00\u4e2a\u540e\u7aef\u6765\u6293\u6570\u636e\uff0c\u7136\u540e\u5f15\u7528\u4e86\u4e00\u4e0bjquery\u6765\u4e86\u4e2aajax\u5c31\u5b8c\u6210\u4e86\u3002Ionic\u4f3c\u4e4e\u662fAngularJS\u7684\u2026\u2026\u4f46\u662f\u6211\u8fd8\u4e0d\u5927\u4f1a\uff0c\u8fd9\u4e2a\u5c31\u7b97\u4e86\u561b\u2026\u2026\u6211\u5c1d\u8bd5\u7528$http\u6765ajax\u4f46\u662f\u5931\u8d25\u4e86\uff1f<\/p>\n<p>\u8fd9\u91cc\u6709\u4e00\u4e2a\u5751\uff0c\u5c31\u662f\u5728\u7528jQuery\u8fdb\u884cajax\u7684\u65f6\u5019\uff0ccache\u4e00\u5b9a\u8981false\uff0c\u5426\u5219\u76f4\u63a5\u8fd4\u56de404\uff0c\u6211\u4e5f\u4e0d\u77e5\u9053\u4ec0\u4e48\u9b3c\u3002<\/p>\n<p>\u7136\u540e\u901a\u8fc7Ionic\u6253\u5305\u5e94\u7528\u3002<\/p>\n<pre><code>ionic build android<\/code><\/pre>\n<p>\u5982\u679c\u624b\u673a\u8fde\u7535\u8111+\u5f00USB\u8c03\u8bd5\u53ef\u4ee5\u76f4\u63a5<\/p>\n<pre><code>ionic run android<\/code><\/pre>\n<p>Ionic\u7684\u5b98\u7f51\u6709\u4e00\u4efd<a href=\"http:\/\/www.ionicframework.com\/docs\/guide\/\">guide<\/a>\uff0c\u53ef\u4ee5\u770b\u770b\u8fd8\u633a\u8be6\u7ec6\u7684\u3002\u66f4\u590d\u6742\u7684\u5e94\u7528\u4e5f\u9700\u8981\u53bb\u5b98\u7f51\u67e5API\u6587\u6863\u3002<\/p>\n<p>=\u3002=\u5c31\u662f\u8fd9\u6837\u4e86\u3002\u6ca1\u6709apk\uff0c\u6ca1\u6709\u622a\u56fe\u3002\u4f60\u4eec\u8111\u8865\u5427\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u561b\uff0c\u8d77\u56e0\u662f\u56e0\u4e3a\u5f00\u7f51\u9875\u5f00\u4e09\u5c0f\u65f6\u9884\u62a5\u592a\u9ebb\u70e6\u4e86\uff0c\u5e02\u9762\u4e0a\u53c8\u6ca1\u6709\u4e00\u4e2a\u8f6f\u4ef6\u53bb\u663e\u793a\u4e09\u5c0f\u65f6\u9884\u62a5\u2026\u2026\u6240\u4ee5\u5c31\u81ea\u5df1\u82b1\u4e86\u534a\u5929\u65f6\u95f4\u505a\u4e86\u8fd9 &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/sora.sound.moe\/?p=222\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u4f7f\u7528Ionic\u6784\u5efa\u7b80\u5355\u7684Android\/iOS App\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"uagb_featured_image_src":{"full":false,"thumbnail":false,"medium":false,"medium_large":false,"large":false,"1536x1536":false,"2048x2048":false,"twentyseventeen-featured-image":false,"twentyseventeen-thumbnail-avatar":false},"uagb_author_info":{"display_name":"Sora","author_link":"https:\/\/sora.sound.moe\/?author=1"},"uagb_comment_info":2,"uagb_excerpt":"\u561b\uff0c\u8d77\u56e0\u662f\u56e0\u4e3a\u5f00\u7f51\u9875\u5f00\u4e09\u5c0f\u65f6\u9884\u62a5\u592a\u9ebb\u70e6\u4e86\uff0c\u5e02\u9762\u4e0a\u53c8\u6ca1\u6709\u4e00\u4e2a\u8f6f\u4ef6\u53bb\u663e\u793a\u4e09\u5c0f\u65f6\u9884\u62a5\u2026\u2026\u6240\u4ee5\u5c31\u81ea\u5df1\u82b1\u4e86\u534a\u5929\u65f6\u95f4\u505a\u4e86\u8fd9&hellip;","_links":{"self":[{"href":"https:\/\/sora.sound.moe\/index.php?rest_route=\/wp\/v2\/posts\/222"}],"collection":[{"href":"https:\/\/sora.sound.moe\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sora.sound.moe\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sora.sound.moe\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sora.sound.moe\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=222"}],"version-history":[{"count":0,"href":"https:\/\/sora.sound.moe\/index.php?rest_route=\/wp\/v2\/posts\/222\/revisions"}],"wp:attachment":[{"href":"https:\/\/sora.sound.moe\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sora.sound.moe\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sora.sound.moe\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}