{"id":9157,"date":"2023-11-21T13:04:36","date_gmt":"2023-11-21T05:04:36","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=9157"},"modified":"2023-11-21T13:04:36","modified_gmt":"2023-11-21T05:04:36","slug":"%e5%85%8d%e8%b4%b9%e7%bd%91%e9%a1%b5%e6%89%93%e5%8c%85%e8%8b%b9%e6%9e%9capp%e6%93%8d%e4%bd%9c%e6%96%b9%e6%b3%95%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/9157\/","title":{"rendered":"\u514d\u8d39\u7f51\u9875\u6253\u5305\u82f9\u679capp\u64cd\u4f5c\u65b9\u6cd5\u4ecb\u7ecd"},"content":{"rendered":"

\u6807\u9898\uff1a\u514d\u8d39\u7f51\u9875\u6253\u5305\u82f9\u679cAPP\uff08\u539f\u7406\u6216\u8be6\u7ec6\u4ecb\u7ecd\uff09<\/p>\n

\u3010\u5f15\u8a00\u3011<\/p>\n

\u73b0\u5982\u4eca\uff0c\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f(APP)\u5df2\u6210\u4e3a\u4eba\u4eec\u751f\u6d3b\u4e2d\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\uff0c\u800c\u5f00\u53d1\u4e00\u4e2aAPP\u9700\u8981\u638c\u63e1\u4e00\u5b9a\u7684\u7f16\u7a0b\u6280\u80fd\u548c\u8d44\u6e90\uff0c\u5bf9\u4e8e\u4e00\u822c\u4eba\u6765\u8bf4\uff0c\u53ef\u80fd\u6bd4\u8f83\u56f0\u96be\u3002\u7136\u800c\uff0c\u901a\u8fc7\u7f51\u9875\u6253\u5305\u6280\u672f\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u7f51\u9875\u8f6c\u5316\u4e3aAPP\uff0c\u5b9e\u73b0\u5e94\u7528\u7684\u529f\u80fd\u3002\u672c\u6587\u5c06\u4ecb\u7ecd\u514d\u8d39\u7684\u7f51\u9875\u6253\u5305\u82f9\u679cAPP\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\u3002<\/p>\n

\u3010\u6b63\u6587\u3011<\/p>\n

\u4e00\u3001\u7f51\u82f9\u679c\u624b\u673aapp\u6253\u5305\u5728\u4e00\u8d77\u600e\u4e48\u529e<\/a>\u9875\u6253\u5305\u82f9\u679cAPP\u7684\u539f\u7406<\/p>\n

\u7f51\u9875\u6253\u5305\u82f9\u679cAPP\u7684\u539f\u7406\u662f\u5c06\u7f51\u9875\u6846\u67b6\u548c\u5185\u5bb9\uff0c\u4ee5\u53ca\u76f8\u5e94\u7684\u4ea4\u4e92\u529f\u80fd\u5c01\u88c5\u4e3aAPP\u3002\u7528\u6237\u4f7f\u7528\u8fd9\u4e2aAPP\u65f6\uff0c\u5b9e\u9645\u4e0a\u662f\u5728\u4e00\u4e2a\u5145\u65a5\u7740HTML\u3001CSS\u3001JavaScript\u548c\u5176\u4ed6\u7f51\u9875\u6280\u672f\u5143\u7d20\u7684\u5bb9\u5668\u4e2d\u6d4f\u89c8\u7f51\u9875\uff0c\u65e0\u8bba\u662f\u4ece\u529f\u80fd\u4e0a\uff0c\u8fd8\u662f\u4ece\u5916\u89c2\u4e0a\u90fd\u548c\u7f51\u9875\u4e00\u6a21\u4e00\u6837\u3002<\/p>\n

\u4e8c\u3001\u514d\u8d39\u7f51\u9875\u6253\u5305\u82f9\u679cAPP\u7684\u6b65\u9aa4<\/p>\n

\u4ee5\u4e0b\u662f\u514d\u8d39\u7f51\u9875\u6253\u5305\u82f9\u679cAPP\u7684\u8be6\u7ec6\u6b65\u9aa4\uff1a<\/p>\n

1. \u5728\u7535\u8111\u4e0a\u6253\u5f00Xcode\u8f6f\u4ef6\uff0c\u5982\u679c\u6ca1\u6709Xcode\u8f6f\u4ef6\uff0c\u53ef\u4ee5\u5728\u82f9\u679c\u5f00\u53d1\u8005\u7f51\u7ad9\u4e0a\u4e0b\u8f7d\u5e76\u5b89\u88c5\u3002Xcode\u662f\u82f9\u679c\u5f00\u53d1\u5e94\u7528\u7684\u5fc5\u5907\u5de5\u5177\u3002<\/p>\n

2. \u6253\u5f00Xcode\u8f6f\u4ef6\u540e\uff0c\u5728\u83dc\u5355\u680f\u4e2d\u9009\u62e9”Create a new Xcode project”\uff0c\u8fdb\u5165\u65b0\u5efa\u9879\u76ee\u7684\u754c\u9762\u3002<\/p>\n

3. \u5728\u65b0\u5efa\u9879\u76ee\u754c\u9762\u4e2d\uff0c\u9009\u62e9\u5de6\u4fa7\u83dc\u5355\u680f\u7684”Application”\uff0c\u7136\u540e\u9009\u62e9”Single View Application”\uff0c\u70b9\u51fb”Next”\u6309\u94ae\u3002<\/p>\n

4. \u5728\u63a5\u4e0b\u6765\u7684\u754c\u9762\u4e2d\uff0c\u8f93\u5165\u9879\u76ee\u540d\u79f0\u3001\u7ec4\u7ec7\u6807\u8bc6\u7b26\u3001\u8bed\u8a00\u7b49\u76f8\u5173\u4fe1\u606f\uff0c\u7136\u540e\u70b9\u51fb”Next”\u6309\u94ae\u3002<\/p>\n

5. \u9009\u62e9\u4e00\u4e2a\u76ee\u5f55\u4fdd\u5b58\u9879\u76ee\u6587\u4ef6\uff0c\u70b9\u51fb”Create”\u6309\u94ae\u3002<\/p>\n

6. \u5728Xcode\u7684\u5de6\u4fa7\u5bfc\u822a\u680f\u4e2d\uff0c\u9009\u62e9\u9879\u76ee\u540d\u79f0\u4e0b\u7684AppDelegate.swift\u6587\u4ef6\u3002<\/p>\n

7. \u5728AppDelegate.swift\u6587\u4ef6\u4e2d\uff0c\u627e\u5230”func application(_ application: UIApplication, didFinishLaunchingWithOptions <\/p>\n

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

launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool”\u65b9\u6cd5\u3002<\/p>\n

8. \u5728\u8be5\u65b9\u6cd5\u4e2d\uff0c\u4f7f\u7528\u4ee5\u4e0b\u4ee3\u7801\u66ff\u6362\u539f\u6709\u7684\u4ee3\u7801\uff1a<\/p>\n

“””<\/p>\n

self.window = UIWindow(frame: UIScreen.main.bounds)<\/p>\n

let viewController = WebViewController()<\/p>\n

self.window?.rootViewController = viewController<\/p>\n

self.window?.makeKeyAndVisible()<\/p>\n

return true<\/p>\n

“””<\/p>\n

9. \u5728Xcode\u7684\u5de6\u4fa7\u5bfc\u822a\u680f\u4e2d\uff0c\u9009\u62e9\u9879\u76ee\u540d\u79f0\u4e0b\u7684WebViewController.swift\u6587\u4ef6\u3002<\/p>\n

10. \u5728WebViewController.swift\u6587\u4ef6\u4e2d\uff0c\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n

“””<\/p>\n

import UIKit<\/p>\n

import WebKit<\/p>\n

class WebViewController: UIViewController {<\/p>\n

override func viewDidLoad() {<\/p>\n

super.viewDidLoad()<\/p>\n<\/p>\n

let webView = WKWebView(frame: view.bounds)<\/p>\n

view.addSubview(webView)<\/p>\n<\/p>\n

if let url = URL(string: “http:\/\/www.example.com”) {<\/p>\n

let request = URLRequest(url: url)<\/p>\n

webView.load(request)<\/p>\n

}<\/p>\n

}<\/p>\n

}<\/p>\n

“””<\/p>\n

11. \u5c06\u4e0a\u8ff0\u4ee3\u7801\u4e2d\u7684”http:\/\/www.example.com”\u66ff\u6362\u4e3a\u4f60\u8981\u6253\u5305\u7684\u7f51\u9875\u7684URL\u3002<\/p>\n

12. \u5728Xcode\u4e2d\uff0c\u70b9\u51fb\u83dc\u5355\u680f\u4e2d\u7684”Product”\uff0c\u7136\u540e\u9009\u62e9”Destination”\uff0c\u9009\u62e9\u4f60\u8981\u6253\u5305\u5230\u7684\u8bbe\u5907\u6216\u6a21\u62df\u5668\u3002<\/p>\n

13. \u5728\u83dc\u5355\u680f\u4e2d\u4f9d\u6b21\u70b9\u51fb”Product”\u3001”Build”\uff0c\u8fdb\u884c\u7f16\u82f9\u679c\u8bc1\u4e66\u53ef\u4ee5\u7ed9\u591a\u4e2aapp\u6253\u5305\u5417<\/a>\u8bd1\u3002<\/p>\n

14. \u7f16\u8bd1\u5b8c\u6210\u540e\uff0c\u5728\u83dc\u5355\u680f\u4e2d\u4f9d\u6b21\u70b9\u51fb”Product”\u3001”Archive”\uff0c\u8fdb\u884c\u6253\u5305\u3002<\/p>\n

15. \u6253\u5305\u5b8c\u6210\u540e\uff0c\u5728\u5f39\u51fa\u7684\u7a97\u53e3\u4e2d\u70b9\u51fb”Distribute App”\uff0c\u9009\u62e9”Development”\uff0c\u7136\u540e\u70b9\u51fb”Next”\u6309\u94ae\u3002<\/p>\n

16. \u5728\u63a5\u4e0b\u6765\u7684\u754c\u9762\u4e2d\uff0c\u9009\u62e9”Export”\uff0c\u7136\u540e\u70b9\u51fb”Next”\u6309\u94ae\u3002<\/p>\n

17. \u5728\u63a5\u4e0b\u6765\u7684\u754c\u9762\u4e2d\uff0c\u9009\u62e9\u4fdd\u5b58\u7684\u8def\u5f84\uff0c\u7136\u540e\u70b9\u51fb”Export”\u6309\u94ae\u3002<\/p>\n

18. \u7b49\u5f85\u4e00\u6bb5\u65f6\u95f4\uff0c\u6253\u5305\u5b8c\u6210\u540e\u5373\u53ef\u5f97\u5230\u4e00\u4e2aIPA\u6587\u4ef6\uff0c\u5373\u4f60\u8981\u7684\u7f51\u9875\u6253\u5305\u7684\u82f9\u679cAPP\u6587\u4ef6\u3002<\/p>\n

\u4e09\u3001\u603b\u7ed3<\/p>\n

\u901a\u8fc7\u514d\u8d39\u7f51\u9875\u6253\u5305\u82f9\u679cAPP\u7684\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u7f51\u9875\u8f6c\u5316\u4e3aAPP\uff0c\u5b9e\u73b0\u76f8\u5e94\u529f\u80fd\u7684\u5e94\u7528\u3002\u8fd9\u5bf9\u4e8e\u4e00\u4e9b\u7b80\u5355\u7684\u5e94\u7528\u6765\u8bf4\u662f\u4e00\u79cd\u8f83\u4e3a\u65b9\u4fbf\u548c\u5feb\u6377\u7684\u5f00\u53d1\u65b9\u5f0f\u3002\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u5728\u5c06\u7f51\u9875\u8f6c\u5316\u4e3aAPP\u65f6\uff0c\u786e\u4fdd\u7f51\u9875\u5177\u5907\u826f\u597d\u7684\u9002\u5e94\u6027\u548c\u4ea4\u4e92\u6027\uff0c\u4ee5\u786e\u4fdd\u7528\u6237\u7684\u826f\u597d\u4f53\u9a8c\u3002<\/p>\n

\u3010\u7ed3\u5c3e\u3011<\/p>\n

\u901a\u8fc7\u514d\u8d39\u7f51\u9875\u6253\u5305\u82f9\u679cAPP\u7684\u539f\u7406\u548c\u8be6\u7ec6\u6b65\u9aa4\uff0c\u6211\u4eec\u53ef\u4ee5\u5c06\u7f51\u9875\u8f6c\u5316\u4e3a\u5e94\u7528\uff0c\u5b9e\u73b0\u5e94\u7528\u7684\u529f\u80fd\u3002\u6b64\u65b9\u6cd5\u5bf9\u4e8e\u5f00\u53d1\u8005\u6765\u8bf4\u662f\u4e00\u79cd\u7b80\u6d01\u3001\u6709\u6548\u7684\u65b9\u5f0f\uff0c\u540c\u65f6\u4e5f\u4e3a\u7528\u6237\u63d0\u4f9b\u4e86\u66f4\u591a\u4fbf\u6377\u7684\u5e94\u7528\u9009\u62e9\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff01<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6807\u9898\uff1a\u514d\u8d39\u7f51\u9875\u6253\u5305\u82f9\u679cAPP\uff08\u539f\u7406\u6216\u8be6\u7ec6\u4ecb\u7ecd\uff09\u3010\u5f15\u8a00\u3011\u73b0\u5982\u4eca\uff0c\u79fb\u52a8\u5e94\u7528\u7a0b\u5e8f(APP)\u5df2\u6210\u4e3a\u4eba\u4eec\u751f\u6d3b\u4e2d\u7684\u91cd\u8981\u7ec4\u6210\u90e8\u5206\uff0c\u800c\u5f00\u53d1\u4e00\u4e2aAPP\u9700\u8981\u638c\u63e1\u4e00\u5b9a\u7684\u7f16\u7a0b\u6280\u80fd\u548c\u8d44\u6e90\uff0c\u5bf9\u4e8e\u4e00\u822c\u4eba\u6765\u8bf4\uff0c\u53ef\u80fd\u6bd4\u8f83\u56f0\u96be\u3002\u7136\u800c\uff0c<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[5419,149,19,15499,7786],"topic":[],"class_list":["post-9157","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-5419","tag-149","tag-19","tag-appapp","tag-app"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/9157","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\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=9157"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/9157\/revisions"}],"predecessor-version":[{"id":9162,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/9157\/revisions\/9162"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=9157"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=9157"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=9157"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=9157"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}