Finished running <App> on iPhone 6.1 Simulator

安稳与你 提交于 2019-12-10 13:24:50

问题


I'm developing a new application for Iphone, using Xcode (Version 4.6 (4H127)) and the iPhone 6.1 simulator (Versión 6.0 (369.2)).

At the beginning everything was great: every time I pressed the "run" button, the application was loaded into the simulator and I was able to test it. But sometimes it is not working: when I press the run button, I only get the message "Finished running on iPhone 6.1 Simulator". The code successfully compiles (only minor warnings).

The main problem is that when I get this message, the only way I can use the simulator again (in this project, the rest of the xcode projects seems to work properly) is by starting a new project and adding every file to it.

I've tried to delete de derived data, restart de simulator, restart de computer, etc. Even I made a snapshot when the simulator was working, but when I go back to the snapshot state, the simulator still don't work.

What can I do? Any idea?


回答1:


1.Manually launch the iOS Simulator.

2.From the "iOS Simulator" menu, click "Reset content and settings",

3.Close and rebuild your app.




回答2:


This problem may arise when you have problems with your project's plist's target membership. Select your info plist file from project navigator folder structure's Supporting Files, go to interface builder pane(Utilities Section under View in Top Bar), then look for Target Membership in File Inspector pane, if it is checked, uncheck it. Clean & Build, Hope it helps.




回答3:


Library > Application Support > iPhone Simulator > 6.1 (or whichever you're using) > Applications > Your Application and delete it.

Rebuild your app and relaunch.


回答4:


I had the same problem, with the same "failed to attach to process ID 0" (I actually didn't notice that error until I saw that you said you had that error). In one of my projects the 6.0 simulator didn't work, but works in my other projects. Also my 5.1 simulator worked.

What worked for me was based off this other answer for a similar question: https://stackoverflow.com/a/12423912/159758

  • Go to the Product menu and find the Edit Scheme menu there.
  • While in Edit Scheme window, select the "Run" option on the left hand side of the screen and then on the right hand side, change the debugger from LLDB to GDB.
  • Run the project, this worked in the simulator.
  • Then Go back to the Edit Scheme and set back to LLDB.

I noticed you've tried setting the debugger to GDB and not a debugger, but thought I'd mention what helped me, since you're question helped me get to the bottom of my problem (i.e. seeing the "failed to attach to process ID 0" message).




回答5:


This problem may arise due to presence of more than one info.plist file.

I also faced a similar problem, and eventually found that while adding some resource file from another project I also added its info.plist file.

Once check your Build phases> Copy Bundle Resources, whether another info.plist file exist there or not. If exists then delete it, clean the project and rebuild it. Hope it helps.....




回答6:


I ran into the same issue and somehow was able to fix it and almost immediately it went back to being broken. I can tell what broke it though.

I added a couple of folders (folder references) with files in them to the copy bundle resources section. That broke it. If I recall right, I had removed both of those and was messing around with DeploymentTarget. I might have reset the simulator earlier. Regardless, it started working. So,

  • there is hope for a fix
  • this thing is caused by folder resources that need to be copied into the bundle

Updated:

I was able to get it working again. Here is what I did.. - Cleared out the derived data folder - Shut down the simulator app - Also cleared the deployment in the simulator folders (Users/XXXXXX/Library/Application Support/iPhone simulator/6.1/Applications)

Since last time adding the folders to the bundle caused it to lock up, I tried it step by step adding one folder to the bundle and trying. Turns out one of my folders was named Resources and it dawned on me that particular name could potentially be colliding with something else the app looks for. So I renamed that folder to Res and tried it. It works now.

So there you have it.. Follow the steps above to get out of the problem. Avoid copying folders called Resources to your bundle.



来源:https://stackoverflow.com/questions/15020164/finished-running-app-on-iphone-6-1-simulator

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!