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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Created

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
3
0
100
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 follow error in Xcode: Cannot Preview in this file. Simulator was shutdown during an update. I have tried the following: Uninstall Xcode and reinstall it again 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" I reported the issue: FB20485454 FB20987522 Thank you. Best regards, Jens
0
0
52
3w
Code Coverage Not Accurate in Xcode 26
Description: I’m noticing that the code coverage metrics in Xcode 26 are not accurate compared to earlier versions. In Xcode 15, the same set of unit tests shows around 38% coverage, but in Xcode 26, even though all the tests are running successfully (for example, the SegmentedUI test cases), the code coverage is displayed as 0%. Has anyone else observed this behavior in Xcode 26? Is there any known issue, workaround, or configuration change required to get the correct coverage report? Environment: Xcode 26 iOS 18 SDK Unit tests running under XCTest Any insights or suggestions would be appreciated.
1
3
174
4w
Code Coverage Not Accurate in Xcode 26
Description: I’m noticing that the code coverage metrics in Xcode 26 are not accurate compared to earlier versions. In Xcode 15, the same set of unit tests shows around 38% coverage, but in Xcode 26, even though all the tests are running successfully (for example, the SegmentedUI test cases), the code coverage is displayed as 0%. Has anyone else observed this behavior in Xcode 26? Is there any known issue, workaround, or configuration change required to get the correct coverage report? Environment: Xcode 26 iOS 18 SDK Unit tests running under XCTest Any insights or suggestions would be appreciated.
0
0
23
4w
Unable to download iOS 26.1 Simulator Runtime - Build 23B80 not available
I am unable to download the iOS 26.1 Simulator Runtime through Xcode 26.1 on macOS 26.1 (Build 25B78). Issue Details: When attempting to download via Xcode Settings → Platforms, the download fails with error code 41 (DVTDownloadableErrorDomain) and error code 60 (MADownloadCannotConnectToHost) The error message states: "Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({RequestedBuild = 23B80;})" I receive HTTP 403 Forbidden when accessing mesu.apple.com/assets/ Steps Attempted: Downloaded via Xcode Settings → Component → iOS 26.1 Simulator Tried command line: xcodebuild -downloadPlatform iOS Searched https://developer.apple.com/download/all/ - iOS 26.1 Simulator Runtime not listed Tested with different networks (home WiFi, VPN, mobile hotspot) Disabled proxy settings Flushed DNS cache All attempts result in the same error. Important Notes: Xcode 26.1 shows iOS Simulator SDK 26.1 (Build 23B77) is available However, Xcode attempts to download Build 23B80, which appears unavailable I experienced a similar issue previously with Xcode 16.4 requesting iOS 18.4 Simulator Runtime, which was also unavailable for download Impact: Without the iOS 26.1 Simulator Runtime, I cannot develop or test iOS applications. macOS 26.1 requires Xcode 26.1, which in turn requires iOS 26.1 runtime, leaving me unable to perform any iOS development work. Questions: Is iOS 26.1 Simulator Runtime (Build 23B80) officially released? Is there a direct download link available? Should Xcode 26.1 be requesting Build 23B77 instead of 23B80? Is there any account restriction preventing me from downloading newer simulator runtimes? System Information: macOS: 26.1 (Build 25B78) Xcode: 26.1 (Build 17B55) Error description: Download failed. Domain: DVTDownloadableErrorDomain Code: 41 User Info: { DVTErrorCreationDateKey = "2025-11-10 15:38:07 +0000"; } Download failed. Domain: DVTDownloadableErrorDomain Code: 41 Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({ RequestedBuild = 23B80; }) Domain: DVTDownloadsUtilitiesErrorDomain Code: -1 Download failed due to not being able to connect to the host. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime) Domain: com.apple.MobileAssetError.Download Code: 60 User Info: { checkNetwork = 1; }
17
9
1.2k
4w
Module dependency cycle errors in Xcode 26
I just updated to Xcode 26 and some of my Swift Packages have been getting strange build errors that I have not been able to resolve. When I try to build my Swift Package in Xcode I get the following error Module dependency cycle: 'UIKit.swiftmodule -> .swiftmodule -> SafariServices.swiftmodule -> UIKit.swiftmodule' It seems like it is related to the change in Xcode 26 that states "Swift explicit modules will be the default mode for building all Swift targets". I see that you can disable this with the build setting SWIFT_ENABLE_EXPLICIT_MODULES=NO, but I don't see a way to do this in Package.swift, as you can't include value assignments like this .define("SWIFT_ENABLE_EXPLICIT_MODULES=NO"). Our private SPM repos use CI/CD and so we need to be able to build them independently of any use in a project. I would appreciate any help on fixing our Swift Package builds in Xcode 26, thanks!
4
1
267
4w
Communication with Apple Failed - No Profiles
I have created a valid bundle identifier, registered device with correct UUID, created an profile, and still am not able to get things to connect to XCode. I have tried manually downloading certificates to refresh. I'm not sure what I'm doing wrong, and Apple Support only refers me to the same instructions I used to complete this process. Can anyone help? Errors: Communication with Apple failed Your team has no devices from which to generate a provisioning profile. Connect a device to use or manually add device IDs in Certificates, Identifiers & Profiles. https://developer.apple.com/account/ No profiles for '*' were found Xcode couldn't find any iOS App Development provisioning profiles matching ''.
0
0
30
4w
HTTP Requests Failing on iOS Simulator but Working on Physical Devices
Hello everyone, We are currently facing an issue when testing our hybrid mobile application (built with Ionic and Angular) on the iOS Simulator. The app works perfectly on physical iOS devices — all HTTP requests complete successfully. However, when running the same build on the iOS Simulator, every HTTP request fails with the following error: { "headers": { "normalizedNames": {}, "lazyUpdate": null, "headers": {} }, "status": 0, "statusText": "Unknown Error", "url": "https://api.bizify.com.br/demo/api/ping", "ok": false, "name": "HttpErrorResponse", "message": "Http failure response for https://api.bizify.com.br/demo/api/ping: 0 Unknown Error", "error": { "isTrusted": true } } We have confirmed that the API endpoint https://api.bizify.com.br/demo/api/ping is reachable and secured with a valid SSL certificate. This issue occurs only in the iOS Simulator — not on Android devices or physical iOS devices. Has anyone encountered this issue before? Any insights on why the iOS Simulator might be blocking or failing these HTTPS requests — and how we could resolve it — would be greatly appreciated.
2
0
77
4w
Localization not working for App Intents defined inside Swift Package and used in Widget Extension
Hi there, I’m having trouble with localization for App Intents used in a configurable widget when the intents are defined inside a Swift Package. The intents appear correctly in the widget configuration UI and function as expected, but the localized strings are not displayed. Instead, the widget shows the localization keys themselves. Setup Xcode: 26.1 iOS: 26 The App Intents are used for a configurable widget Intent is located in a Swift Package The Widget Extension depends on the package AppIntentsPackage setup: // In the package public struct MySharedIntentsPackage: AppIntentsPackage {} // In the widget extension import AppIntents import SharedAppIntents struct WidgetIntentsPackage: AppIntentsPackage { static var includedPackages: [any AppIntentsPackage.Type] { [MySharedIntentsPackage.self] } } What I’ve tried I tested several configurations separately to see which setup allows localization to work: Localizing inside the Swift Package Placed a Localizable.xcstrings file inside the Swift Package. Specified .module for the bundle parameter in LocalizedStringResource initializers. → The widget still displayed the localization keys. Localizing inside the Widget Extension Placed a Localizable.xcstrings file inside the Widget Extension target instead of the package. → The widget continued to show the localization keys. Allowing mixed localizations Added CFBundleAllowMixedLocalizations = YES to the Widget Extension’s Info.plist. → No change; the widget still showed the keys. Problem In the WWDC 2025 session “Get to Know App Intents”, it was announced that App Intents would officially support Swift Packages. However, despite following that guidance, here we have a situation where the localizations do not work and only the keys appear in a configurable widget’s configuration UI. When I move the same App Intent code directly into the Widget Extension target, localization works as expected, but not when the intent remains inside the Swift Package. Question Is localization for App Intents defined in Swift Packages officially supported for configurable widgets? If yes: Which bundle does App Intents use to resolve localized strings? Should the .xcstrings file be placed in the package or in the host extension’s bundle? Or is this a current limitation or known issue? Any clarification or workaround would be greatly appreciated. Thank you.
1
0
109
4w
Xcode crashes when deleting a target
I have a test target in my app MacPacker (download via github.com/sarensw/MacPacker as this is open source). I want to remove the test target in Xcode. However, Xcode crashes when I try to delete it. I have submitted an issue in the Feedback app (FB20976404). I'm posting here to see if anyone else has the same issue and has a workaround. Or, maybe there is an alternative way to get rid of a target? Steps to reproduce: Open project file Select test target in TARGETS on the left side of the project file editor Click the “-“ button to remove that target Found in: Xcode 26.1 (and also before in Xcode 26.0)
3
0
66
4w
Are Text Encoding and Line Endings broken ?
I would like to understand what the “Text Encoding” and “Line Endings” settings in the Identity Inspector of a file actually represent. Both settings are configurable in Xcode’s preferences. It seems that both of them are broken. I have a file that uses CRLF line endings and is encoded in a Japanese code page, but Xcode displays “No Explicit Encoding” and “No Explicit Line Endings”. I tried saving the file after changing these settings in Xcode, but nothing changes for the file in question. I thought maybe these settings only apply to source files in C++, C, or Objective-C projects—or even assembler—but there’s no impact on other languages either. Are “Text Encoding” and “Line Endings” simply broken? If not, when and how are they actually used?
0
0
31
4w
As soon as I run the app in debug the breakpoints are disabled
After updating my system to macOS Tahoe 26.1 and Xcode 26.1, all breakpoints in my project fail to work. When I run the application in Debug mode, any enabled breakpoint (blue) immediately becomes disabled (grayed out) the moment the app launches. The application runs, but the debugger never stops. This issue occurs in any location, including in the application's init() method, which should always be hit. This behavior suggests that the LLDB debugger is failing to attach to the process at launch or is being instructed not to enable breakpoints. System Configuration: Mac Model: MacBook Pro 14" (2021), Apple M1 Pro macOS Version: Tahoe 26.1 Xcode Version: 26.1 Project Type: SwiftUI App for macOS Troubleshooting Steps Performed (All Unsuccessful): We have performed an extensive series of troubleshooting steps to resolve the issue, none of which have worked. These steps include: Basic Project Cleaning: Cleaned the build folder (Product > Clean Build Folder). Deleted the entire DerivedData directory. Deleted the project's xcuserdata folder. Xcode & System Procedures: Restarted Xcode multiple times. Rebooted the Mac multiple times. Reinstalled Xcode Command Line Tools using xcode-select --install. Reset the Xcode path using sudo xcode-select --reset and sudo xcode-select -s /Applications/Xcode.app/Contents/Developer. Forced an update of the system's shared cache with xcrun simctl runtime dyld_shared_cache update --all. Project Build Settings Verification (for Debug configuration): Build Configuration: Verified that the "Run" scheme is set to Debug. Optimization Level: Confirmed it is set to No Optimization [-O0]. Debug Information Format: Confirmed it is set to DWARF with dSYM File. Strip Swift Symbols: Confirmed it is set to No. (This was a new setting noticed after the Xcode update). Enable Hardened Runtime: Attempted setting this to both Yes and No. The issue persists in both cases. Validate Workspace: Confirmed it is set to Yes. Code Signing: Verified that "Automatically manage signing" is enabled with a valid team. Manually deleted and re-created the "Apple Development" certificates via Xcode's Accounts settings. Direct LLDB Testing: Created a ~/.lldbinit file. Using breakpoint list, confirmed that LLDB starts with "No breakpoints currently set," indicating that Xcode is likely not passing the breakpoints to the debugger. Using settings set target.process.stop-on-entry true, confirmed that the app still does not stop on entry, suggesting the debugger is failing to attach to the process at all. Conclusion: Given that all standard and advanced troubleshooting steps have failed, and the issue started immediately after updating both macOS and Xcode to a non-public release (Tahoe 26.1 / Xcode 26.1), this appears to be a regression or a bug in the new development environment. The failure of stop-on-entry strongly suggests a fundamental issue with the debugger attachment process on this specific OS and Xcode combination.
1
3
192
Nov ’25
iOS 26.1 simulator prompting Apple ID login during XCUITest
Hello Apples, Noticed that after iOS 26.1 update the Xcode simulator seems to be prompting to login with Apple ID arbitrarily while working on some UI tests. This does not happen with previous iOS 26.0 or 26.0.1 but is now causing trouble when launching the app or uninstalling at teardown. The current other issue with the uninstallation being sticky and taking a long time (waiting for springboard to become idle) is not helping either. The dialog seems to appear a bit unreliably to be able to handle it correctly. Have tried both manual springboard dialog mapping and handling as well as an interruption monitor. The latter only seems to work for the first dialog which appears but then ceases to function so not much help… Anyone else seeing this and are there any knowledge or good workarounds? Or should we just roll back to testing with previous OS versions and cross fingers for iOS 26.2? Bottom line we cannot login with an Apple ID while running tests on a simulator… As bonus noticed the simulator background images are not working? Thanks! BR, ARu_ (Senior QE)
1
0
246
Nov ’25
Missing Context menu items in Xcode 26 on a fresh project
When following the official SwiftUI Tutorial "Landmarks", I should be able to Cmd-Ctrl-Click an element of a preview in Selectable mode to view a list of options. But Xcode shows only one option (Embed). Furthermore, if I try to type anything the popover breaks completely and grows in length infinitely. I am not sure whether this is a bug, or I missed something when installing Xcode, or both
2
0
191
Nov ’25
Using a local model for Xcode Assist
Hi, I'm interested in trying out Xcode Assist to help with things like complicated refactors or writing tests cases. The ChatGPT and Claude options both share your code with third parties, which is not acceptable for my use case. Has anyone used a fully local model for Xcode Assist? I see that you can select one in the Apple Intelligence section of Xcode's Preferences screen, but don't really know where to start. Are there local models that work well with Xcode Assist and that truly keep your source code private?
0
0
87
Nov ’25