{"id":6747,"date":"2023-10-13T12:33:31","date_gmt":"2023-10-13T04:33:31","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=6747"},"modified":"2023-10-13T12:33:31","modified_gmt":"2023-10-13T04:33:31","slug":"ios-%e4%b8%80%e9%94%ae%e6%89%93%e5%8c%85%e6%93%8d%e4%bd%9c%e6%b5%81%e7%a8%8b%e4%bb%8b%e7%bb%8d","status":"publish","type":"post","link":"https:\/\/www.yimenyun.cn\/emen\/6747\/","title":{"rendered":"ios \u4e00\u952e\u6253\u5305\u64cd\u4f5c\u6d41\u7a0b\u4ecb\u7ecd"},"content":{"rendered":"

iOS\u4e00\u952e\u6253\u5305\uff0c\u987e\u540d\u601d\u4e49\u5c31\u662f\u901a\u8fc7\u4e00\u4e2a\u6309\u94ae\u70b9\u51fb\u64cd\u4f5c\uff0c\u81ea\u52a8\u5b8c\u6210\u5e94\u7528\u7a0b\u5e8f\u7684\u7f16\u8bd1\u3001\u6253\u5305\u3001\u7b7e\u540d\u3001\u4e0a\u4f20\u7b49\u591a\u4e2a\u64cd\u4f5c\u6b65\u9aa4\uff0c\u4ece\u800c\u5b9e\u73b0\u5feb\u901f\u53d1\u5e03\u5e94\u7528\u7684\u76ee\u7684\u3002\u90a3\u4e48\uff0c\u5b83\u662f\u5982\u4f55\u5b9e\u73b0\u7684iosweb\u6253\u5305<\/a>\u5462\uff1f\u4e0b\u9762\u5c31\u8ba9\u6211\u4eec\u6765\u4e86\u89e3\u4e00\u4e0b\u3002<\/p>\n

\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u77e5\u9053Xcode\u4e2d\u7684\u81ea\u52a8\u6784\u5efa\u5de5\u5177\u2014\u2014xcodebuild\u3002\u5b83\u662f\u4e00\u4e2a\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u53ef\u4ee5\u5728\u4e0d\u6253\u5f00Xcode\u7684\u60c5\u51b5\u4e0b\u8fdb\u884c\u6784\u5efa\u548c\u6253\u5305\u64cd\u4f5c\u3002xcodebuild\u652f\u6301\u591a\u79cd\u8bed\u8a00\u548c\u5e73\u53f0\uff0c\u5b83\u53ef\u4ee5\u6307\u5b9a\u6784\u5efa\u7684\u76ee\u6807\u3001\u6784\u5efa\u7684\u914d\u7f6e\u6587\u4ef6\u3001\u8f93\u51fa\u6587\u4ef6\u3001\u7b7e\u540d\u8bc1\u4e66\u7b49\u4fe1\u606f\uff0c\u8fd8\u80fd\u8c03\u7528xcrun\u5de5\u5177\u5b8c\u6210\u4e00\u4e9b\u7279\u6b8a\u7684\u6784\u5efa\u4efb\u52a1\u3002<\/p>\n

\u5728\u4e86\u89e3xcodebuild\u5de5\u5177\u7684\u57fa\u7840\u4e0a\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u7f16\u5199\u811a\u672c\u7684\u65b9\u5f0f\u81ea\u52a8\u5b8c\u6210\u6253\u5305\u64cd\u4f5c\u3002\u811a\u672c\u4e2d\u53ef\u4ee5\u5305\u542b\u8c03\u7528xcodebuild\u7684\u547d\u4ee4\u53ca\u76f8\u5173\u53c2\u6570\u8bbe\u7f6e\uff0c\u4ee5\u53ca\u4e0a\u4f20\u5230App Store\u7b49\u64cd\u4f5c\u3002\u4f8b\u5982\uff0c\u4e0b\u9762\u662f\u4e00\u4e2a\u7b80\u5355\u7684\u6253\u5305\u811a\u672c\uff1a<\/p>\n

“`shell<\/p>\n

#!\/bin\/sh<\/p>\n

#\u5b9a\u4e49\u9879\u76ee\u8def\u5f84\u548cworkspace\u540d\u79f0<\/p>\n

project_path=”.\/projectdemo.xcodeproj”<\/p>\n

w<\/p>\n

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

orkspace_name=”projectdemo.xcworkspace”<\/p>\n

#\u5b9a\u4e49scheme\u540d\u79f0<\/p>\n

scheme_name=”projectdemo”<\/p>\n

#\u5b9a\u4e49\u6253\u5305\u7684\u8f93\u51fa\u6587\u4ef6\u5939<\/p>\n

archive_path=”\/Users\/admin\/Desktop\/Archive”<\/p>\n

#\u5b9a\u4e49\u5bfc\u51fa\u7684ipa\u5b58\u653e\u6587\u4ef6\u5939<\/p>\n

export_path=”\/Users\/admin\/Desktop\/Export”<\/p>\n

#\u5b9a\u4e49\u4e0a\u4f20\u7684ipa\u5305\u540d\u79f0<\/p>\n

upload_file=”projectdemo.ipa”<\/p>\n

#\u5b9a\u4e49\u4e0a\u4f20\u5230App Store\u7684\u7528\u6237\u548c\u5bc6\u7801<\/p>\n

apple_id=”yourappleid”<\/p>\n

apple_password=”yourapplepassword”<\/p>\n

#\u8fdb\u5165\u9879\u76ee\u76ee\u5f55<\/p>\n

cd $project_path\/..<\/p>\n

#\u6e05\u7a7a\u7f13\u5b58<\/p>\n

xcodebuild clean -workspace $workspace_name -scheme $scheme_name<\/p>\n

#\u7f16\u8bd1\u548c\u6253\u5305<\/p>\n

xcodebuild archive -workspace $workspace_name -scheme $scheme_name -archivePath $archive_path<\/p>\n

#\u5bfc\u51faipa\u5305<\/p>\n

xcodebuild -exportArchive -archivePath $archive_path.xcarchive -exportPath $export_path -exportOptionsPlist ExportOptions.plist<\/p>\n

#\u4e0a\u4f20\u5230App Store<\/p>\n

altool –upload-app -f “$export_path\/$upload_file” -u $apple_id -p $apple_password<\/p>\n

“`<\/p>\n

\u5728\u6267\u884c\u8fd9\u4e2a\u811a\u672c\u524d\uff0c\u6211\u4eec\u8fd8\u9700\u8981\u521b\u5efa\u4e00\u4e2a\u6253\u5305\u914d\u7f6e\u6587\u4ef6ExportOptions.plist\uff0c\u7528\u4e8e\u6307\u5b9a\u6253\u5305\u7684\u53c2\u6570\uff0c\u4f8b\u5982\uff1a<\/p>\n

“`xml<\/p>\n

compileBitcode<\/p>\n<\/p>\n

method<\/p>\n

app-store<\/p>\n

provisioningProfiles<\/p>\n

\n

com.example.projectdemo<\/p>\n

Ad Hoc Profile<\/p>\n<\/p>\n

signingCertificate<\/p>\n

iOS Distribution<\/p>\n

signingStyle<\/p>\n

manual<\/p>\n

“`<\/p>\n

\u4e0a\u9762\u7684\u53c2\u6570\u9700\u8981\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u8fdb\u884c\u4fee\u6539\uff0c\u4f8b\u5982provisioningProfiles\u9700\u8981\u6839\u636ebundle identifier\u548cprofile\u4e2d\u7684appid\u8fdb\u884c\u5339\u914d\u3002<\/p>\n

\u5f53\u6211\u4eec\u7f16\u5199\u597d\u811a\u672c\u548cpyqt\u6253\u5305ios<\/a>\u914d\u7f6e\u6587\u4ef6\u4e4b\u540e\uff0c\u5c31\u53ef\u4ee5\u901a\u8fc7\u547d\u4ee4\u884c\u6267\u884c\u811a\u672c\uff0c\u5b9e\u73b0\u4e00\u952e\u6253\u5305\u64cd\u4f5c\u4e86\u3002<\/p>\n

\u603b\u7ed3\u6765\u8bf4\uff0ciOS\u4e00\u952e\u6253\u5305\u7684\u5b9e\u73b0\u539f\u7406\u5c31\u662f\u901a\u8fc7\u7f16\u5199\u811a\u672c\uff0c\u8c03\u7528xcodebuild\u6765\u5b8c\u6210\u81ea\u52a8\u5316\u6784\u5efa\u548c\u6253\u5305\u64cd\u4f5c\u3002\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u51cf\u5c11\u6253\u5305\u7684\u65f6\u95f4\u548c\u5de5\u4f5c\u91cf\uff0c\u63d0\u9ad8\u5de5\u4f5c\u6548\u7387\uff0c\u7279\u522b\u662f\u5bf9\u4e8e\u9700\u8981\u9891\u7e41\u53d1\u5e03\u65b0\u7248\u672c\u7684\u56e2\u961f\u548c\u5f00\u53d1\u8005\u6765\u8bf4\uff0c\u975e\u5e38\u5b9e\u7528\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

iOS\u4e00\u952e\u6253\u5305\uff0c\u987e\u540d\u601d\u4e49\u5c31\u662f\u901a\u8fc7\u4e00\u4e2a\u6309\u94ae\u70b9\u51fb\u64cd\u4f5c\uff0c\u81ea\u52a8\u5b8c\u6210\u5e94\u7528\u7a0b\u5e8f\u7684\u7f16\u8bd1\u3001\u6253\u5305\u3001\u7b7e\u540d\u3001\u4e0a\u4f20\u7b49\u591a\u4e2a\u64cd\u4f5c\u6b65\u9aa4\uff0c\u4ece\u800c\u5b9e\u73b0\u5feb\u901f\u53d1\u5e03\u5e94\u7528\u7684\u76ee\u7684\u3002\u90a3\u4e48\uff0c\u5b83\u662f\u5982\u4f55\u5b9e\u73b0\u7684\u5462\uff1f\u4e0b\u9762\u5c31\u8ba9\u6211\u4eec\u6765\u4e86\u89e3\u4e00\u4e0b\u3002\u9996\u5148\uff0c\u6211\u4eec\u9700\u8981\u77e5<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[12156,12157,1272,1062,408],"topic":[],"class_list":["post-6747","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-ios","tag-uniappios","tag-1272","tag-1062","tag-408"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/6747","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=6747"}],"version-history":[{"count":0,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/6747\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=6747"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=6747"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=6747"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=6747"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}