Build, test, and submit your app using Xcode, Apple's integrated development environment.

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Cannot preview in Xcode
My computer setup is I work from an account with regular (non-admin) privileges. I login into the admin account to install apps, update the OS, that kind of stuff, but work is from the reduced privileges account. And, when in it, I cannot preview swiftUI views in Xcode. Incredibly frustrating, have tried everything including a complete wipeout of the disk and reinstall, but no luck. Don't have any iOS simulator targets installed, it's macOS target I am working on. If I fire up xcode from the admin account it's all good, previes work and so on. Not so in the non-admin account, consistenly getting the "Cannot preview in this file. Failed to launch xxxx" Also tried elevating the privileges of the account to Admin, rebooting, no luck. Tried creating a new account, non-admin or admin, no luck. The detailed error repeats something along the lines of: == PREVIEW UPDATE ERROR: GroupRecordingError Error encountered during update group #3 ================================== | FailedToLaunchAppError: Failed to launch GIIK.Mesh-One | | /Volumes/Glyph 2TB/Developer/M4Book/Mesh One/DerivedData/Mesh One/Build/Products/Debug/Mesh One.app | | ================================== | | | [Remote] JITError | | | | ================================== | | | | | [Remote] XOJITError | | | | | | XOJITError: Could not create code file directory for session: Permission denied Most telling is the double space between directory and for on the last error line, it sounds like a failed string interpolation because the directory name was nil or empty? This is very frustrating (I also filed FB21900410). Am I missing something obvious? I also dumped the build settings and diffed the admin and non-admin accounts and they are an exact match (save for the path names). There has to be something that's preventing the non-admin accounts from previewing, anyone know what it might be/where to look? Cheers,
0
0
154
3w
MCP servers don’t start in Codex (Xcode 26.3)
I’m trying to use MCP servers with Xcode 26.3 Coding Intelligence (Codex agent). With a project-scoped config file at /.codex/config.toml, MCP servers are not reliably loaded. /.codex/config.toml Example: [mcp_servers.Notion] url = "https://mcp.notion.com/mcp" enabled = true [mcp_servers.XcodeBuildMCP] command = "/bin/zsh" args = ["-lc", "/opt/homebrew/bin/npx -y xcodebuildmcp@beta mcp"] enabled = true tool_timeout_sec = 10000 Expected: Xcode consistently loads MCP servers defined in /.codex/config.toml across restarts. Actual: Xcode often only exposes xcode-tools. In some sessions MCP servers appear, but after restarting Xcode they may disappear. The global file at ~/Library/Developer/Xcode/CodingAssistant/codex/config.toml also seems managed/rewritten by Xcode and isn’t reliable for custom MCP servers. Questions Is /.codex/config.toml the official/supported way to configure MCP servers for Codex in Xcode right now? Are there any requirements for Xcode to load it (e.g. workspace must be Trusted, open .xcworkspace vs .xcodeproj, full restart/force quit, etc.)? Is there any logging/diagnostics to understand why the MCP server is not starting or not being picked up?
0
2
134
3w
Cannot Preview in this file. Simulator was shutdown during an update.
Hello, I am facing a recurring issue with Xcode iOS simulator (preview). I want to preview a SwiftUI for iOS in Xcode, but the Simulator app fails to boot up. I receive the following error in Xcode: Cannot Preview in this file. Simulator was shutdown during an update. I have tried the following: Completely uninstalling XCode and deleting all developer data, then reinstalling everthing again. Shutdown and restart Deleting all developer data, deleting XCode cache Reinstalling iOS Simulator runtimes and reconfiguration of simulators. Tested using different simulator and runtime versions. "xcrun simctl --set previews delete al" My reported issues: FB20987522 FB20485454 Thank you Best regards, Jens
5
0
379
3w
xcode 16 ios 18.0 simulator download failed
I installed xcode 16 and both Predictive Code Completion Model and iOS 18.0 Simulator Failed Download. I can live without the code completion, but I can not get any Simulator to install. I clicked of the info button and it shows the following: Download failed. Domain: DVTDownloadableErrorDomain Code: 41 User Info: { DVTErrorCreationDateKey = "2024-09-30 15:57:24 +0000"; } Download failed. Domain: DVTDownloadableErrorDomain Code: 41 Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({ RequestedBuild = 22A3351; }) Domain: DVTDownloadsUtilitiesErrorDomain Code: -1 Download failed as the server said authentication failed. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime) Domain: com.apple.MobileAssetError.Download Code: 41 User Info: { checkServer = 1; } System Information macOS Version 15.0 (Build 24A335) Xcode 16.0 (23051) (Build 16A242d) Timestamp: 2024-09-30T10:57:24-05:00
9
2
7.1k
3w
Xcode 26.2 / iOS 26.2 Simulator not downloading
Hey all, I recently updated to Xcode 26.2 and I'm having the hardest time trying to download the corresponding iOS simulator. I installed Xcode from developer downloads and the app did not come loaded with an iOS simulator. When trying to download from Components in Settings, I only get the following message: Download failed due to a bad URL. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime) Domain: com.apple.MobileAssetError.Download Code: 49 User Info: { checkConfiguration = 1; } I also tried downloading via Terminal but also get a download failed message. I am on the latest macOS and have over 600 GB of disk space available. In previous versions, I was able to download the iOS simulator directly from Developer Downloads, but anything after 26 is not there. Any suggestions?
12
3
1.5k
3w
How does Xcode26.3 Agent know about the API Documentation for non Apple Intelligence
Lets say I use a SDK that has some custom components .ie. Liquid Glass but with neon background (just for fun) . This SDK has comprehensive API Docs . Currently Xcode provides DocumentationSearch mcp tool only for Apple APIs . Is there a way to enhance api search beyond Apple SDKs , for examples seeing the definitions in xcframwork. If not can Xcode connect to local/hosted mcp-servers . Or do these have to be modified in Claude settings.
2
0
477
3w
XCode 12 - Can't login to Github without Access Token???
Hey, so I wanted to pull from the Github project repository and XCode asked me login again. Forgot my password so I tried a wrong one and now it keeps asking for my Username and Access token, when I actually just want to login with my password. Doesn't let me choose between the too, not even when adding the account through preferences. Anyone know how to just login with password and the reason for this -pardon me- absolutely idiotic choice of not letting the user choose?
9
1
22k
3w
SpringBoard Crashes on macOS Simulator When Receiving Critical Alerts
I’m experiencing a consistent crash of SpringBoard on macOS when running my iOS app in the Simulator. The crash occurs specifically when a critical alert (geofence notification) is triggered by my server and delivered to the app. Xcode version: 16.4 macOS version: 15.5 App uses UNUserNotificationCenter with critical alert notifications related to geofencing. When the critical alert is received, SpringBoard quits unexpectedly on macOS, crashing the Simulator UI to the home screen. The notification is delivered by Firebase, and I have updated to the latest version of that. The console shows: XPC connection interrupted [C:1] Error received: Connection interrupted. [C:1-2] Error received: Connection interrupted. This does not happen when testing on a real device — the app works fine there, however, Springbaord still crashes on macOS. Please advise if this is a known issue or if there’s a workaround. This severely impacts development and testing of location-based critical notifications. The last time I tested this functionality, with an older version of Xcode, I had no issues. Thank you for your help.
3
0
176
3w
Tahoe 26.2 and Xcode
I need to use Xcode version 16 for a college project. However, I cannot install it on my mac. M2Pro - ios Tahoe 26.2. Is there any workaround for this? Is my best option to downgrade to Sequoia? I'm a little apprehensive about this but willing to give it a try. Can anyone recommend a good, reliable video for this?
2
0
182
3w
xcode 26.3 claude agent not login
I've connected my Claude account into Coding Intelligence and working properly (opening a web browsing and connecting my account), but when I press Claude Agent it sayes that I have to login againt. When I press the Account login with Claude.ai account, a web browser is opened, but it never finished the flow and I have an infinite spinner. Apple M2 Pro with macOS 26.2 (25C56)
0
3
91
3w
Adding Github Account to Xcode
I've been trying to add my Github Account to Xcode, but even with my user name and access token, all I get is a spinning wheel. No error message, no feedback. Nothing. I'm going to do it from terminal but this seems just poor. Especially, since there's no feedback from XCode on what the problem is. Any help would be nice.
0
1
25
3w
Cannot preview in this file – SwiftUI Preview referencing deleted simulator
I'm running Xcode 26.2 (17C52). After deleting all simulators and creating new ones, SwiftUI Preview stopped working. Xcode reports: “Simulator [D774B214-XXXX-XXXX-XXXX-XXXXXXXX8288] failed to boot and may have crashed.” However, when I list all available simulators using xcrun simctl list, there is no simulator with that identifier. It seems Xcode is still referencing a previously deleted simulator. I have tried: Deleting all simulators again Creating new simulators Restarting Xcode and the system But the issue persists and Preview still fails to launch. Has anyone encountered this issue or knows how to clear the cached simulator reference used by SwiftUI Preview?
2
0
88
3w
Frameworks and library dependencies
I have a framework, which depends on a library (GPGME) to do its actual encryption. As a consequence of using this external library, there are header files which have GPGME types in them... @interface E3Gpgme : NSObject ... /*****************************************************************************\ |* Call GPGME to sign \*****************************************************************************/ - (int) signWithMode:(gpgme_sig_mode_t)mode userId:(NSString *)signingKeyOrEmail srcStream:(E3Stream *)src dstStream:(E3Stream *)dst error:(NSError **)error; ... @end . This means the E3Gpgme class header file has to #import <gpgme.h> to get those type definitions. That is then proving problematic because the framework modularisation fails, with <e3gpgme.h> obviously not being a part of the framework, so the project refuses to build. I can see a few ways around this: Just don't run the modularisation check. That doesn't sound like a fantastic option import the GPGME headers (there's only 2) into the project and bundle them as if they were project ones. Again, not a great option, I don't expect GPGME to change its API but it runs the risk of there being a mismatch in future if the library code itself remains external. So what's the best-practice for requiring a dependency on a library, not a framework ? Is there a way to copy the library binary into a folder inside the framework folder and make sure you link with that ? Assuming that's the shared library it ought to still be ok for the LGPL licensing... Is there a better way ? I'm sure I'm not the first person to run into this :)
0
0
26
3w
Xcode 16 Doesn't Display "Swift Compiler" Build Settings Sections
I am editing my iOS project in Xcode 16 and want to use the "Swift Compiler - Upcoming Features" section of the build settings to selectively enable the new Swift 6 language features. I have read the instructions for doing this and have dowloaded an Apple sample project and can see that section under the project and target-level Build Settings in the sample project However, when I open my Xcode project in XCode 16 that section does not appear. Is there any way for me to influence how Xcode 16 displays the build settings? In fact, no "Swift Compiler" sections appear at all under my project Build Settings (All | Combined). There is a "User-Defined" section that has the Swift Version, Compilation Mode and Optimization level. The project itself is several years old and was on a very old project version. I have upgraded my project document format to "Xcode 16" but it made no difference. I have compared my project and the sample project in a text editor and both seem to have similar structure. I tried removing unused and outdated settings from my project but that also had no effect. Is there an alternative to deleting my project file and adding the source files to it? I have a large project with multiple targets so that would be something I'd rather not do.
4
3
1.1k
3w
Xcode 26 CompileMetalFile failed
"EnableLiveAssetServerV2-com.apple.MobileAsset.MetalToolchain" = on; ProductName: macOS ProductVersion: 26.0.1 BuildVersion: 25A362 The MetalToolchain is installed, however I keep getting error that MetalToolchain cannot be found by the Xcode "Command CompileMetalFile failed with a nonzero exit code" error: error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain ❯ xcodebuild -downloadComponent MetalToolchain 2025-10-31 11:18:29.004 xcodebuild[6605:45524] IDEDownloadableMetalToolchainCoordinator: Failed to remount the Metal Toolchain: The file “com.apple.MobileAsset.MetalToolchain-v17.1.324.0.k9JmEp” couldn’t be opened because you don’t have permission to view it. Beginning asset download... 2025-10-31 11:18:29.212 xcodebuild[6605:45523] IDEDownloadableMetalToolchainCoordinator: Failed to remount the Metal Toolchain: The file “com.apple.MobileAsset.MetalToolchain-v17.1.324.0.k9JmEp” couldn’t be opened because you don’t have permission to view it. Downloaded asset to: /System/Library/AssetsV2/com_apple_MobileAsset_MetalToolchain/4ab058bc1c53034b8c0a9baca6fba2d2b78bb965.asset/AssetData/Restore/022-17211-415.dmg Done downloading: Metal Toolchain 17A324.
8
3
1.2k
3w