真机调试问题 错误集合

mac2022-06-30  22

1. 编译iPad真机时,选择了 Architetures:Standard(armv6) BaseSDK:iPhoneDevice3.2 TargetDeviceFamily:iPad.

若编译出现如下错误:

Command /Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1

则修改 GCC4.2CodeGeneral区域中的ComplieForThumb为非选中.

已经有了开发者证书及私钥后,可直接在越狱的手机上调试.

 

2. 编译链接时, "_OBJC_CLASS_$_xxx", referenced from:可能需要重新建立某个类的文件.

    或者:选择项目名,在detail列表中的target列(显示为一个又圆圈),把这个文件的复选选中,或者再次选中.以把它加入到这个target里面来.

 

3.在sdk4.0及以上使用RegexKitLite报'captureCount' was not declared in this scope错误,是在非.m文件中使用了它的原因.

   http://www.cocoachina.com/bbs/read.php?tid=38784&page=e&#a

 

4.there is no sdk with the name or path.

   从网上down的开源代码,结果运行的时候常出现这样的错,并且在deployment中没有ios deployment target 选项.

   http://blog.aztaru.com/2010/10/05/ios筆記there-is-no-sdk-error/

   尝试 Project/Edit Active Target/ 及 Set Active SDK菜单项,来回切换一下Active Configuration。

 

5.常见的EXEC_BAD_ACCESS,EXC_BAD_INSTRUCTION错误,一般是因为访问已经被release的对象造成的。

在工程中加入NSZombieEnabled 环境变量,并设为启用,则在 EXC_BAD_ACCESS 发生时,XCode 的 Console 会打印出问题描述中,设置方法:双击Executables 下的 可执行模组,在弹出窗口中,Variables to be set in the environment,添加 NSZombieEnabled,并设定为 YES,点击选中复选框启用此变量。

可以再加入 MallocStackLogging 来启用malloc记录,以获得更多的提示来帮助定位问题。

在gdb窗口输入 (格式: shell   malloc_history <id>   <address>)    shell malloc_history 1436 0x5f7fcf0, 也可以在终端中去运行 就要去掉以上的shell 指令 如 malloc_history <id>   <address>

http://www.cocoachina.com/macdev/objc/2011/0219/2661.html

http://www.cnblogs.com/likwo/archive/2011/02/10/1950664.html

应该仅当需要调试内存时,才设置上述环境变量.

 

在xcode4中,To edit environment variables, go to Menu Product / Edit Scheme…, select the desired configuration (you probably want 'Run') from the left sidebar first and then click on the Arguments tab. Environment variables are configurable there.

 

6.运行一个IPhone程序时,弹出窗口说“程序运行失败,预置描述文件已过期” 。 解决办法是,在Xcode中, window-> Orgnazier -> 你的iphone ->删除带有红*的该程序之前的Profile 。 然后从Xcode运行该程序.

 

7. 真机编译时报 Code Sign error: The identity doesn't match any valid certificate/private key pair in the default keychain

    修改工程和Targets的get info\build 中的code signing identity为空

 

8.调试打印

   CFShow(coreFoundationThingy) will print out a description of coreFoundationThingy to the console. Output looks something like: {value = w:1186.000000 h:687.000000 type = kAXValueCGSizeType}   If NSLog() is printing something out as an NSCFType, try CFShow().

 

9. 编译时报 Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/clang failed with exit code 1,修改C/C++ Compiler Version为gcc4.2

 

10.this class is not key value coding-compliant for the key viewController

可能在创建了一个基于view的工程,而后把生成的viewcontroller删除了,但是在.xib中还有对它的引用,在IB中直接用delete键删除掉它就行了。

 

11.这台电脑上已经存在一个名为“embedded.mobileprovision”的预置文件,您是否要替换么?

http://blog.sina.com.cn/s/blog_6907b67f0100o2vw.html

 

12.真机调试时报failed to upload *.app

http://hi.baidu.com/

转载请注明原文地址: https://mac.8miu.com/read-74192.html
最新回复(0)