ios 从 Xcode 项目中删除单元测试?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23529783/
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
Remove unit testing from Xcode project?
提问by Kent
When I created my iOS project in Xcode 5 I clicked the option to add testing to the project. Is it possible to remove all that testing stuff, just as though I hadn't clicked the option to begin with?
当我在 Xcode 5 中创建我的 iOS 项目时,我单击了向项目添加测试的选项。是否可以删除所有测试内容,就好像我没有单击该选项一样?
回答by Suragch
Xcode 9
Xcode 9
Click your project name in the Project Navigator. Then select your Tests target. Click the minus (-) button at the bottom to delete it. (Select everywhere in red in the image below.)
在项目导航器中单击您的项目名称。然后选择您的测试目标。单击底部的减号 (-) 按钮将其删除。(在下图中选择红色的所有地方。)
As was mentioned, it is a good idea to do Unit Testing (and UI testing) in your projects. So if you want to add them back in then just click the plus (+) button.
如前所述,在您的项目中进行单元测试(和 UI 测试)是个好主意。因此,如果您想重新添加它们,只需单击加号 (+) 按钮即可。
See also
也可以看看
回答by Matteo Gobbi
I suggest to make testin your project.
我建议在您的项目中进行测试。
But in any case, you might to leave there the target.
但无论如何,你可能会把目标留在那里。
Otherwise, if you want delete at any cost, you have just to click on your project settingsand click on this icon:
否则,如果您想不惜一切代价删除,您只需单击您的项目设置并单击此图标:
You will see your targetsand you will can delete the test target. At this point you might want delete the test classestoo: on the folder hierarchy, select these and just press backspace, confirming the deletion.
您将看到您的目标,您将可以删除测试目标。此时您可能还想删除测试类:在文件夹层次结构上,选择这些并按退格键,确认删除。