在Xcode 6中重命名应用程序

Jef*_*nes 20 xcode xcode6 ios8

我有一个应用程序,我需要重命名,所以代码可以重复使用只有轻微的变化,我有困难.

我按照这个链接,似乎覆盖它,但当我尝试构建它时,我收到一个链接错误,其中也是如下:

链接到资源:

http://matthewfecher.com/app-developement/xcode-tips-the-best-way-to-change-a-project-name-in-xcode/

这是我得到的链接错误和我看到的信息

Ld /Users/jeffjanes/Library/Developer/Xcode/DerivedData/solfEightFive-aqlpurtbbyfkqmgjdryrxicllljh/Build/Products/Debug-iphoneos/solfEightFiveTests.xctest/solfEightFiveTests normal arm64
    cd "/Users/jeffjanes/Xcode Projects/solfEightFive/shell"
    export IPHONEOS_DEPLOYMENT_TARGET=8.0
    export PATH="/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch arm64 -bundle -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk -L/Users/jeffjanes/Library/Developer/Xcode/DerivedData/solfEightFive-aqlpurtbbyfkqmgjdryrxicllljh/Build/Products/Debug-iphoneos -F/Users/jeffjanes/Library/Developer/Xcode/DerivedData/solfEightFive-aqlpurtbbyfkqmgjdryrxicllljh/Build/Products/Debug-iphoneos -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Frameworks -F/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS8.0.sdk/Developer/Library/Frameworks -filelist /Users/jeffjanes/Library/Developer/Xcode/DerivedData/solfEightFive-aqlpurtbbyfkqmgjdryrxicllljh/Build/Intermediates/solfEightFive.build/Debug-iphoneos/solfEightFiveTests.build/Objects-normal/arm64/solfEightFiveTests.LinkFileList -Xlinker -rpath -Xlinker @executable_path/Frameworks -Xlinker -rpath -Xlinker @loader_path/Frameworks -dead_strip -bundle_loader /Users/jeffjanes/Library/Developer/Xcode/DerivedData/solfEightFive-aqlpurtbbyfkqmgjdryrxicllljh/Build/Products/Debug-iphoneos/shell.app/shell -framework XCTest -fobjc-arc -fobjc-link-runtime -miphoneos-version-min=8.0 -Xlinker -dependency_info -Xlinker /Users/jeffjanes/Library/Developer/Xcode/DerivedData/solfEightFive-aqlpurtbbyfkqmgjdryrxicllljh/Build/Intermediates/solfEightFive.build/Debug-iphoneos/solfEightFiveTests.build/Objects-normal/arm64/solfEightFiveTests_dependency_info.dat -o /Users/jeffjanes/Library/Developer/Xcode/DerivedData/solfEightFive-aqlpurtbbyfkqmgjdryrxicllljh/Build/Products/Debug-iphoneos/solfEightFiveTests.xctest/solfEightFiveTests

ld: file not found: /Users/jeffjanes/Library/Developer/Xcode/DerivedData/solfEightFive-aqlpurtbbyfkqmgjdryrxicllljh/Build/Products/Debug-iphoneos/shell.app/shell
clang: error: linker command failed with exit code 1 (use -v to see invocation)

有什么我想念的吗?我试过清理它,似乎没有效果.

这只是一些澄清,上面链接中描述的过程建议如下:

在屏幕左上角的项目导航器窗格中,轻轻双击项目名称.然后允许Xcode重命名文件

以相同的方式重命名方案

这就是我所做的一切,也许这本身就不够,所以如果有人知道正确的方法,请告诉我.

Cam*_*hez 12

我最近也遇到过这个问题.您的XCode项目应该有两个目标.您的应用程序的一个目标是测试的另一个目标.

在测试目标的构建设置中,有一个设置名称Test Host.重命名应用目标后,此设置的值不会更新.

正确修改测试主机设置值,一切都应该工作.

  • 这是正确答案.从myoldproject.app/myoldproject重命名为mynewproject.app/mynewproject (2认同)

Ste*_*fan 2

首先,我试图仅将其作为评论发布,但目前还不允许我这样做。

我不太了解 Xcode 6,但由于我假设它使用的每个项目文件都是基于文本的,因此您可以在 shell 中尝试类似的操作,假设MyProjectDir是您的项目目录并且OldProjectName是您项目的旧名称。

您应该首先清理并关闭 Xcode 中的项目。

cd MyProjectDir
find . -type f -exec grep -i OldProjectName {} \; -ls
Run Code Online (Sandbox Code Playgroud)

这将列出包含旧项目名称的行的所有文件(每个文件首先包含匹配的行,后跟“ls -l”格式的包含文件的目录条目)。这样,您至少应该知道哪些文件仍然包含旧名称。也许使用文本编辑器改变它就可以了。

你也可以做

cd MyProjectDir
find . -iname "*OldProjectName*" -ls
Run Code Online (Sandbox Code Playgroud)

列出包含旧项目名称的所有文件。然后,您可以重命名这些文件,如果您确定它们是由 Xcode 生成的,甚至可以删除它们。

当然,请务必先对您的项目进行备份!