Sagar
Sagar

Reputation: 555

Xcode indefinitely "Attaches to AppName"

I run a Mac OSX 10.7 and an Xcode 4.2.1, everything was fine until a few hours ago when my xcode suddenly hangs when i try to run the simulator! This is what Happens

  1. The code builds successfully but it indefinitely says "Attaching to AppName"
  2. Also, when i try to put it on a device it says "Valid signature not found"
  3. Sometimes it allows me to archive the app, and when i do download it onto my device (via Test Flight) the app does not get installed on the device!

These are all the things I've tried (with no success!)

  1. restart xcode and/or restart simulator (reset content and settings) and/or restart computer.
  2. click on project name in project navigator. in build settings tab, go to packaging and make sure that "Product Name" is the same that the one xcode says simulator is attaching to when running. if they are different, it will fail.
  3. go to your projectname.xcodeproj folder. inside there delete anything named with your userid. when you reopen xcode those files will be recreated and it should work…
  4. Manually delete the build directory for your project.
  5. Go to organizer window. select Projects, select your app in the left hand side and then delete over "Derived Data"
  6. Check Launch option is set to "Automatically" in Product->Edit Scheme, "Run" scheme.
  7. In Project->"Edit Schemes"->Run. Change the Debugger from GDB to None (this doesn't make sense to me..).
  8. Kill the process gdb-i386-apple-darwin from Activity Monitor. this is assuming gdb is not responding.
  9. In "Product"->Edit Scheme. in Run, click yourappname.app, choose other, navigate to your .app in your project. now run.
  10. Check that you don't have two different Info.plist in your project. if you do, remove the bad one.

Also, I use Git for Version control, and I've been doing so for a month now without any problems! I dunno if this might actually cause a problem (in terms of how xcode manages its resources!) but im just giving out all the information I can, in hope that I can find a fix for this! Any help will be greatly appreciated!

Upvotes: 2

Views: 1124

Answers (5)

David
David

Reputation: 2810

Rebooting the Mac usually works for me. Awful that this is necessary.

Upvotes: 1

Sagar
Sagar

Reputation: 555

So after loosing an entire weekend, i managed to fix the problem and some sleep, i managed to fix the problem (with some help). Here's what i did:-

  1. I had a directory in my project folder called "Resources". I changed the name of the directory.

  2. I had written a build script and an Encrypted file URL protocol class that references to the Directory "Resources". I updated them accordingly to the new renamed directory.

  3. Deleted all build folders and derived data. Making sure there was no reference to any "Resources" directory on my Laptop!

And it worked just fine. From now on, i won't be naming any directory in my project "Resources". Apparently it is known to throw weird errors at you!

Hope this helps to all of you avoiding the mistake i made!

Upvotes: 3

Saurabh
Saurabh

Reputation: 22873

Delete the build folder from here - ~/Library/Developer/Xcode/DerivedData

And press command + r

Upvotes: 0

Ben
Ben

Reputation: 1302

This has happened to me a lot lately. I fix it by performing a clean, shutting down and restarting both the mac and the iPhone. Hope it works for you too. I've never been able to fix it without a restart somehow!

Upvotes: 0

Warren Burton
Warren Burton

Reputation: 17382

Try deleting the app from the simulator itself. A clean in xcode won't do this and sometime the debugger gets in a twist with the current copy.

Browse to ~/library/iPhone Simulator/<version>/Applications and hose everything in there or just search around till you find the right one for your app and delete that.

A reason for being more discriminating when you delete is that might want to keep documents from those folders if your app makes documents.

Upvotes: 0

Related Questions