开发者

Automating Xcode development

Can everything which is done through Xcode GUI be done through command line, like changing app name, changing provisional profile, distribution profile? If yes then how. May be it can be done through xcodebuild , but till no开发者_StackOverflow中文版w i am only able to compile through xcodebuild.


Yes. Building can be done through xcodebuild:

$ xcodebuild -help
Usage: xcodebuild [-project <projectname>] [-activetarget] [-alltargets] [-target <targetname>]... [-parallelizeTargets] [-activeconfiguration] [-configuration <configurationname>] [-sdk <sdkfullpath>|<sdkname>] [-xcconfig <filepath>] [<buildsetting>=<value>]... [<buildaction>]...
       xcodebuild [-version [-sdk [<sdkfullpath>|<sdkname>] [<item>] ]
       xcodebuild [-showsdks]
       xcodebuild [-find <binary> -sdk <sdkfullpath>|<sdkname>]
       xcodebuild [-list]

…but I see you already know that. The application name can be changed by simply editing the Info.plist file. And I think you can change the profiles by hacking the *.pbxproj file (it’s a regular text file). You can save a copy of the project file, change a profile through the IDE and then diff the new version and the saved copy to see the changes:

$ find . -name '*.pbxproj'
./Source/Foo.xcodeproj/project.pbxproj
$ cp Source/Foo.xcodeproj/project.pbxproj ~/Desktop
# …now changing the profile through IDE…
$ diff Source/Foo.xcodeproj/project.pbxproj ~/Desktop/project.pbxproj 
517d516
< "CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "…";
534d532
< "PROVISIONING_PROFILE[sdk=iphoneos*]" = "…";

But it depends on what you are trying to do. You could switch the profiles much easier by setting different profiles for different build modes (Debug/Distribution/Whatever).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜