unity导出xcode工程之后,xcode打开Unity-iphone.xcodeproj;
1.导入描述文件_dev.mobileprovision;
导入描述文件_dev.mobileprovision;
2.导入证书 xxx.p12
先双击导入苹果root证书
双击自己的 P12证书导入,
打开钥匙串,发现报红
展开之后双击,
修改权限保存
然后直接archive就可以了
之后有个报错
note: Building targets in dependency order
warning: Run script build phase ‘Run Script’ will be run during every build because it does not specify any outputs. To address this warning, either add output dependencies to the script phase, or configure it to run in every build by unchecking “Based on dependency analysis” in the script phase. (in target ‘UnityFramework’ from project ‘Unity-iPhone’)
/Users/jenkins/Documents/xcode/Debug/Unity-iPhone.xcodeproj: error: Provisioning profile “2001_dev” doesn’t include the currently selected device “cnsha-004-mac” (identifier 00008112-0011E). (in target ‘Unity-iPhone’ from project ‘Unity-iPhone’)
** ARCHIVE FAILED **
需要在命令行的后边加上-destination ‘generic/platform=iOS’ 指定编译平台就可以了。
xcodebuild archive -project /Users/jenkins/Documents/xcode/Debug/Unity-iPhone.xcodeproj -scheme Unity-iPhone -archivePath /Users/jenkins/Documents/xcarchive/Debug/my.xcarchive -destination ‘generic/platform=iOS’
xcodebuild -exportArchive -archivePath /Users/jenkins/Documents/xcarchive/Debug/my.xcarchive -exportPath /Users/jenkins/.jenkins/workspace/Debug -exportOptionsPlist /Users/jenkins/Documents/xcode/ExportOptions.plist
ExportOptions.plist 导出文件在用xcode编译成功之后就会有了