编译时.test文件报错无法解决的方法,关闭test编译
有几次遇到从网上下载到的iOS开源代码编译报错,报错位置为Test Target的源文件,我就挺奇怪我又没做测试为啥会编译Test Target的源文件,之前的暴力解决方法是把Test Target直接删掉。
未免太暴力了点,删除了还不好恢复,我想换一个方法来解决。首先就是要弄明白为啥会编译Test Target源文件。摸索了一下,找到了原因:选择Xcode左上角Simulator/Device左侧的Scheme名,在下拉列表里选择Edit Scheme,随后选择Build选项,可以看到里面有Test Target,并且勾选了对应的Run选项。取消勾选Test Target的Run选项,再重新Build,就不会报错了。
至于Test Target源文件中的代码问题,以后再解决了。
关于Scheme、Target、Workspace的一些信息如下:
------------------Scheme------------------
An Xcode scheme defines a collection of targets to build, a configuration to use when building, and a collection of tests to execute.
You can have as many schemes as you want, but only one can be active at a time. You can specify whether a scheme should be stored in a project—in which case it’s available in every workspace that includes that project, or in the workspace—in which case it’s available only in that workspace. When you select an active scheme, you also select a run destination (that is, the architecture of the hardware for which the products are built)
可以看出Scheme和Targets可以是一对一,也可以是一对多的关系。同一时间只能有一个scheme是激活的。
------------------Target------------------
A target specifies a product to build and contains the instructions for building the product from a set of files in a project or workspace. A target defines a single product; it organizes the inputs into the build system—the source files and instructions for processing those source files—required to build that product. Projects can contain one or more targets, each of which produces one product.
------------------Workspace------------------
A workspace is an Xcode document that groups projects and other documents so you can work on them together. A workspace can contain any number of Xcode projects, plus any other files you want to include. In addition to organizing all the files in each Xcode project, a workspace provides implicit and explicit relationships among the included projects and their targets.
可以看出一个workspace里可以包含多个Xcode project。
使用Workspace的好处有:
1),扩展项目的可视域,即可以在多个项目之间跳转,重构,一个项目可以使用另一个项目的输 出。Workspace会负责各个Project之间提供各种相互依赖的关系;
2),多个项目之间共享Build目录。
编译时.test文件报错无法解决的方法,关闭test编译的更多相关文章
- eclipse中的js文件报错的解决办法
在使用别人的项目的时候,导入到eclipse中发现js文件报错,解决办法是关闭eclipse的js校验功能. 三个步骤: 1. 右键点击项目->properties->Validation ...
- php Yaf_Loader::import引入文件报错的解决方法
php Yaf_Loader::import引入文件报错的解决方法 改下配置文件就行<pre>yaf.use_spl_autoload=1</pre> 也可以PHP动态修改 毕 ...
- Latex Error cannot determine the size of graphic 报错的解决的方法
Latex Error cannot determine the size of graphic 报错的解决的方法 插入jpg文件老是会报错... 追究了半天,原来是编译的命令又问题,不应该使用 la ...
- 创建maven项目时pom.xml报错的解决方法
创建maven项目时pom.xml时: 出现如下报错信息: Failure to transfer commons-lang:commons-lang:jar:2.1 from https://rep ...
- IAR升级之后,编译stm32官方工程报错的解决办法
IAR升级之后,打开stm32官方例程,编译时提示如下错误: Error[Pe147]: declaration is incompatible with "__nounwind __int ...
- CentOS7安装Docker时的异常报错与解决方法
重要:有些人在vmware中安装了新的centos用于使用docker,但是往往会忽略了更换源与进行系统update, 这样会导致安装过程中出现诸多如下类问题,为了避免不必要的麻烦在安装docker前 ...
- 在Python中使用moviepy进行视频剪辑时输出文件报错 ‘NoneType‘ object has no attribute ‘stdout‘问题
专栏:Python基础教程目录 专栏:使用PyQt开发图形界面Python应用 专栏:PyQt入门学习 老猿Python博文目录 老猿学5G博文目录 movipy输出文件时报错 'NoneType' ...
- Vboxmanage改动uuid报错的解决的方法
我的环境: Virtualbox 4.3.10 r93012 操作系统:win7 问题:Virtualbox在使用拷贝的虚拟盘时会提示uuid冲突: Because a hard disk with ...
- [odroid-pc] ubuntu12.04 64bit Android4.0.3 源码编译报错及解决的方法
第一个错误: host Executable: cmu2nuance (out/host/linux-x86/obj/EXECUTABLES/cmu2nuance_intermedia ...
随机推荐
- Listview多条目展示
//---------------主要是适配器里面------------------------------------- package com.bwie.test.adapter;import ...
- POJ - 3666 Making the Grade(dp+离散化)
Description A straight dirt road connects two fields on FJ's farm, but it changes elevation more tha ...
- System services not available to Activities before onCreate()
应用中涉及到系统的mac地址获取,应该是不能够在oncreate()以前使用
- Java 学习路线以及各阶段学习书籍,博文,视频的分享
感谢: 感谢每一个打开这篇文章的人,听我在这里瞎扯!至于我为什么会有闲情写这篇文章呢?因为我每天想的是为什么要给我这样的需求,背后的人性是什么,我能再做些什么能让他更好.久而久之,我也稍微有了些自己的 ...
- 迄今最安全的MySQL?细数5.7那些惊艳与鸡肋的新特性(上)【转载】
转自: DBAplus社群 http://www.toutiao.com/m5762164771/ 迄今最安全的MySQL?细数5.7那些惊艳与鸡肋的新特性(上) - 今日头条(TouTiao.com ...
- Ubuntu vim显示行号语法高亮自动缩进
配置文件名为Ubuntu vimrc在Fedora中vim的配置文件存放在/etc目录中,配置文件名为Ubuntu vimrc在终端 输入以下命令来编辑Ubuntu vimrc配置文件:sudo vi ...
- 生成Token字符串
生成比较短的Token字符串 有的时候,我们需要生成一些Token作为标识:如认证后的标识符,资源的提取码等.一个比较常见的算法是生成一个GUID来作为Token,由于GUID的随机性和唯一性特点,作 ...
- CakePHP下使用paginator需要对多个字段排序的做法
原文:http://blog.csdn.net/kunshan_shenbin/article/details/7644603 CakePHP下使用paginator需要对多个字段排序的做法 2 ...
- 为图片存储而作——记一次UEditor源码的修改
本文版权归博客园和作者吴双本人共同所有. 写在前面 这是一个数据爆发的网络时代,大家习惯于浏览图文直观带给我们的快速信息.大图片的存储和浏览经常会成为Web服务器的瓶颈.试想如果你的Web服务器依然 ...
- 基于I2C EPPRPM(AT24C02B) + LCD12864实验
本次实验目的:在指定的EPPROM地址中,写入一数据,延时100MS后,在从该地址中读取,并在LCD上显示. 该实验在前两天就开始做了,一开始并没有成功,读出的一直0x00,当时也调了一会,但跳回到P ...