简体   繁体   English

Xcode 4.6即时构建,运行和完成(模拟器iOS 6.1)

[英]Xcode 4.6 builds, runs and finishes instantly (simulator iOS 6.1)

In xcode, I tried to add a tap gesture to my app and when I built it, it started a problem with Xcode. 在xcode中,我尝试在我的应用程序中添加一个轻击手势,当我构建它时,它开始出现Xcode问题。 It goes from building, 'running on iPhone 6.1 simulator' to 'finished running on iPhone 6.1 simulator'. 它从构建,“在iPhone 6.1模拟器上运行”到“在iPhone 6.1模拟器上运行完毕”。

If the simulator is closed, it starts up with a black screen and you cannot click the home button etc. If open, nothing happens, the app doesn't install but the simulator doesn't crash. 如果模拟器关闭,它会启动黑屏,你无法点击主页按钮等。如果打开,没有任何反应,应用程序不会安装,但模拟器不会崩溃。

I have tried the armv6 architecture 'fix' but that didn't work. 我已经尝试过armv6架构'修复',但这不起作用。 I have also cleaned the project and project data. 我还清理了项目和项目数据。 I have reset the simulator multiple times as well. 我也多次重置模拟器。

If I add the old files to my new project, it works up to a point (I copy and paste old files into new) but then the same happens. 如果我将旧文件添加到我的新项目中,它可以达到一定程度(我将旧文件复制并粘贴到新项目中),但同样的情况也会发生。

Thanks for your help in advance! 感谢您的帮助!

NOTE: New blank projects build and run fine. 注意:新的空白项目构建并运行正常。

EDIT: It still didn't work after undoing my previous actions, and the simulator is responding according to Finder, although the screen stays black 编辑:撤消我以前的操作后它仍然无法工作,模拟器根据Finder响应,虽然屏幕保持黑色

––––––––––––––––––––––––––––––––––––––––– -----------------------------------------

UPDATE UPDATE

I had a folder named 'resources' in my application, imported as a reference which, following links from the thread @arthan.v supplied me with fixed the problem. 我在我的应用程序中有一个名为'resources'的文件夹,作为引用导入,从@ arthan.v线程的链接提供给我修复了问题。 What I did was rename the folder to files and reimport it. 我所做的是将文件夹重命名为文件并重新导入它。

Thank you so much, I spent 2 days trying to fix it before now! 非常感谢你,我花了2天时间尝试修复它!

Click the Center Button in View on your right hand side of Xcode . 单击Xcode右侧的View中的Center Button
在此输入图像描述

In your Bottom bar, you'll see error: failed to attach to process ID 0 . 在底部栏中,您将看到error: failed to attach to process ID 0

Check these error: failed to attach to process ID 0 and Xcode compiles my App, but can't run it in the simulator 检查这些错误:无法附加到进程ID 0Xcode编译我的应用程序,但无法在模拟器中运行它

This sometimes gets fixed by these steps: 这有时会通过以下步骤解决:

  • iOS Simulator > Reset Content and Settings ... > Reset iOS模拟器>重置内容和设置...>重置
  • Xcode > Build and Run Xcode>构建和运行

I experienced the same issue after I had re-organized some code and renamed the workspace and project. 在重新组织了一些代码并重命名了工作区和项目后,我遇到了同样的问题。 Eventually realized there was an old version of my test app on the simulator's homescreen. 最终意识到我的测试应用程序的旧版本在模拟器的主屏幕上。 I delete that and then everything was building fine again. 我删除了,然后一切都恢复正常。

You might need to add the device to the provisioning profile. 您可能需要将设备添加到配置文件中。 I experienced this on Xcode 6 and a real device. 我在Xcode 6和真实设备上体验过这一点。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM