Xcode 7: Failed to launch iOS stub for playground execution after making changes

I recently upgraded from Xcode 6 to Xcode 7 on my MacBook Pro running Yosemite.

After opening a previously saved Swift playground, I attempted to make changes in it. More often than not, this results in the following error message and the playground does not execute.


Failed to launch iOS stub for playground execution: error: attach failed: unable to attach.


I tried creating a new playground and the behavior is the same. Eventually, making a change results in the error above.


The only way to recover and it's only temporary because the error reoccurs is to stop and restart Xcode.

Here is some additional info for this. Just now, I restarted Xcode 7, opened my playground file and simply added a blank line at the bottom. The playground is now stuck on "Running My Playground". I opened Console and found this.


9/18/15 2:40:42.154 PM Xcode[1543]: [MT] DVTAssertions: Warning in /Library/Caches/com.apple.xbs/Sources/IDELanguageSupport/IDELanguageSupport-8165/IDELanguageSupportUI/Playground/Document/IDEPlaygroundDataSerializationCoordinator.m:148
Details:  serializedPlaygroundDataPath does not exist in file system: /var/folders/d8/tg88jkd94cl1_zh23cv8trz40000gn/T/com.apple.dt.Xcode.pg/serialization/playgroundserialization-1569-4
Object:   <IDEPlaygroundDataSerializationCoordinator: 0x7fb88c8711a0>
Method:   -handleNewSerializedPlaygroundDataAtPath:forPlaygroundDocument:
Thread:   <NSThread: 0x7fb88ad3d690>{number = 1, name = main}
Please file a bug at http://bugreport.apple.com with this warning message and any useful information you can provide.


And I also found this, repeated several times.


9/18/15 2:46:25.633 PM com.apple.usbmuxd[83]: SCEDeviceSocketCallback 0x7f853c9038c0-Xcode/com.apple.dt.Xcode remote peer closed connection for sce 0x7f853c9038c0.
9/18/15 2:46:25.634 PM Xcode[1678]: CompanionProxy: CPXCopyValueFromPairedDevice:490 (0x0x11f5e5000): Failed to receive response: 0xe800000e
9/18/15 2:46:26.378 PM Xcode[1678]: AMDeviceSecureStartService (thread 0x11f5e5000): Starting services on paired watches not supported

Can confirm this also happens running Xcode version 7.1 (7B91b) under El Capitan. Starting new playground throws this error most of the time. Most of the time, clicking "OK" clears the error; that is, I can type in some code and have it properly interpreted. Some of the time, execution hangs with the Running <playground name> message.


Also most of the time, restarting Xcode and reloading the playground fixes the problem, but this seems to be an unnecessary interruption in workflow. I've seen no consistency with this issue as other running processes affect it.

Same problem here with Xcode version 7.1.1 (7B91b) with Yosemite. Exactly, restarting xcode and reloading files takes alot of time.

This also appears to be happening with Xcode Version 7.3 beta (7D111g) The only difference with my error is that "iOS" is ommited even though it is an iOS playground.


"Failed to launch stub for playground execution: error: unable to attach."


Is this a bug that's existed since the release of Xcode 7 or is there a fix to this? I've only just started to learn Xcode so forgive me if any of my comments appear to have obvious answers.


Thanks

Same here, also getting this ocasioanly on the playgrounds, Xcode version 7.3 beta (7D129n).


I reat something on Stackoverflow about firewall conflicts, some people got it solved by allowing TPC out on 127.0.0.1:63748. Looks like I'm not one of them...


Any ideas?

I'm getting this same error. It started after a short error-free run with Xcode 7.2.1 on El Capitan using Playgrounds and messing with imports. At first I thought I had made the error happen with my edits to import some framework.


My troubleshooting so far consists of re-launching, re-starting, temporarily moving my user Xcode custom prefs and plugins out of the way.

Installing the new beta Xcode Version 7.3 beta (7D129n) does not help.


The error is consistent or constantly there in all Playgrounds, including fresh new Playgrounds on both versions of Xcode I have.


I guess the problem is something to do with a configuration file that is shared from the system or user libraries folders.

also seeing this error with xcode 7.3.1 (7D1014) on osx 10.11.5. Thanks

same for me 😟

MacBook Air (13 Zoll, mid 2011)

Hi


I have the same problem. Did you find a solution?


-Jon Hjerting

I'm experiencing the same issue with XCode 8.2.1, on a late 2014 MBP. Persistent after restarting XCode, and after uninstalling it and installing a new build. Really desperate for some kind of solution..

I'm facing the same issue with Xcode 13.1 as well. Please help me to solve this issue.

Xcode 7: Failed to launch iOS stub for playground execution after making changes
 
 
Q