带有主机应用程序的Xcode测试目标强制错误的目标进入方案的构建部分 [英] Xcode test target with host application forces wrong target into build section of scheme

查看:83
本文介绍了带有主机应用程序的Xcode测试目标强制错误的目标进入方案的构建部分的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我添加一个需要主机应用程序以运行的测试目标时,Xcode会添加与我添加的应用程序无关的目标。

When I add a test target that needs a host application in order to run Xcode adds targets that are not associated with the application I added.

我有两个方案(内部和生产)。我想在我们的内部应用程序上运行测试。当我将内部应用程序添加为主机时,我最终将生产目标添加到构建中,并且无法将其删除。如果我删除主机应用程序,这会消失,但测试也会失败。

I have two schemes (internal & production). I want to run tests on our internal application. When I add the internal application as a host I end up with the production target being added to builds and cannot delete it. If I remove the host application this goes away but the tests also fail.

有谁知道我哪里出错?

推荐答案

我们遇到了同样的问题,我们通过以下步骤解决了这些问题:

We had the same problems, we fixed them with these steps:


  1. 在测试目标中,转到常规选项卡并将托管应用程序设置为无,然后转到构建阶段并删除对前托管目标的目标依赖关系。

  1. in your testing target, go to the tab 'General' and set the hosting application to 'none', then go to 'Build phases' and remove the target dependency on the former hosting target.

(不知道是否需要此步骤)转到窗口 - >项目,从托管目标中删除派生数据并关闭Xcode。再次重新打开Xcode,打开项目/工作区。

(don't know if this step is necessary) go to 'Window'->'Projects', remove Derived Data from the hosting target and close Xcode. Reopen Xcode again, open your project/workspace.

编辑托管目标的方案,选择左侧的Build并取消选中Find Implicit Dependencies - I相信这个函数有些错误。

edit your hosting target's scheme, select "Build" on the left and uncheck "Find Implicit Dependencies" - I believe that this function is somewhat buggy.

在测试目标中,转到常规选项卡并将托管应用程序设置回其先前的值,重新检查目标的倾向。

in your testing target, go to the tab 'General' and set the hosting application back to its previous value, recheck the target depdencies.

这篇关于带有主机应用程序的Xcode测试目标强制错误的目标进入方案的构建部分的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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