Programmatically rename an XCode project

萝らか妹 提交于 2020-01-01 06:45:07

问题


I know one can rename a project by slowly double clicking the project name but I was wondering if it's possible to automate that through the command line (any language, possibly Apple Script) ?


回答1:


You will have to manipulate the .xcodeproj file, which is in XML format.

In my build process I have placeholder names that I simply search & replace with a command line app. If you need a generic solution you will have to parse the XML format (which is undocumented but not that hard to grasp).




回答2:


Renaming an Xcode4 project is quite easy. Click on Show the Project Manager to see the top level project file on the left side. Click on the project name (here DeeTeeSaver will be changed to DeeTeeSaver2) in order to edit it and enter the new name.

It takes a second to let Xcode4 find out which parts have to be changed. It then displays a dialog which parts will be changed. Simply click on Rename.

That´s it. No need to fondle around with AppleScript. You might miss important parts inside the bundle.

Greetings from Switzerland, Ronald Hofmann



来源:https://stackoverflow.com/questions/7171457/programmatically-rename-an-xcode-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!