6

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?

Robert
  • 5,278
  • 43
  • 65
  • 115
jmatamoros
  • 514
  • 1
  • 5
  • 14
  • 2
    Reset the simulator. no need to develop a new project every time. – Apurv Feb 22 '13 at 08:53
  • In build setting, What's your deployment target? Is that set properly ? – Nikunj Feb 22 '13 at 09:04
  • Nothing happened :-( Thank you – jmatamoros Feb 22 '13 at 10:41
  • @OKNC2, I think the build settings are correct: Debud (Yes), Base SDK (Latest iOS), Architectures (Standard armv7, armv7s), valid architectures (armv7 armv7s)... Do you need any specific information of the build setting? Thank you – jmatamoros Feb 22 '13 at 10:44
  • 1
    Ok, I just realized that the output was error: "failed to attach to process ID 0". This problem was treated in many other threads. I'm not able to solve this already, but I think I should close this thread. Thank you to all of you who answered! – jmatamoros Feb 22 '13 at 11:43
  • Once you solve it, post your answer and accept it. (Or accept someone else's if their answer worked.) – Robert Feb 25 '13 at 11:48
  • I didn't solved yet, so I cannot choose any of the answers as the correct one. I'm sorry :-( – jmatamoros Feb 26 '13 at 10:39

6 Answers6

11

1.Manually launch the iOS Simulator.

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

3.Close and rebuild your app.

Shamsudheen TK
  • 30,739
  • 9
  • 69
  • 102
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.

Tarun
  • 152
  • 7
  • It was unchecked, but anyway I tried to check, uncheck. clean and rebuilld, but nothing happened, still not working. Thank you anyway – jmatamoros Feb 22 '13 at 09:45
  • Go to **File -> Open Recent**. See this list, **if same project name appears in this list more than one time**, maybe this is causing the problems. If so, you have to clean it up, by deleting these opened project workspaces from Xcode environment. – Tarun Feb 22 '13 at 10:08
1

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.

Robert
  • 5,278
  • 43
  • 65
  • 115
  • 1
    Since I made a "Reset content and setting" in the simulator, the application is not in the simulator anymore, so there's not an "Application" folder in the 6.1 folder. Thank you – jmatamoros Feb 22 '13 at 09:47
  • Bit of a long shot but have you tried getting rid of the warnings then rebuilding? – Robert Feb 22 '13 at 10:05
  • Now I have not any warning at all and still "finished running..." :-( – jmatamoros Feb 22 '13 at 10:53
  • Another long shot: Go to `Product > Scheme > Edit Scheme` select `Debugger` and change from `GDB` to `LLDB` (or vice versa). – Robert Feb 22 '13 at 11:02
  • When I set the debugger to GDB, it seems that xcode freezes with the message "Attaching to XXX.app" and the output: GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Thu Nov 15 10:42:43 UTC 2012) Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "x86_64-apple-darwin". sharedlibrary apply-load-rules all – jmatamoros Feb 22 '13 at 13:10
  • Even if I don't set any debugger, I cannot atach the application to the debugger – jmatamoros Feb 22 '13 at 13:11
  • Hmmm... I'm out of ideas, I'm afraid. – Robert Feb 22 '13 at 14:24
1

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

Community
  • 1
  • 1
DonnaLea
  • 8,643
  • 4
  • 32
  • 32
  • I couldn't find the correct answer to my problem, but since the last time I re-created the project it is working properly. I did everything like always, the only difference is that now my mac-user has not administrator privileges; I don't know if this affects something, but I haven't now all those problem. – jmatamoros Mar 20 '13 at 06:41
  • Well, glad it's working for you now anyways. It's an annoying problem for sure. – DonnaLea Mar 20 '13 at 07:49
1

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

1

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.

Shammi
  • 492
  • 5
  • 13