如何在不影响单元测试目标的构建的情况下更改发布目标的名称? [英] How can I change the name of a release target without affecting the build of unit test target?

查看:32
本文介绍了如何在不影响单元测试目标的构建的情况下更改发布目标的名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个发布目标和一个测试目标,我想更改发布目标的名称,但如果我这样做了,我开始在测试目标中收到链接错误.由于它们是单元测试,我认为测试目标中不会/不应该依赖于发布目标,但显然存在.联动错误是:

I have a release target and a test target, I want to change the name of the release target, but if I do so I start getting a linking error in the test target. As they are unit tests I didn't think there would/should be a dependency within the test target to the release target, but apparently there is. The linkage error is:

ld: file not found: /Users/Cequint/Library/Developer/Xcode/DerivedData/XYZ-apppviisyaexwpdcwgjtfldjotro/Build/Products/Debug-iphonesimulator/XYZ.app/XYZ
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1

XYZ.app 是我重命名之前发布目标的名称.

XYZ.app is the name of the release target before I renamed it.

是否有自动或快速更新单元测试目标以使其保持同步的方法?

Is there an automatic or quick way of updating the unit test target so that it keeps in step?

推荐答案

这个答案可能有点晚了,但我遇到了同样的问题 (Xcode 6.3) 并找到了解决方法:

Probably a bit late with this answer, but I experienced this same issue (Xcode 6.3) and figured out a fix:

  1. 进入 Project Inspector 并选择单元测试目标 Locate测试主机值(它将类似于$(BUILT_PRODUCTS_DIR)/MyOldAppTargetName.app/MyOldAppTargetName)
  2. 编辑测试主机值以反映新的应用目标名称(就像是$(BUILT_PRODUCTS_DIR)/MyNewAppTargetName.app/MyNewAppTargetName

我已将此作为 http://www.openradar.me/21139630 和 rdar://21139630 与 Apple.如果您也遇到此问题,请随时上当受骗.

I have filed this as http://www.openradar.me/21139630 and rdar://21139630 with Apple. Feel free to dupe if you also experience this issue.

这篇关于如何在不影响单元测试目标的构建的情况下更改发布目标的名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆