利用github上一个开源项目:可以在命令行为ios项目进行打包并发布。
具体安装步骤如下:
gem install shenzhen
如果安装过程出现错误有可能是ruby的源找不到,可以到改变ruby源
如果还是出现问题可以更新下gem即可(sudo gem update)。
一切准备完毕就能在控制台上运行ipa命令了:
ipa
Build and distribute iOS apps (.ipa files)
Commands:
build Create a new .ipa file for your app
distribute:crashlytics Distribute an .ipa file over Crashlytics
distribute:deploygate Distribute an .ipa file over deploygate
distribute:fir Distribute an .ipa file over fir.im
distribute:ftp Distribute an .ipa file over FTP
distribute:hockeyapp Distribute an .ipa file over HockeyApp
distribute:itunesconnect Upload an .ipa file to iTunes Connect
distribute:pgyer Distribute an .ipa file over Pgyer
distribute:rivierabuild Distribute an .ipa file over RivieraBuild
distribute:s3 Distribute an .ipa file over Amazon S3
distribute:testfairy Distribute an .ipa file over TestFairy
help Display global or [command] help documentation
info Show mobile provisioning information about an .ipa file
可以看出通过bulid参数就能创建ipa文件,比如输入命令:
$ipa build
如果你的工程项目有很多targets,则ipa bulid命令会列出现在所有targets,我们可以选择一个进行打包。