{"id":16443,"date":"2024-01-26T12:33:09","date_gmt":"2024-01-26T04:33:09","guid":{"rendered":"https:\/\/www.yimenyun.cn\/emen\/?p=16443"},"modified":"2024-01-26T12:33:09","modified_gmt":"2024-01-26T04:33:09","slug":"iossh%e8%84%9a%e6%9c%ac%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\/16443\/","title":{"rendered":"iossh\u811a\u672c\u6253\u5305\u64cd\u4f5c\u6d41\u7a0b\u4ecb\u7ecd"},"content":{"rendered":"

iOS\u7684\u811a\u672c\u6253\u5305\u4e3b\u8981\u662f\u4f7f\u7528Xcode\u63d0\u4f9b\u7684xcodebuild\u547d\u4ee4\u884c\u5de5\u5177\u6765\u8fdb\u884c\u81ea\u52a8\u5316\u6253\u5305\uff0c\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdiOS\u811a\u672c\u6253\u5305\u7684\u539f\u7406\u548c\u5177\u4f53\u6b65\u9aa4\u3002<\/p>\n

iOS\u811a\u672c\u6253\u5305\u7684\u539f\u7406\uff1a<\/p>\n

iOS\u5e94\u7528\u7684\u6253\u5305\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u51e0ios\u6253\u5305\u5230app<\/a>\u4e2a\u6b65\u9aa4\uff1a\u7f16\u8bd1\u6e90\u4ee3\u7801\u3001\u751f\u6210.app\u6587\u4ef6\u3001\u6253\u5305\u8d44\u6e90\u3001\u751f\u6210.ipa\u6587\u4ef6\u3002\u811a\u672c\u6253\u5305\u7684\u539f\u7406\u5c31\u662f\u5229\u7528xcodebuild\u547d\u4ee4\u884c\u5de5\u5177\u6765\u5b9e\u73b0\u8fd9\u4e9b\u6b65\u9aa4\u7684\u81ea\u52a8\u5316\u6267\u884c\u3002<\/p>\n

\u6b65\u9aa4\u4e00\uff1a\u8bbe\u7f6e\u73af\u5883\u53d8\u91cf<\/p>\n

\u5728\u811a\u672c\u4e2d\u9996\u5148\u9700\u8981\u8bbe\u7f6e\u4e00\u4e9b\u73af\u5883\u53d8\u91cf\uff0c\u7528\u4e8e\u6307\u5b9a\u6253\u5305\u5de5\u7a0b\u7684\u8def\u5f84\u3001\u7b7e\u540d\u8bc1\u4e66\u53ca\u5176\u4ed6\u5fc5\u8981\u7684\u914d\u7f6e\u4fe1\u606f\u3002\u6bd4\u5982\uff1a<\/p>\n

“`<\/p>\n

# \u9879\u76ee\u8def\u5f84<\/p>\n

project_path=”\/path\/to\/your\/project”<\/p>\n

# \u5de5\u4f5c\u7a7a\u95f4\u540d\u79f0<\/p>\n

workspace_namunity\u5728windows\u4e0a\u6253\u5305ios<\/a>e=”YourWorkspace.xcworkspace”<\/p>\n

# \u9879\u76ee\u540d\u79f0<\/p>\n

project_name=”YourProject.xcodeproj”<\/p>\n

# Scheme\u540d\u79f0<\/p>\n

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

# Provisioning Profile\u540d\u79f0<\/p>\n

provisioning_profile=”YourProvisioningProfileName”<\/p>\n

# \u7b7e\u540d\u8bc1\u4e66\u540d\u79f0<\/p>\n

code_sign_identity=”YourCodeSignIdentity”<\/p>\n

“`<\/p>\n

\u6b65\u9aa4\u4e8c\uff1a\u6e05\u7406\u9879\u76ee<\/p>\n

\u4f7f\u7528`xcodebuild clean`\u547d\u4ee4\u6e05\u7406\u9879\u76ee\uff1a<\/p>\n

“`<\/p>\n

xcodebuild clean -workspace ${workspace_name} -scheme ${scheme_name} -configuration Release<\/p>\n

“`<\/p>\n

\u6b65\u9aa4\u4e09\uff1a\u6784\u5efa\u9879\u76ee<\/p>\n

\u4f7f\u7528`xcodebuild build`\u547d\u4ee4\u6765\u6784\u5efa\u9879\u76ee\uff1a<\/p>\n

“`<\/p>\n

xcodebuild build -workspace ${workspace_name} -scheme ${scheme_name} -configuration Release -archivePath ${project_path}\/build\/archive.xcarchive<\/p>\n

“`<\/p>\n

\u6b65\u9aa4\u56db\uff1a\u6253\u5305\u8d44\u6e90\u6587\u4ef6<\/p>\n

\u4f7f\u7528`xcodebuild archive`\u547d\u4ee4\u6765\u6253\u5305\u8d44\u6e90\u6587\u4ef6\uff1a<\/p>\n

“`<\/p>\n

xcodebuild archive -archivePath ${project_path}\/build\/archive.xcarchive -exportOptionsPlist exportOptions.plist -exportPath ${project_path}\/build<\/p>\n

“`<\/p>\n

\u4e0a\u9762\u7684exportOptions.plist\u662f\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\uff0c\u7528\u4e8e\u6307\u5b9a\u5bfc\u51faipa\u6587\u4ef6\u7684\u76f8\u5173\u4fe1\u606f\uff0c\u6bd4\u5982bundle identifier\u3001\u5bfc\u51faipa\u7684\u65b9\u6cd5\u7b49\u3002<\/p>\n

\u6b65\u9aa4\u4e94\uff1a\u751f\u6210.ipa\u6587\u4ef6<\/p>\n

\u4f7f\u7528`xcodebuild exportArchive`\u547d\u4ee4\u6765\u751f\u6210ipa\u6587\u4ef6\uff1a<\/p>\n

“`<\/p>\n

xcodebuild -exportArchive -archivePath ${project_path}\/build\/archive.xcarchive -exportOptionsPlist exportOptions.plist -exportPath ${project_path}\/build<\/p>\n

“`<\/p>\n

\u5b8c\u6210\u4ee5\u4e0a\u6b65\u9aa4\u540e\uff0c\u4f1a\u5728\u6307\u5b9a\u7684exportPath\u4e2d\u751f\u6210\u4e00\u4e2a.ipa\u6587\u4ef6\uff0c\u5373\u4e3a\u6253\u5305\u5b8c<\/p>\n

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

\u6210\u7684ipa\u6587\u4ef6\u3002<\/p>\n

\u4ee5\u4e0a\u5c31\u662fiOS\u811a\u672c\u6253\u5305\u7684\u4e3b\u8981\u6b65\u9aa4\u548c\u539f\u7406\u3002\u901a\u8fc7\u7f16\u5199\u4e00\u4e2a\u811a\u672c\uff0c\u5c06\u4e0a\u8ff0\u6b65\u9aa4\u6574\u5408\u5728\u4e00\u8d77\uff0c\u5c31\u53ef\u4ee5\u5b9e\u73b0\u81ea\u52a8\u5316\u7684iOS\u6253\u5305\u3002<\/p>\n

\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c\u811a\u672c\u6253\u5305\u9700\u8981\u63d0\u524d\u5b89\u88c5\u597dXcode\u548c\u76f8\u5173\u7684\u547d\u4ee4\u884c\u5de5\u5177\uff0c\u5e76\u4e14\u914d\u7f6e\u597d\u5408\u9002\u7684\u8bc1\u4e66\u3001\u914d\u7f6e\u6587\u4ef6\u7b49\u3002\u80fd\u591f\u987a\u5229\u6253\u5305\u4e00\u4e2a\u53ef\u8fd0\u884c\u7684ipa\u6587\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

iOS\u7684\u811a\u672c\u6253\u5305\u4e3b\u8981\u662f\u4f7f\u7528Xcode\u63d0\u4f9b\u7684xcodebuild\u547d\u4ee4\u884c\u5de5\u5177\u6765\u8fdb\u884c\u81ea\u52a8\u5316\u6253\u5305\uff0c\u672c\u6587\u5c06\u8be6\u7ec6\u4ecb\u7ecdiOS\u811a\u672c\u6253\u5305\u7684\u539f\u7406\u548c\u5177\u4f53\u6b65\u9aa4\u3002iOS\u811a\u672c\u6253\u5305\u7684\u539f\u7406\uff1aiOS\u5e94\u7528\u7684\u6253\u5305\u4e3b\u8981\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u6b65\u9aa4\uff1a\u7f16<\/p>\n","protected":false},"author":6,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[19877,14851,16,797,408],"topic":[],"class_list":["post-16443","post","type-post","status-publish","format-standard","hentry","category-appkf","tag-iosapp","tag-ios","tag-16","tag-797","tag-408"],"_links":{"self":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/16443","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\/6"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/comments?post=16443"}],"version-history":[{"count":1,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/16443\/revisions"}],"predecessor-version":[{"id":16701,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/posts\/16443\/revisions\/16701"}],"wp:attachment":[{"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/media?parent=16443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/categories?post=16443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/tags?post=16443"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.yimenyun.cn\/emen\/wp-json\/wp\/v2\/topic?post=16443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}