1.(转载)在真机上运行时出现Could not launch "XXX" failed to get the task for process xxxx
在Xcode下编译工程正常,在模拟器下运行正常,最后在真机上运行的时候出现了如下错误:
Could not launch "FeedMeWorms" failed to get the task for process 3118
原因是:我的签名是distribution certificate,即发布者证书,不允许在真机上直接运行
使用开发者证书就OK了
注:在实际解决问题的时候,证书换了也不行,看网上说证书刷新,重启xcode等。没招了,只能刷新证书,重启xcode,最后到重启机器才行。
2.(转载)在真机运行时出现“A valid provisioning profile for this executable was not found.”
“A valid provisioning profile for this executable was not found.”
在开发时真机测试遇到这个问题,原因是因为之前发布过应用,在target的code signing中的code signing identity已经置为iphone Distribution发布状态,改为iphone Developer就ok了。
3.(转载)在真机运行程序的时候提示“Could not launch 'app name'”,No such file or directory (/Users/apple/Library/Developer/Xcode/DerivedData/mytest-ejkagqxooxgmtdfsdoygtyzflibe/Build/Products/Debug-iphoneos/mytest.app/mytest)
此问题一般不是程序本身问题,而是xcode问题
解决方式如下:
先退出xcode,再把/Users/apple/Library/Developer/Xcode/DerivedData/下面的东西都删除(DerivedData本身不要删),再启动xcode,再rebuild.
这个目录直接在xcode中,.app的文件show in filder。往上几个目录便是。还有xcode一定要退出啊
4.
#if ! __has_feature(objc_arc)
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
#endif
这个文件必须使用ARC(Automatic Reference Counting),你在.m的compiler flags中添加-fobjc-arc就可以了.
在TARGETS-Compile Source