批生成和iOS的存档通过终端应用程式 [英] Batch Build and Archive of iOS apps via Terminal

查看:187
本文介绍了批生成和iOS的存档通过终端应用程式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图简化iOS应用发布的建设 - > archive->提交过程。
我们有几乎相同的框架50移动应用,但具有不同的艺术品和配置设置。

I am trying to simplify the build->archive->submit process for iOS app publishing. We have over 50 mobile apps that have nearly identical framework, but with different artwork and configuration settings.

我通常会以x code加载每个项目4.2和建筑> archive->提交与x code GUI通常的方式,但我们有过多达50现在的应用程序和这个过程很烦人我们推出一个更新的任何时间。

I normally would load each project in xcode 4.2 and build->archive->submit the usual way with the xcode GUI, but we are up over 50 apps now and this process is very tiresome any time we push out an update.

话虽这么说,我试图加快与使用shell函数这一过程。
我做了很多研究,发现<一个href=\"http://stackoverflow.com/questions/2664885/x$c$c-build-and-archive-from-command-line\">x$c$cbuild (见里德的回答)应该工作,但是存档选项没有工作,我得到以下错误:

That being said, I am trying to speed up this process with using a shell function. I did plenty of research and found that xcodebuild (See Reid's answer) should work, however the Archive option is not working as I get the following error:

unsupported build action 'archive'

所以我写了以下内容:

So I wrote the following:

# $1 should be a date like: 2012-07-17
# $2 should be a time like: 10.31AM
# $mybase will be the current directory at the time the function was called
# so make sure to cd into the folder containing the xcode project folders first

function xcodeArchive {
    mkdir ~/Library/Developer/Xcode/Archives/$1
    mybase=$PWD
    for x in `ls`
    do
        mkdir ~/Library/Developer/Xcode/Archives/$1/$x
        mkdir ~/Library/Developer/Xcode/Archives/$1/$x/dSYMs
        mkdir ~/Library/Developer/Xcode/Archives/$1/$x/Products
        mkdir ~/Library/Developer/Xcode/Archives/$1/$x/Products/Applications
        cd $mybase/$x
        xcodebuild
        #read -p "Press [Enter] to continue"
        cd $mybase/$x
        cp $x/$x-Info.plist ~/Library/Developer/Xcode/Archives/$1/$x/Info.plist
        cp -r build/Release-iphoneos/$x.app.dSYM ~/Library/Developer/Xcode/Archives/$1/$x/dSYMs/$x.app.dSYM
        cp -r build/Release-iphoneos/$x.app ~/Library/Developer/Xcode/Archives/$1/$x/Products/Applications/$x.app
        cd ~/Library/Developer/Xcode/Archives/$1/
        mv $x $x\ $1\ $2.xcarchive
        cd $mybase
    done
}
export -f xcodeArchive

我把这个在我的.bash_profile,一切运行正常,因为我所期望的,但我没有复制正确的Info.plist我想不通的地方,将其从或如何产生的复制。所以,现在我卡住了。

I put this in my .bash_profile and everything runs correctly as I would expect, except I'm not copying the correct "Info.plist" and I can't figure out where to copy it from or how to generate it. So now I am stuck.

X $ C $按c认识到档案,但在主办方列出了他们的未知模式和无名归档。

Xcode will recognize the archives, but it lists them under "Unknown Schema" and "Unnamed Archive" in the organizer.

现在任何关于以获得正确的Info.plist帮助是很大的AP preciated。

我还就如何提高脚本和/或更有效的方式来批量构建+欢迎推荐存档这些iOS应用。

I also welcome recommendations on how to improve the script and/or a more efficient way to batch build+archive these iOS apps.

注意:

Note:


  • 我无法超越X $ C $ 4.2Ç要升级,需要(据我所知)OS X 10.7以上版本对此我无法获得,但(公司电脑)。

  • I am unable to upgrade beyond Xcode 4.2 as that requires (as I understand it) OS X 10.7+ which I am not able to obtain yet (company computer).

我仍然非常一个bash /壳新手,所以我为丑陋的code /上述做法道歉。

I am still very much a bash/shell novice, so I apologize for any ugly code/practice above.

此外,这是官方的应用程序提交的,而不是临时或类似的东西。

Also, this is for official app submission, not for ad-hoc or anything like that.

再次感谢您的帮助。

推荐答案

确定我发现了一个解决方案,将工作。做更多的搜索和大量的猜测和检查后,我发现我仍然可以使用随x codebuild归档选项,我只需要指定一个工作空间和方案,显然我没有这样做正确之前,因为它现在的作品。

OK I found a solution that will work. After doing a lot more searching and a lot of guess and check, I found I can still use the "archive" option with xcodebuild, I just have to specify a workspace and scheme and apparently I wasn't doing that correctly before as it now works.

所以,对于任何人寻找一个类似的解决方案(批量存档X $ C $Ç项目),这里是我的功能:

So, for anyone looking for a similar solution (to batch archive xcode projects), here is my function:

# $mybase will be the current directory at the time the function was called
# so make sure to cd into the folder containing the xcode project folders first

function xcodeArchive {
    mybase=$PWD
    for x in `ls`
    do
        cd $mybase/$x
        xcodebuild -workspace $x.xcodeproj/project.xcworkspace -scheme $x archive
        cd $mybase
    done
}
export -f xcodeArchive

这篇关于批生成和iOS的存档通过终端应用程式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆