I have a Xcode project. Just a simple dummy project that I use for compiling for VS2019 on my windows. VS2019 can't open the storyboard any more after I updated windows, vs2019 and Mac.
So I tried to run it on my Mac first, and should everything work I could try my VS2019 project again.
I also have Visual Studio for mac installed. When I create the same dummy project for my Xcode project the storyboard does not open in design mode.
I get the same error every time. The connection between my windows Xamarin project works. But also I get the same error here. The Storyboard won't open in design mode.
Mac :
Error : Unable to erase contents and settings in current state: Booted
VS2019 : Couldn't find a Devicelog for [ConnectionAttributes:Device=Undefined......
What have I tried already:
Everything is updated, no more updates are available.
I've removed all my devices in the simulator and added them back again.
I've opened my storyboard in Xcode and saved it.
I've removed my storyboard and added a new one.
Firewall is disabled, so that should not be a problem.
Xcode : 11.2.1 (11B500)
Visual Studio : 8.3.10 (build 2)
IOS : Catalina 10.15.1
Every forum, every site I've read already. A least that's how it feels.
I really could use some tips.
This is the complete error:
System.AggregateException: One or more errors occurred. (One or more errors occurred. (Exception of type 'MonoTouch.Design.Client.InvalidSessionException' was thrown.)) ---> System.AggregateException: One or more errors occurred. (Exception of type 'MonoTouch.Design.Client.InvalidSessionException' was thrown.) ---> MonoTouch.Design.Client.InvalidSessionException: Exception of type 'MonoTouch.Design.Client.InvalidSessionException' was thrown. ---> Foundation.NSErrorException: Error Domain=com.apple.CoreSimulator.SimError Code=165 "Unable to erase contents and settings in current state: Booted" UserInfo={NSLocalizedDescription=Unable to erase contents and settings in current state: Booted}
at MonoTouch.Hosting.Device.ResetContentAndSettings () [0x0001d] in <04dc5ca6c35a46aa8bc6e6cd7c986dae>:0
at MonoTouch.Design.Client.Mac.MacServerProcessConnection.EnsureServerRunning (System.Boolean throwIfNotRunning) [0x000ff] in /Users/runner/runners/2.160.0/work/1/s/Xamarin.Designer.iOS/MonoTouch.Design.Client.Mac/MacServerProcessConnection.cs:298
--- End of inner exception stack trace ---
And more but the number of characters is restricted.
The solution was to install Mojave in stead of Catalina and reinstall everything. Keer both sides of the mac and pc sync.
I was able to fix the problem with the following command in terminal:
xcrun simctl shutdown all
Update: Seems like this issue starts when you force close apps. After two days of successful work I received the same message. I did command above, after that added xcrun simctl erase all, rebooted. Issue was still there. Finally I got how to fix it.
Solution: You should open xib, it will start spinning and during that open terminal and run xcrun simctl shutdown all. After that the issue will be resolved.
Related
I have recently upgraded the Mac OS to Ventura 13.2.1 and Xcode to 14.2, now once I try to compile any application with Xcode, I am getting Kill:9 related issue for random task/framework in the project. I also get Kill:9 issue sometime on terminal as well.
Listing the errors here:
failed to read asset tags: The command `` terminated with uncaught signal 9. The command had no output.
Driver threw jobFailedWithNonzeroExitCode(9, "") without emitting errors.
Unable to execute command: Killed 9 Clang frontend command failed due to signal.
Please help me to resolve this issue/crash.
Open project in Xcode.
Build the app with Simulator (I tried with iPhone 14 Pro)
Error occurs in the build
Ideally project should have compiled without any error.
It sounds to me that the problem is with the installation of Xcode because when an unprivileged task is attempted, the OS will kill it off (with signal 9).
What I recommend is for you to re-install Xcode.
When you first run the new Xcode, it should prompt you for an administrator password in order to install system related components. Make sure you do this step. Hopefully that should then allow you to compile and run your iOS apps.
While debugging any iOS application, Xcode builds and run successfully, also launches a simulator but it is not able to attach debugger from Xcode 14 to Simulator iOS app.
It throws an error in Xcode:
Xcode console says:
Could not attach to pid : “75997” Domain: IDEDebugSessionErrorDomain
Code: 3 Failure Reason: attach failed (Not allowed to attach to
process. Look in the console messages (Console.app), near the
debugserver entries, when the attach failed. The subsystem that
denied the attach permission will likely have logged an informative
message about why it was denied.) User Info: {
DVTRadarComponentKey = 855031;
IDERunOperationFailingWorker = DBGLLDBLauncher;
RawUnderlyingErrorMessage = "attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the
debugserver entries, when the attach failed. The subsystem that
denied the attach permission will likely have logged an informative
message about why it was denied.)"; }
Tried with re-installing Xcode and Command line tools, but issue persists.
Steps:
Build and run app with Debug executables true
Simulator gets launched
Error on Xcode and it gets disconnected from simulator
Is there a possibility that it can be blocked by any other app, if so how to identify ?
I solved the issue by doing the steps below:
SOLUTION 1:
Edit the scheme
Select Run
Select Build Configuration "Debug"
Select "Wait for the executable to be launched"
Close
Run the app
see the screenshot here
You will receive an error message when you run the app again.
Close the app.
Edit the scheme again and change "Wait for the executable to be launched" to "Automatically".
Now your simulator will work as expected.
SOLUTION 2:
Delete your app folder in Derived Data
/Users/[your username]/Library/Developer/Xcode/DerivedData/
Search your app name folders and delete them.
SOLUTION 3:
Open the terminal and run:
sudo DevToolsSecurity -enable
This command enables the Developer Mode. After running the command you will receive this message: [Developer mode is now enabled].
Sometimes it's happen, when you are trying to build too fast after a build has started.
First of all, quit your current simulator, delete derived data and clean the project, wait until whole processing is complete. Then do some changes / editing if required (as we clean all data) and try running on a different simulator.
Check certificates in key-chain access, if you found any untrusted certificates in key-chain access remove it.
Also if you are using beta version just make sure it is downloaded from Apple official website.
Came here to share my (strange) solution if anybody crosses the same problem with no answers working. In my case, no solution from this nor other SO answers to similar questions worked (cleaning, rebuilding project, updating, clearing derived data..)
My setup is:
Macbook M1 2022 + Xcode Version 14.2 (14C18)
This Xcode version could not attach to any of my apps (fresh new or previously developed) on different simulators (11, 12, 14) with iOS versions 13.7 - 16.2.
Editing scheme solution from answer above was not working also so I ended up in leaving scheme as:
Build configuration: Release
Debug executable Deselected(!)
Launch Automatically
And magically debugging app in Xcode started working even though it's release version with debug option deselected.. Selecting Debug executable again makes Xcode not possible in attaching to app process
Just to clarify: above steps actually makes app to run as in DEBUG mode - Xcode attaches to pid, I can do console logs and breakpoints. This Xcode version behaves opposite than options selected
My project is running fine in Xcode 11.3 but recently when I upgraded to Xcode 12 app is not getting installed in simulator and showing the error - Could not install at this time.
Failed to get FD to bundle executable....
I suddenly had the same problem, after years of work on the same project across several versions of Xcode and MacOS.
On Xcode 12.4 and MacOS 10.15.5, although everything was working fine, suddenly I got this error popup "Failed to get FD to bundle executable" while trying to Run the project on a(ny) Simulator.
I tried all the proposals I could find online, including changing the Executable Type (which had never changed) or clear the empty env vars defined in the Build settings (there weren't any). Uninstalling/reinstalling Xcode didn't help. Upgrading to MacOS 10.15.7 didn't either. Of course the Apple Support has been of no use at all (they replied with a few general FAQ links about how to use Simulator).
The only thing that worked for me was to checkout the project in a different folder...
The weird thing is, if I rename again my new folder to the initial folder name, it does the error again! It sounds to me like a MacOS bug and/or an Xcode bug.
Error running `xcrun simctl install 95F3A7B0-67B3-490E-B798-D1CBBF813B83 /Users/yakjuly/.expo/ios-simulator-app-cache/Exponent-2.21.3.tar.app`: An error was encountered processing the command (domain=IXUserPresentableErrorDomain, code=1):
Unable To Install “Expo Go”
Please try again later.
Failed to get FD to bundle executable at /Users/yakjuly/Library/Developer/CoreSimulator/Devices/95F3A7B0-67B3-490E-B798-D1CBBF813B83/data/Library/Caches/com.apple.mobile.installd.staging/temp.Nf39ZM/extracted/Exponent-2.21.3.tar.app/Expo Go
Underlying error (domain=MIInstallerErrorDomain, code=4):
Failed to get FD to bundle executable at /Users/yakjuly/Library/Developer/CoreSimulator/Devices/95F3A7B0-67B3-490E-B798-D1CBBF813B83/data/Library/Caches/com.apple.mobile.installd.staging/temp.Nf39ZM/extracted/Exponent-2.21.3.tar.app/Expo Go
I have this problem when I get started with react native.
The issue for me is the file in /Users/yakjuly/.expo/ios-simulator-app-cache/Exponent-2.21.3.tar.app is broken. After I delete this file and re-run the command. it succeeds installing app in iOS simulator.
What solved this for me was the following:
close emulator
clean project and build folder
Shortcut: Command+Shift+K
GUI: Menu Bar -> Product -> Clean/Clean Build Folder
restart emulator
Xcode 13.2.1
The following steps helped me -
1. Select simulator
2. Goto Device
3. Select -> Erase All Content and Settings...
Hopefully, now you will be able to install and run the app on your simulator.
For context I am working with a fresh install of macOS Mojave and a fresh install of Xcode 10.1.
The first thing I noticed was I only had the option of
Generic iOS Device from the simulator drop down list. It seems Xcode did not download any iOS simulators with it like I thought it was supposed to.
So I went looking in the simulator list, and it was empty. So the next logical step is to try and create a simulator. Where I only found the ability to download simulators. So I downloaded four simulators and went back to try and create them. Nothing changed, I could still only download simulators. I wasn't about to select a device or a simulator.
I have tried restarting Xcode, the OS, and reinstalling Xcode none of which have worked. I have tried deleting DerivedData, but that didn't work either. So, I am now at a point where my Google searches are just turning up the same tired answers, and I am getting no where.
Edit
Here is the error message I get if I try to build anything, if it helps.
2018-12-07 05:49:31.315 ibtoold[1550:71807] Error
Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo=
{NSLocalizedDescription=CoreSimulator.framework was changed while the
process was running. This is not a supported configuration and can occur
if Xcode.app was updated while the process was running. Service name
((null)) does not match expected service name
(com.apple.CoreSimulator.CoreSimulatorService).} 2018-12-07 05:49:31.315
ibtoold[1550:71807] Failed to load CoreSimulatorService. Access to
simulator services will not be available. Error=Error
Domain=NSPOSIXErrorDomain Code=61 "Connection refused" UserInfo=
{NSLocalizedDescription=CoreSimulator.framework was changed while the
process was running. This is not a supported configuration and can occur
if Xcode.app was updated while the process was running. Service name
((null)) does not match expected service name
(com.apple.CoreSimulator.CoreSimulatorService).} 2018-12-07 05:49:31.400
ibtoold[1550:71824] CoreSimulatorService connection became invalid.
Simulator services will no longer be available.
I was facing the same issue. I tried each and everything that Google has said. But didn't find any solution. So, finally, I removed all the Xcode from the system and update the mac os with Mojave 10.14(earlier it was 10.13). Then I reinstall the Xcode 10.1. This time Xcode asked the permission to install extra components. After installation of these components, I am able to see the list of all the simulators.
The problem, what I have observed, was that there was no device present in the core simulator folder under the library/developer. Please check if this folder present or not on the following path: Users/Library/Developer/CoreSimulator/Devices.
Xcode 9.2 debugging on an iOS Simulator has completely broken for me.
I worked on this for hours and tried a ton of suggestions short of completely wiping my hard drive and starting out with a fresh operating system install. I ended up filing a bug with Apple. Posting here in case anyone has encountered this problem and has any suggestions.
Summary:
When try to build and run in debug mode with a debug executable. The simulator only opens the application to a white screen and then Xcode pops up an error:
Could not attach to pid: "<a process id>"
Ensure "<app>" is not already running, and "<user>" has permission to debug it.
Steps to Reproduce:
Make any project and try to run on any simulator.
Expected Results:
Debugger successfully attaches to debugger.
Actual Results:
Debugger is never able to attach to the iOS simulator process/app for debugging.
Debugger CAN attach and build and run successfully on a physical device.
Version/Build:
- Xcode Version 9.2 (9C40b)
- macOS Sierra 10.12.6
- Any iOS project
- Any iOS simulator
Other notes:
- Xcode 9.2 was working fine until this problem randomly started. The error initially said:
Failed to initiate service connection to simulator
DTServiceHubClient failed to bless service hub for
simulator iPhone 8 Plus <simulator identifier>
- After rebooting computer, the error shifted to "Could not attached to pid..."
I tried dozens of suggested solutions short of completely wiping my computer including:
Resetting device contents and settings on simulators
Create a new device (even different device and OS combinations)
Try different Xcode projects, even simple one-off single view applications
Looking at the etc/hosts file and verifying localhost can be pinged
Restarting computer multiple times
Deleting out derived data (multiple times)
Let it build and run without attaching debugger, then try to attach debugger by "attach to process id"
Completely uninstalling Xcode and all simulators, and reinstalling.
Removing any invalid certificates in keychain
It turns out our security software was blocking the debugger. Running sudo sysdiagnose helped me find a log entry showing that it was being blocked. The software is Cb Defense (Carbon Black Defense). Apparently the only workaround is for your security team to whitelist by a hash, and that hash could change in the future.
There is a bug in Xcode 9.0-9.2 that causes this issue to appear after running for a while. If you log out and back in it should resolve it for you.