jenkins xcodebuild命令行打包iOS项目问题汇总
2016-05-26 12:45
477 查看
这几天折腾了jenkins对iOS swift项目的持续集成,碰到了很多问题,记录下吧
解决办法:
The root cause is that the default behavior of Schemes is to keep schemes ‘private’ until they are specifically marked as shared. In the case of a command-line initiated build, the Xcode UI never runs and the xcoderun tool doesn’t have its own cache of Schemes to work with.
To your schema be visible for command-line build you must mark it as a shared scheme.
Choose Scheme > Manage Schemes (from the Product Menu).
Ensure the ‘Shared’ box is checked for that scheme
A new .xcscheme file has been created in your project at
WorkspaceName.xcworkspace/xcshareddata/xcschemes.
Commit this file to your repository
Xcode7之后取消了原来的-exportFormat,而是使用exportOptionsPlist 来取代,具体的使用方法可以在Terminal打xcodebuild –help查看。
我们需要自己创建一个plist作为Export Options,只要有这个配置文件,那我们在使用这个命令的时候就能打出跟手动用Xcode Archive之后export出的ipa一样了。
[本文独立博客地址](http://www.offbye.com)
1. 缺少scheme
xcodebuild: error: The project named “Foo” does not contain a scheme named “Bar”. The “-list” option can be used to find the names of the schemes in the project.解决办法:
The root cause is that the default behavior of Schemes is to keep schemes ‘private’ until they are specifically marked as shared. In the case of a command-line initiated build, the Xcode UI never runs and the xcoderun tool doesn’t have its own cache of Schemes to work with.
To your schema be visible for command-line build you must mark it as a shared scheme.
Choose Scheme > Manage Schemes (from the Product Menu).
Ensure the ‘Shared’ box is checked for that scheme
A new .xcscheme file has been created in your project at
WorkspaceName.xcworkspace/xcshareddata/xcschemes.
Commit this file to your repository
2. Error: User interaction is not allowed.
运行下面的命令可解决$ security unlock-keychain -p ~/Library/Keychains/login.keychain $ security show-keychain-info ~/Library/Keychains/login.keychain Keychain "/Users/XXX/Library/Keychains/login.keychain" no-timeout
3. Xcode 7后导出IPA命令发生变化
以前我是通过下面的命令打包的,但现在的swift项目这样导出的包在iPhone安装后直接闪退xcodebuild -target ${TARGET_NAME} -configuration ${BUILD_CONFIGURATION} -sdk phones build xcrun -sdk iphoneos PackageApplication -v ${APP_NAME} -o ${IPA_PATH}
Xcode7之后取消了原来的-exportFormat,而是使用exportOptionsPlist 来取代,具体的使用方法可以在Terminal打xcodebuild –help查看。
我们需要自己创建一个plist作为Export Options,只要有这个配置文件,那我们在使用这个命令的时候就能打出跟手动用Xcode Archive之后export出的ipa一样了。
<?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>XXXXXXX</string> <key>method</key> <string>enterprise</string> <key>compileBitcode</key> <false/> <key>uploadSymbols</key> <false/> </dict> </plist>
4. 最新的xcodebuild 导出ipa命令
xcodebuild archive -project {xcodeproj} -scheme '{scheme}' -sdk iphoneos -archivePath {archive_path} xcodebuild -exportArchive -archivePath {archive_path} -exportPath {export_path} -exportOptionsPlist {export_plist_path}
[本文独立博客地址](http://www.offbye.com)
相关文章推荐
- @RequestParam @RequestBody @PathVariable 等参数绑定注脚详解
- UILabel文本内容顶部对齐
- MYSQL在线注释文档--- 在gdb中显示源码(gdbtui使用方法)----赖明星的个人博客
- ios gpuimage输入和得到原始数据
- iOS UITextView限制输入字数并显示剩余字数
- java.lang.IllegalArgumentException: couldn't make a guess for .../MainActivity
- iOS开发之UISegmentedControl实现分页切换
- android gpuimage显示的缩放和剪裁模式
- iOS开发~UITableView区头跟随移动
- Vue.js-----轻量高效的MVVM框架(十、父子组件通信)
- serialVersionUID的作用
- Ansible批量快速初始化Bluemix 虚拟机
- execute、executeQuery和executeUpdate之间的区别
- 安装glue,用glue批量处理图片的步骤
- iOS开发之UIDevice等手机信息
- EasyUI DataGrid 根据ID选中行
- EasyUI Tree 树
- 关于AlertDialog.Builder的自定义
- 世界坐标转到UGUI坐标
- ios表视图之UITableViewCellAccessoryCheckmark单选、多选状态保存