我有一个项目叫XXX。我想把这个项目重命名为YYY。

请注意,XXX是一个非常常见的术语(例如:“数据”,或者简单的“项目”),因此一个简单的RegEx搜索和替换是不可能的,因为有破坏项目配置文件的风险。

我的当前项目目录包含以下项目:

XXX XXXTests XXX . xcodeproj

我想把它们重命名为:

年年 年 YYY.xcodeproj

... 分别与必要的变化反映在我的项目文件。

我如何才能在不手动创建和填充新项目的情况下实现这一点呢?


当前回答

我在网上找到了一些有用的简单步骤:

in Finder change project's folder name open project/select project file in Xcode navigator/show the file inspector/under Identity and Type change Name as per your preference/Enter/wait few seconds till pop-up window appears/click rename/again wait few seconds - do not push OK/ select folder under project file in Xcode navigator/show the file inspector/under Identity and Type change name as per your preference/Enter/wait few secont till file under project file in Xcode nagivator changes its name in Xcode project status bar click on the project name (it appears when you hover over the beginning of line)/choose Manage schemes...till "Autocreate schemes" window shows up/2x click on project name under scheme column/enter/close "Autocreate schemes" window select project file in Xcode navigator/inXcode editor ~ interface builder area choose tab "Build setting"/in filter type the previous name of your project/click enter/in the line(s) where the previous name of your project appears within the root(s) - just change it to new name voala that's it

其他回答

我在网上找到了一些有用的简单步骤:

in Finder change project's folder name open project/select project file in Xcode navigator/show the file inspector/under Identity and Type change Name as per your preference/Enter/wait few seconds till pop-up window appears/click rename/again wait few seconds - do not push OK/ select folder under project file in Xcode navigator/show the file inspector/under Identity and Type change name as per your preference/Enter/wait few secont till file under project file in Xcode nagivator changes its name in Xcode project status bar click on the project name (it appears when you hover over the beginning of line)/choose Manage schemes...till "Autocreate schemes" window shows up/2x click on project name under scheme column/enter/close "Autocreate schemes" window select project file in Xcode navigator/inXcode editor ~ interface builder area choose tab "Build setting"/in filter type the previous name of your project/click enter/in the line(s) where the previous name of your project appears within the root(s) - just change it to new name voala that's it

除了Luke和Vaiden推荐的所有步骤之外,我还必须重命名Storyboard中的所有customModule属性以匹配新名称,并且这必须区分大小写。

有一个GitHub项目叫做Xcode project Renamer:

它应该在Xcode项目目录的根目录中执行,并使用两个字符串参数调用:$OLD_PROJECT_NAME和$NEW_PROJECT_NAME 脚本递归遍历所有文件和目录, 包括Xcode项目或工作空间文件,并替换所有发生的事件 $OLD_PROJECT_NAME字符串和$NEW_PROJECT_NAME字符串(两者都在 每个文件的名称和内容)。

别忘了备份你的项目!

Xcode Project Renamer

Xcode 11.0 +。

现在真的很简单了。只需转到Project Navigator,即Xcode窗口的左侧面板。 按Enter键使其激活以进行重命名,就像更改文件夹名称一样。

只需要在这里更改新名称,Xcode会要求你重命名其他东西。

.

点击这里的重命名,你就完成了。

如果你对根文件夹的名称感到困惑,比如为什么它没有改变,那么它只是一个文件夹。它只是用一个新名字重新命名它。

如果它的反应本机,你可以做的是: 您可以更改package中的name属性。Json,运行react-native upgrade,然后让react覆盖android/ios文件。但是,如果有未保存的代码,则不要覆盖索引文件。