1,生成Archive:
工程文件把Automatically manage siging打钩
xcodebuild -scheme GDNXBankProject -sdk iphoneos -archivePath /Users/freesan44/Desktop/GDNXBankProject.xcworkspace -configuration Release
-scheme 项目名称
-sdk 选iphoneos
-archivePath .xcworkspace的路径
xcarchive文件就生成在.xcworkspace同一个目录下
2,生成ipa:
xcodebuild -exportArchive -archivePath /Users/freesan44/Desktop/GDNXBankProject.xcworkspace.xcarchive -exportOptionsPlist /Users/freesan44/Desktop/config.plist -exportPath /Users/freesan44/Desktop
-archivePath .xcarchive的路径
-exportOptionsPlist plist文件路径
-exportPath 导出ipa的存放路径
pilst模板设置:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>teamID</key>
<string>7GTPKLC48T</string>
<key>method</key>
<string>app-store</string>
<key>compileBitcode</key>
<false/>
</dict>
</plist>
plist文件的选项大部分是我们打包时候选择的选项。
teamID是我们选用发布的team,开发和发布的TeamID是不一样的,传入developer TeamID,自动打包在签名的时候就出错了,用文本打开*.xcodeproj/project.pbxproj搜索 DevelopmentTeam, 又或者去开发中中心找到对应的distribution provisioning点击 edtior, 然后会看到xxxxx.com xxxx应该就是发布的TeamID.
method: (String) The method of distribution, which can be set as any of the following:
app-store
enterprise
ad-hoc
development