Xcode7---项目模拟器运行不了,一个月时间了,终于解决问题啦

Xcode7---iOS9要有一些配置

1、

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions

{

    //ios9以后此方法中必须设置windown根视图,否则报错

    UIViewController *viewController = [[UIViewControlleralloc]init];

    self.window.rootViewController = viewController;

}
2、BitCode
未来, Watch 应用必须包含 bitcode ,iOS不强制,Mac OS不支持。 但最坑的一点是: Xcode7 及以上版本会默认开启 bit code 。
当我们提交程序到 App Store上时, Xcode 会将程序编译为一个中间表现形式( bitcode )。然后 App store 会再将这个 bitcode 编译为可执行的64位或32位程序。
现在,很多SDK不支持bitcode,所以app也要设置bit code为NO
3、iOS9要求Http请求加密,必须设置一下ATS---app transform security 有两种选择,一种是设置一些exception,即不要加密请求的链接。一种是直接打开这个禁止,允许所有的不加密http请求。
我选择第二种,plist文件里面设置

4、跳转到别的平台,需要设置一个跳转白名单,在plist文件中设置
Xcode7---项目模拟器运行不了,一个月时间了,终于解决问题啦_第1张图片
目前这些是我的项目Xcode7中的必要设置,不是完全的iOS9的一下变化,这个链接写的很好的,有空我再看看
https://github.com/ChenYilong/iOS9AdaptationTips#4bitcode

虽然做了这些设置项目还是报错。这个错误是:

FBSOpenApplicationErrorDomain error 1

度娘上完全没有解决方案,苹果开发者论坛也没有,只能知道谷歌了。Google镜像大全----http://www.itechzero.com/google-mirror-sites-collect.html
终于多次查看stack overflow,终于找到了方案啦!!!!!心花怒放啊!
大神一:

11 down vote accepted

I had the same error after updating Xcode to v7.0. After few hours struggling, I found that there was some empty environment variable setup to be passed for Run action in my active scheme (have no idea why it was there). Removing this empty environment variable resolved the issue immediately.

然而小白我,不知道如何找到这个空的setup。。。。泪奔~!好在有大神二!!
大神二:
11 down vote accepted

I had the same error after updating Xcode to v7.0. After few hours struggling, I found that there was some empty environment variable setup to be passed for Run action in my active scheme (have no idea why it was there). Removing this empty environment variable resolved the issue immediately.




1 down vote

If the other fixes don't work

Went through these attempts:

  1. Force quit the app in simulator
  2. reset simulator
  3. removed app from simulator
  4. Disabled App Transport Security globally (not recommended)
  5. Turned off all background modes issue always returned preventing debug sessions

This was my fix

Seems like the schemes manager enables a field with no arguments that caused my issue. 

Product menu > Scheme > Edit Scheme > Run > Arguments > Environment Variables

If there is a checkmark there with an empty field next to it, then uncheck it.

I was getting the "1" error code. I hope this works for you too.

终于解决了问题,还在这里找到了查看模拟器的运行log的方法~~~这里也记录下来
选中simulator---debug--Open system log。就可以打开控制台,然后开始看系统的日志。
好啦,今天的学习内容就到这里了~

你可能感兴趣的:(iOS开发)