Finished running on iPhone 6.1 Simulator

2019-06-19 18:28发布

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).

enter image description here

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?

6条回答
对你真心纯属浪费
2楼-- · 2019-06-19 19:09

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

enter image description here Rebuild your app and relaunch.

查看更多
做自己的国王
3楼-- · 2019-06-19 19:10

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.

查看更多
看我几分像从前
4楼-- · 2019-06-19 19:10

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.

查看更多
成全新的幸福
5楼-- · 2019-06-19 19:12

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).

查看更多
姐就是有狂的资本
6楼-- · 2019-06-19 19:18

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.....

查看更多
姐就是有狂的资本
7楼-- · 2019-06-19 19:25

1.Manually launch the iOS Simulator.

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

3.Close and rebuild your app.

查看更多
登录 后发表回答