Xcode 6.3 在项目重命名时崩溃
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/29692487/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Xcode 6.3 is crashing on Project Rename
提问by PJR
I just updated my Xcode 6.3. I am getting an issue while project renaming. Is there any solution?
我刚刚更新了我的 Xcode 6.3。项目重命名时出现问题。有什么解决办法吗?
And in some case it is showing mymac instead of simulators or devices in schema - device section on top left side.
在某些情况下,它在架构中显示 mymac 而不是模拟器或设备 - 左上角的设备部分。
采纳答案by PJR
This issue is resolved in XCode 6.4 , please update your XCode. If you are still using 6.3 then follow below solution. But I prefere to update Xcode to 6.4.
此问题已在 XCode 6.4 中解决,请更新您的 XCode。如果您仍在使用 6.3,请遵循以下解决方案。但我更喜欢将 Xcode 更新到 6.4。
It is little different ,we have to follow some new procedure.
没什么不同,我们必须遵循一些新程序。
1)Change your xcodeprojfile name first without opening it.
1) 先更改你的xcodeproj文件名,不要打开它。
2)Change Targetname from Project Editorby double clicking on target name.
2)通过双击目标名称从项目编辑器更改目标名称。
3)If your project name is not changed yet , you can do it by right side of your xCode as shown in below figure.
3)如果您的项目名称尚未更改,您可以在 xCode 的右侧进行更改,如下图所示。
4)You can change plistfile name manually.
4)您可以手动更改plist文件名。
5)Now for solving scheme issue, you have to remove current scheme and have to add newer scheme with proper name.
5)现在为了解决方案问题,您必须删除当前方案并添加具有适当名称的新方案。
Remove older schemes shown as above(by selecting it and removing by clicking on "-"button) and add newer one(By clicking on "+"button from manage schemeand adding proper name).
删除如上所示的旧方案(通过选择它并通过单击“-”按钮删除)并添加新方案(通过单击管理方案中的“+”按钮并添加适当的名称)。
回答by lenhhoxung
After crashing, the extension "xcodeproj" disappears. So what you need is to add the extension. After opening project, all targets gone. You need to remove current scheme (Manage Schemes>Delete"), then add a new scheme with proper name. In my case, it works.
崩溃后,扩展名“xcodeproj”消失了。所以你需要的是添加扩展。打开项目后,所有目标都消失了。您需要删除当前方案(Manage Schemes>Delete”),然后添加一个具有适当名称的新方案。在我的情况下,它有效。
回答by Wes Hovanec
Manually rename in the finder App.xcodeproj
and App-info.plist
to YourNewAppName.xcodeproj
and YouNewAppName-info.plist
. Control click on YourNewAppName.xcodeproj
and chose Show Package Contents
, manually rename App.xcscheme
to YouNewAppName.xcscheme
手动重命名在取景器App.xcodeproj
和App-info.plist
以YourNewAppName.xcodeproj
和YouNewAppName-info.plist
。控制单击YourNewAppName.xcodeproj
并选择Show Package Contents
,手动重命名App.xcscheme
为YouNewAppName.xcscheme
Open project.pbxproj
, YouNewAppName.xcscheme
and xcschememanagement.plist
files in your favorite text editor other than Xcode. Find and replace one at a time all instances of App
to YourNewAppName
then Save.
在 Xcode 以外的您最喜欢的文本编辑器中打开project.pbxproj
,YouNewAppName.xcscheme
和xcschememanagement.plist
文件。查找和替换一次一个的所有实例App
来YourNewAppName
然后保存。
Control click on project.xcworkspace
and chose Show Package Contents
and open UserInterfaceState.xcusersate
in text editor. Find and replace one at a time all instances of App
to YourNewAppName
then Save.
控制单击project.xcworkspace
并选择Show Package Contents
并UserInterfaceState.xcusersate
在文本编辑器中打开。查找和替换一次一个的所有实例App
来YourNewAppName
然后保存。
Open YourNewAppName.xcodeproj
in Xcode and change under the Project Document settings: Project Format Xcode 6.3-compatible
YourNewAppName.xcodeproj
在 Xcode 中打开并在项目文档设置下进行更改: Project Format Xcode 6.3-compatible
...or for an easier time go back to Xcode 6.2.
...或者为了更轻松地回到 Xcode 6.2。
回答by Khayrattee Wasseem
this might be a late reply, but definitely useful for some readers later on. Note: Renaming manually here and there is simply a risk and time-consuming. There a more effective way of doing it via Command-line with just 3 statements. Read on.
这可能是一个迟到的回复,但对以后的一些读者绝对有用。注意:在这里手动重命名只会带来风险和耗时。有一种更有效的方法可以通过命令行完成,只需 3 条语句。继续阅读。
Two Solutions exist:
存在两种解决方案:
1- Upgrade to Xcode 6.3.2 GM seed or later
1- 升级到 Xcode 6.3.2 GM 种子或更高版本
2- Replace by command-line - it's fast & furious..urm effective!! Mention not
2- 替换为命令行 - 它的速度与激情..urm 有效!!不要提
/// Install Ack. For info on Ack, see: http://beyondgrep.com/why-ack/
/// 安装确认。有关 Ack 的信息,请参阅:http: //beyondgrep.com/why-ack/
$ brew install rename ack
/// Two Commands to execute to do renaming - one for File names & 2nd for 'leterals' inside files
/// 执行重命名的两个命令 - 第一个用于文件名,第二个用于文件内的“字母”
$ find . -name 'OldProjectName*' -print0 | xargs -0 rename -S 'OldProjectName' 'NewProjectName'
$ ack --literal --files-with-matches 'OldProjectName' | xargs sed -i '' 's/OldProjectName/NewProjectName/g'
/// Check to see if all renaming was a success. The following command indicates a success IF & ONLY IF no result is output
/// 检查所有重命名是否成功。以下命令表示成功 IF & ONLY IF 没有结果输出
$ ack --literal 'OldProjectName'
回答by RobertL
Edit the Project (the top item in the Navigator panel) with the Utilities panel open (cmd-option-zero). Type the new project name into the box at the top of the Utilities panel. That's the box labeled "Name" in the "Identity and Type" section. When you change the name in that box a dialog pops up asking if you want to change the name of various files. Accept all of the suggested changes. That works for me with Xcode 6.3.2. It successfully changes the project name and the projects loads and runs on either a device or the simulator. I didn't experiment with not accepting some of the suggested changes.
在实用程序面板打开的情况下编辑项目(导航器面板中的顶部项目)(cmd-option-zero)。在“实用工具”面板顶部的框中键入新项目名称。这是“身份和类型”部分中标有“名称”的框。当您在该框中更改名称时,会弹出一个对话框,询问您是否要更改各种文件的名称。接受所有建议的更改。这对我来说适用于 Xcode 6.3.2。它成功地更改了项目名称,并且项目在设备或模拟器上加载和运行。我没有尝试不接受某些建议的更改。
Previously I tried to change the project name by editing the name in the "Project" or "Targets" section in the narrow panel near the center of the screen, which is where I changed the project name in previous Xcode versions. But when I edited it there in Xcode 6.3 the project wouldn't build or it crashed.
以前,我尝试通过编辑靠近屏幕中心的窄面板的“项目”或“目标”部分中的名称来更改项目名称,这是我在以前的 Xcode 版本中更改项目名称的地方。但是当我在 Xcode 6.3 中编辑它时,该项目无法构建或崩溃。
回答by enRaiser
I just did a small trick.
我只是做了一个小技巧。
I changed the 'Product Name' in Build Settings and give new name. the rest happened by its own. that is the Xcode also renamed folder and files.
我在构建设置中更改了“产品名称”并给出了新名称。其余的都是自己发生的。那是 Xcode 也重命名了文件夹和文件。