Xcode 5无法在iOS模拟器上使用选定的设备运行 [英] Xcode 5 cannot run using selected device on iOS simulator

查看:94
本文介绍了Xcode 5无法在iOS模拟器上使用选定的设备运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

因此,这似乎是一个很普遍的问题,但是我发现的所有答案都与在尝试在已连接的设备上运行xcode时无法使它运行.我的问题是仅在iOS模拟器中尝试运行此错误.

So this seems to be quite a common question but all the answers I found were related to getting "xcode cannot run using selected device" when trying to run it on a connected device. My issue is getting this error just trying to run it in the iOS simulator.

某些背景是该应用在模拟器上正常运行,然后我更改了项目名称,目标名称和方案名称,也就是当问题开始出现时.

Some background is that app was running in simulator fine, and then I changed the Project Name, the Target name and the Scheme name and that is when the problems started to occur.

我在其他一些线程中尝试了许多不同的解决方案,例如:清理,删除派生数据,重新启动Xcode,重新启动计算机,确保使用默认LLVM,删除Info.plist,然后再次将其重新添加到项目中.他们都没有工作.

I tried many of the different solutions in some of the other threads such as: Clean, Delete Derived Data, restart Xcode, restart computer, make sure using Default LLVM, remove Info.plist then re-add it into project again. None of them worked.

我终于发现了问题,并且能够解决该问题,并将解决方案发布在下面.

I finally discovered the problem and was able to get it working and will post my solution below.

推荐答案

我发现是问题所在,是在Info.plist文件中,可执行文件(CFBundleExecutable)硬编码为"MyAppName".当我更改项目"名称,目标"名称和方案"名称时,此硬编码值未更改,但仍具有原始应用程序名称.

What I discovered to be the problem, was that in the Info.plist file the Executable File (CFBundleExecutable) was hard coded as "MyAppName". When I changed the Project name and Target name and Scheme name, this hardcoded value was not changed, but still had the original app name in it.

因此,我将Info.plist文件中的可执行文件(CFBundleExecutable)更改为此常量:

So I changed Executable File (CFBundleExecutable) in the Info.plist file to be this constant:

    ${EXECUTABLE_NAME}

问题解决了:)

我在另一个项目上再次发生了问题,但是以上内容已经设置为$ {EXECUTABLE_NAME}.

I had the problem occur again on a different project, however the above was already set to ${EXECUTABLE_NAME}.

所以我继续搜索,发现Build Settings > Build Options > Compiler for C/C++/Objective-C下的设置为UNSUPPORTED.

So I went searching and found that under Build Settings > Build Options > Compiler for C/C++/Objective-C was set to UNSUPPORTED.

我将此设置更改为DEFAULT,问题已解决:)

I changed this setting to DEFAULT and the problem was solved :)

我又遇到了问题,以上两点都没有解决.

I had the problem occur again and the above two things did not fix it.

因此,我去确保从任何Target Membership中都删除了(未选中)info.plist,这解决了问题.似乎有多种原因会导致此问题,因此请尝试所有解决方案!

So I went and made sure that the info.plist was removed (unticked) from any Target Membership, and this solved the problem. It seems that there are multiple things that will cause this issue, so try all the solutions!

这篇关于Xcode 5无法在iOS模拟器上使用选定的设备运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆