After installing XCode 7 I can't build and run

2019-02-10 21:44发布

问题:

EDIT: This question refers to teh pre-release version of XCode 7, hence it may not be relevant if you are running the currently released version as some issues may have been fixed.


I get the following:

Failed to connect with the iOS agent. Please file a bug report at bugreport.apple.com.

Why is that?

If I look at the details I get:

=================================

ERROR:

Failed to find or create execution context for description System content 1x for IBCocoaTouchFramework-EightAndLater w/ default fidelity (Failure reason: Software caused connection abort): Failed to find newest available Simulator runtime (Failure reason: Software caused connection abort): Simulator verification failed. (Failure reason: A connection to the simulator verification service could not be established.)

Error Domain=NSPOSIXErrorDomain Code=53 "Failed to find or create execution context for description System content 1x for IBCocoaTouchFramework-EightAndLater w/ default fidelity" UserInfo=0x7fcf5961ebd0 {NSLocalizedDescription=Failed to find or create execution context for description System content 1x for IBCocoaTouchFramework-EightAndLater w/ default fidelity, NSUnderlyingError=0x7fcf58b72950 "Failed to find newest available Simulator runtime"}

回答1:

I ran into the same issue with xcode 7 beta 3.

I had my deployment target set to 8.3. Setting it to 9.0, cleaning the build, and restarting xcode worked for me.



回答2:

Try deleting and reinstalling your Xcode beta, it worked for me on Xcode beta 3



回答3:

It seems this is a common issue. Found an answer over at Apple's developer forums:

https://forums.developer.apple.com/thread/11706

In case the link goes dead or you have no access, this is the accepted answer:

Correct Answer by seancook on Jul 21, 2015 5:58 PM

I experienced this, too, on El Capitan. NIBs wouldn't load, no Sims present, and unable to launch Simulators through the Xcode/Open Developer Tool/Simulator menu. After fighting it for a few hours I've finally got it working. Here's what worked for me (YMMV): I noticed a message in Console.app along the lines of the Simulator runtime not being code signed. I went to the path it described "/Library/Developer/CoreSimulator/Profiles/Runtimes" and removed the runtimes that I had there. They were old runtimes, so I assume that some check in Xcode now applies that didn't previously. Who knows?
After doing this, I could finally launch the Simulator via the Xcode/Open Developer Tool menu. Unfortunately, the Simulator still wasn't being shown as a run target in my workspace, so I kept spelunking... I then went into the Simulator's Hardware/Devices/Manage Devices menu and added a new iOS9 device. It didn't seem to do anything, so I quit out of Xcode and Simulator.app. I then re-started Simulator.app (via Xcode/ODT/Simulator) and lo and behold the expected iOS9 simulators were displayed. I closed and re-opened Xcode, changed the target OS for my project, and the Sims were finally displayed as run targets.

HTH.



回答4:

Verify you have the latest Xcode Beta installation with Xcode-beta open click "About Xcode" and check the build number.

Then check the Current build number of the latest Xcode-beta on the Xcode Downloads Page:

https://developer.apple.com/xcode/downloads/



回答5:

I got this error on with Xcode 7.0 release build (7A220). I was running on device too not using the simulator at all.

I did a full clean Clean build folder... option, close Xcode and then opened up Activity Monitor. I found a bunch of Ibtool processes running. I terminated all of these and restart Xcode.

All going again!



回答6:

I am not sure which answer to accept as for me what worked was installing a later beta (beta 5). I had filed a bug to Apple a couple of months ago so I assume they solved this problem by updating Xcode.

Anyone experiencing this with the current official release?

I post this as answer for now but if anyone has a more detailed explanation I will be happy to remove my answer and accept yours.



回答7:

First of all, your stack trace does not show anything relevant with the answer which I found, however, my stack trace also seemed me irrelevant. But it worked for me and hope that works for you:

Someone from Apple staff gave the answer at: https://forums.developer.apple.com/thread/3978

What was said is "We saw this in the labs at WWDC. The crash was caused by an offending custom color picker. Try removing any custom color pickers you have installed on your system"

In brief, delete related color picker from your system, close the xcode and relaunch.



标签: ios xcode xcode7