{"id":21,"date":"2023-07-13T13:04:58","date_gmt":"2023-07-13T05:04:58","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/21\/"},"modified":"2023-07-13T13:04:58","modified_gmt":"2023-07-13T05:04:58","slug":"androidstudio%e6%89%93%e5%8c%85%e8%8b%b9%e6%9e%9capp%e5%8f%af%e4%bb%a5%e5%98%9b","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/21\/","title":{"rendered":"androidstudio\u6253\u5305\u82f9\u679capp\u53ef\u4ee5\u561b?"},"content":{"rendered":"

\u8981\u5728Android Studio\u4e2d\u6253\u5305\u82f9\u679c\uff08iOS\uff09\u5e94\u7528\u7a0b\u5e8f\uff0c\u9996\u5148\u9700\u8981\u7406\u89e3Android\u548ciOS\u7684\u5dee\u5f02\u3002 Android\u548ciOS\u662f\u4e24\u4e2a\u5b8c\u5168\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b83\u4eec\u5206\u522b\u7531Google\u548cApple\u5f00\u53d1\u548c\u7ef4\u62a4\u3002\u56e0\u6b64\uff0cAndroid\u5e94\u7528\u7a0b\u5e8f\u548ciOS\u5e94\u7528\u7a0b\u5e8f\u7684\u6784\u5efa\u8fc7\u7a0b\u4e5f\u4e0d\u540c\u3002 iOS\u5e94\u7528\u7a0b\u5e8f\u4f7f\u7528Objective-C\u6216Swift\u7f16\u7a0b\u8bed\u8a00\uff0c\u800cAndroid\u5e94\u7528\u7a0b\u5e8f\u4f7f\u7528Java\u6216Kotlin\u7f16\u7a0b\u8bed\u8a00\u3002<\/p>\n

\u7531\u4e8eAndroid Studio\u662f\u4e13\u95e8\u7528\u4e8e\u5f00\u53d1Android\u5e94\u7528\u7a0b\u5e8f\u7684\u5de5\u5177\uff0c\u6240\u4ee5\u4e0d\u80fd\u82f9\u679c\u624b\u673aapp\u600e\u4e48\u6253\u5305\u53d1\u9001<\/a>\u76f4\u63a5\u7528\u4e8e\u6784\u5efaiOS\u5e94\u7528\u7a0b\u5e8f\u3002\u8981\u5728Android Studio\u4e2d\u6253\u5305\u82f9\u679c\uff08iOS\uff09\u5e94\u7528\u7a0b\u5e8f\uff0c\u53ef\u4ee5\u4f7f\u7528\u7b2c\u4e09\u65b9\u5de5\u5177\uff0c\u4f8b\u5982Xcode\u6216Appcelerator Titanium\u7b49\u3002<\/p>\n

\u4e00\u79cd\u5e38\u7528\u7684\u65b9\u6cd5\u662f\u4f7f\u7528Xcode\u6765\u6784\u5efaiOS\u5e94\u7528\u7a0b\u5e8f\uff0c\u7136\u540e\u5728Android Studio\u4e2d\u8fdb\u884c\u6253\u5305\u3002\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u6b65\u9aa4\u6307\u5357\uff1a<\/p>\n

1.\u5b89\u88c5Xcode\u548cAndroid Studio\u3002\u5982\u679c\u60a8\u5df2\u7ecf\u5b89\u88c5\u4e86Android Studio\uff0c\u53ef\u4ee5\u8df3\u8fc7\u6b64\u6b65\u9aa4\u3002\u5426\u5219\uff0c\u60a8\u53ef\u4ee5\u4ece\u5b98\u65b9\u7f51\u7ad9\u4e0a\u4e0b\u8f7d\u548c\u5b89\u88c5\u6700\u65b0\u7248\u672c\u7684Xcode\u548cAndroid Studio\u3002<\/p>\n

\n

<\/figure>\n<\/p>\n

2.\u5728Xcode\u4e2d\u521b\u5efaiOS\u5e94\u7528\u7a0b\u5e8f\u9879\u76ee\u3002\u6253\u5f00Xcode\u5e76\u9009\u62e9\u201cCreate a new Xcode project\u201d\u3002\u9009\u62e9\u201cSingle View App\u201d\u6a21\u677f\uff0c\u5e76\u586b\u5199\u6240\u9700\u7684\u9879\u76ee\u8bbe\u7f6e\u4fe1\u606f\u3002<\/p>\n

3.\u4f7f\u7528Objective-C\u6216Swift\u7f16\u5199iOS\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\u3002\u9664\u975e\u60a8\u6709iOS\u5f00\u53d1\u7ecf\u9a8c\uff0c\u5426\u5219\u53ef\u80fd\u9700\u8981\u5b66\u4e60\u8fd9\u4e9b\u7f16\u7a0b\u8bed\u8a00\u3002\u7f16\u5199\u5e94\u7528\u7a0b\u5e8f\u4ee3\u7801\u4ee5\u6ee1\u8db3\u60a8\u7684\u9700\u6c42\uff0c\u5e76\u786e\u4fdd\u5e94\u7528\u7a0b\u5e8f\u53ef\u4ee5\u6b63\u5e38\u8fd0\u884c\u3002<\/p>\n

4.\u6d4b\u8bd5\u548c\u8c03\u8bd5iOS\u5e94\u7528\u7a0b\u5e8f\u3002\u5728Xcode\u4e2d\u8fd0\u884c\u5e94\u7528\u7a0b\u5e8f\uff0c\u5e76\u8fdb\u884c\u6d4b\u8bd5\u548c\u8c03\u8bd5\uff0c\u4ee5\u786e\u4fdd\u5e94\u7528\u7a0b\u5e8f\u6ca1\u6709\u4efb\u4f55\u9519\u8bef\u6216\u95ee\u9898\u3002<\/p>\n

5.\u6784\u5efaiOS\u5e94\u7528\u7a0b\u5e8f\u3002\u5728Xcode\u4e2d\u9009\u62e9\u201cProduct -> Build\u201d\u6765\u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u3002\u6784\u5efa\u8fc7\u7a0b\u5c06\u751f\u6210\u4e00\u4e2a\u5305\u542b\u5e94\u7528\u7a0b\u5e8f\u7684.app\u6587\u4ef6\u3002<\/p>\n

6.\u5bfc\u5165iOS\u5e94\u7528\u7a0b\u5e8f\u5230Android Studio\u3002\u6253\u5f00Android Studio\uff0c\u5e76\u521b\u5efa\u4e00\u4e2a\u65b0\u7684Android\u9879\u76ee\u3002\u7136\u540e\u5c06\u751f\u6210\u7684.app\u6587\u4ef6\u5bfc\u5165\u5230Anios\u514d\u7b7e\u5c01\u88c5\u6253\u5305\u82f9\u679capp<\/a>droid\u9879\u76ee\u4e2d\u3002<\/p>\n

7.\u914d\u7f6eiOS\u5e94\u7528\u7a0b\u5e8f\u7684\u6784\u5efa\u8bbe\u7f6e\u3002\u5728Android Studio\u4e2d\uff0c\u6253\u5f00\u9879\u76ee\u7684build.gradle\u6587\u4ef6\uff0c\u5e76\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n

“`groovy<\/p>\n

android {<\/p>\n

…<\/p>\n

defaultConfig {<\/p>\n

…<\/p>\n

\/\/ Set the signing configurations for iOS app<\/p>\n

signingConfigs {<\/p>\n

ios {<\/p>\n

signingConfig signingConfigs.release<\/p>\n

}<\/p>\n

}<\/p>\n

\/\/ Set the productFlavors for iOS app<\/p>\n

flavorDimensions “platform”<\/p>\n

productFlavors {<\/p>\n

ios {<\/p>\n

dimension “platform”<\/p>\n

}<\/p>\n

}<\/p>\n

}<\/p>\n

}<\/p>\n

“`<\/p>\n

8.\u6784\u5efa\u548c\u6253\u5305iOS\u5e94\u7528\u7a0b\u5e8f\u3002\u5728Android Studio\u4e2d\uff0c\u9009\u62e9\u201cBuild -> Build Bundle(s) \/ APK(s) -> Build Bundle(s)\u201d\u3002\u9009\u62e9\u751f\u6210\u7684.iOS\u5e94\u7528\u7a0b\u5e8f\u5305\uff0c\u5e76\u6309\u7167\u63d0\u793a\u64cd\u4f5c\u5b8c\u6210\u6253\u5305\u8fc7\u7a0b\u3002<\/p>\n

\u8fd9\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u6307\u5357\uff0c\u65e8\u5728\u5411\u60a8\u63d0\u4f9b\u5728Android Studio\u4e2d\u6253\u5305\u82f9\u679c\uff08iOS\uff09\u5e94\u7528\u7a0b\u5e8f\u7684\u57fa\u672c\u6982\u5ff5\u3002\u5b9e\u9645\u4e0a\uff0c\u6784\u5efaiOS\u5e94\u7528\u7a0b\u5e8f\u662f\u4e00\u4e2a\u590d\u6742\u7684\u8fc7\u7a0b\uff0c\u5e76\u4e14\u53ef\u80fd\u6d89\u53ca\u8bb8\u591a\u5176\u4ed6\u6b65\u9aa4\u548c\u8bbe\u7f6e\u3002\u4f46\u662f\uff0c\u6709\u4e86\u8fd9\u4e2a\u57fa\u672c\u7684\u4e86\u89e3\uff0c\u60a8\u53ef\u4ee5\u66f4\u597d\u5730\u7406\u89e3\u5982\u4f55\u5c06Android Studio\u4e0e\u5176\u4ed6\u5de5\u5177\u7ed3\u5408\u4f7f\u7528\u6765\u6253\u5305iOS\u5e94\u7528\u7a0b\u5e8f\u3002\u5bf9\u4e8e\u66f4\u8be6\u7ec6\u7684\u4fe1\u606f\u548c\u6307\u5bfc\uff0c\u8bf7\u53c2\u8003\u76f8\u5173\u7684\u6587\u6863\u548c\u6559\u7a0b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u8981\u5728Android Studio\u4e2d\u6253\u5305\u82f9\u679c\uff08iOS\uff09\u5e94\u7528\u7a0b\u5e8f\uff0c\u9996\u5148\u9700\u8981\u7406\u89e3Android\u548ciOS\u7684\u5dee\u5f02\u3002 Android\u548ciOS\u662f\u4e24\u4e2a\u5b8c\u5168\u4e0d\u540c\u7684\u64cd\u4f5c\u7cfb\u7edf\uff0c\u5b83\u4eec\u5206\u522b\u7531Google\u548cApple\u5f00\u53d1\u548c\u7ef4\u62a4<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[12,25,24,22,23],"topic":[],"class_list":["post-21","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-12","tag-25","tag-app","tag-cmsapp","tag-23"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/21","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=21"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/21\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=21"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=21"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=21"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=21"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}