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

Posts under Xcode tag

200 Posts

Post

Replies

Boosts

Views

Activity

Resolving a "Simulator runtime is not available" error
Some Macs recently received a macOS system update which disabled the simulator runtimes used by Xcode 15, including the simulators for iOS, tvOS, watchOS, and visionOS. If your Mac received this update, you will receive the following error message and will be unable to use the simulator: The com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime is not available. Domain: com.apple.CoreSimulator.SimError Code: 401 Failure Reason: runtime profile not found using "System" match policy Recovery Suggestion: Download the com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime from the Xcode To resume using the simulator, please reboot your Mac. After rebooting, check Xcode Preferences → Platforms to ensure that the simulator runtime you would like to use is still installed. If it is missing, use the Get button to download it again. The Xcode 15.3 Release Notes are also updated with this information.
0
0
9.7k
May ’24
Why doesn’t Transaction.updates emit reliably?
I'm on macOS Sequoia Version 15.7.3 (24G419) and using Xcode Version 26.2 (17C52). In my Xcode project, Transaction.updates and Product.SubscriptionInfo.Status.updates don’t seem to emit updates reliably. The code below works consistently in a fresh Xcode project using a minimal setup with a local StoreKit Configuration file containing a single auto-renewable subscription. class InAppPurchaseManager { static let shared = InAppPurchaseManager() var transactionTask: Task<Void, Never>? var subscriptionTask: Task<Void, Never>? init() { print("Launched InAppPurchaseManager...") transactionTask = Task(priority: .background) { for await result in Transaction.updates { print("\nReceived transaction update...") try? await result.payloadValue.finish() } } subscriptionTask = Task(priority: .background) { for await result in Product.SubscriptionInfo.Status.updates { print("\nReceived subscription update...") print("state:", result.state.localizedDescription) } } } } I initialise it in: func applicationDidFinishLaunching(_ aNotification: Notification) { _ = InAppPurchaseManager.shared } I do not build any UI for this test. I open StoreKit Transaction Manager then click Create Transaction → select the product → choose Purchase (Default) → Next → Done. The console shows that it detects the initial purchase, renewals and finishes each transaction. It also works even if I do not add the In-App Purchase capability. In my actual project, the initial purchase is detected and finished, but renewals are not detected. Subsequent transactions then appear as unverified, presumably because the updates are not being observed so the transactions are not being finished. What can I do to make this work reliably in my actual project? For context, in the actual project: I have a StoreKit Configuration file that is synced with App Store Connect The In-App Purchase capability is enabled The configuration file is selected in the scheme The products in App Store Connect show “Ready to Submit” Loading products works: try await Product.products(for: ...) Also, I use ProductView for the purchase UI. The first purchase works and is detected and finished, but subsequent renewals are not finished because the updates do not seem to be emitted.
0
0
34
10h
XCode does not recognize my iPhone
I'm trying to run my app on my iPhone and XCode is unable to detect it. Versions (as of time of writing, these are all the latest versions) XCode: 15.0.1 iOS: 17.1.2 macOS: Sonoma 14.1.2 What I've tried Updating all hardware to the latest versions. Restarting all hardware. Clearing cache/derived data. Using different USBC ports/cables. Using the XCode 15.1-Beta 3 (the latest beta) Clearing trusted computers and re-trusting Disabling Multipath Networking (solution for someone else on the dev forums) Creating a brand new xcode project. Disabling all wifi/bluetooth and reconnecting Using different wifi networks Calling mac support (they directed me back here) Scouring forums What happens I start by disconnecting my phone from my computer, clear trusted computers, restart xcode, and start (basically) from a completely blank slate. First I open XCode to my project. Then I connect my iPhone via USBC. I see that XCode says "iPhone not eligible while pairing in progress" (or something like that). I see on my phone that I must trust this computer, I hit trust, I enter my phone's passcode, then that disappears on my phone, and in XCode the message about eligibility disappears. I then click on the device selector to choose between either a simulator or a hardware device and under hardware I only see a message that says "No eligible devices connected to my mac". If I open the "Manage Run Destinations" organizer I see all the simulators there in the simulators tab, but when I go to the Devices tab, I see nothing. Sometimes when I go through this process, I can get a banner to appear up top, but still no device shows up on the left. The banner will show me that it is indeed my iPhone, but it will be missing information like "Serial Number" or "Capacity". Here's a screenshot of what I see. Keep in mind, this banner up top does not always show up when I go through this process. iPhone CAN be detected on my other laptop When I do this exact same thing on my other laptop, everything works just fine. Here are the specs I'm running on that laptop. (using the same cable/wifi network/etc) XCode 15.0.1 macOS: Ventura 13.6.1 iPhone 17.1.2 (I'm using the same iPhone) The only difference here being the macOS version. However, the problem started on my "broken" computer while I was running a previous major macOS version. This problem is actually what prompted my to do a system update to Sonoma. Please for the love of god, halp!!!
18
7
23k
12h
Xcode 26.3 Claude Agent can't access Desktop folder
I am using the Xcode 26.3 Claude Agent feature. Claude Agent can’t access on my Desktop folder when they are specified as chat attachments because I accidentally denied access to that folder when it was first requested. I had earlier read the Xcode 26.3 release notes, so I was somewhat aware of this known issue, but I didn't make the connection when the Desktop access prompt appeared. I wasn't expecting the permissions prompt, because the regular (non-agent) Xcode Claude is able to freely access Desktop files when they are specified as Xcode coding assistant chat session attachments. Claude Agent isn’t listed in macOS Settings > Privacy & Security > Files and Folders, so I can’t fix the permissions there. The TCC database contains these rows: % sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db \ "SELECT service, client, datetime(last_modified, 'unixepoch', 'localtime') as last_modified FROM access ORDER BY last_modified DESC" | head -2 kTCCServiceSystemPolicyDownloadsFolder|/Users/drew/Library/Developer/Xcode/CodingAssistant/Agents/Versions/26.3/claude|2026-02-07 15:19:25 kTCCServiceSystemPolicyDesktopFolder|/Users/drew/Library/Developer/Xcode/CodingAssistant/Agents/Versions/26.3/claude|2026-02-07 13:38:07 but I can’t seem to reset them using tccutil, apparently because /Users/drew/Library/Developer/Xcode/CodingAssistant/Agents/Versions/26.3/claude is not a valid bundle identifier: % tccutil reset all '/Users/drew/Library/Developer/Xcode/CodingAssistant/Agents/Versions/26.3/claude' tccutil: No such bundle identifier "/Users/drew/Library/Developer/Xcode/CodingAssistant/Agents/Versions/26.3/claude": The operation couldn’t be completed. (OSStatus error -10814.) I would like for Claude Agent to be able to access my Desktop folder. What is an appropriate next step? Thank you for any help you can provide.
1
0
51
15h
Broken autocomplete in Xcode 26
Xcode 16 and 26 changes in painful way how the Tab key works during autocomplete. Previously, pressing Tab would extend the typed text up to the word match. For example, we have two classes: NSViewController and NSViewCoordinator BEFORE, typing: "NSV" + Tab used to complete to NSViewCo Now, in Xcode 26, pressing Tab just use the first suggestion. Stupidly. Especially when you want DispatchQueue and it gaves you DispatchSemaphore… That is very inconvenient because very often I want just see all possible cases with some prefix...without need of typing all prefix manually. How to restore the previous behavior? How to do autocomplete word-by-word?
2
0
96
1d
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
261
2d
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.0k
2d
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
3d
Are there workarounds for these bugs in Xcode?
Are there workarounds for the following bugs in Xcode 16.3? I'm looking for workarounds instead of trying newer versions of Xcode because, from what I read, the Xcode release notes do not mention these issues being fixed. First bug: Resizing a NSSplitView in the UI Editor is buggy. When you try to use the divider, it just does not work as expected. In the case of a vertical split, the bottom view gets shrunk whatever you try to do. Second bug: When you type: (IBAction) in the source editor, you get the following buggy template (extra ')' on the right): - (IBAction)<#selector#>:(id)sender)
1
0
34
3d
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
4d
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.1k
4d
Archiving Catalyst project that embeds macOS tool
Hi! I have a Catalyst app that embeds command line utility. So the project has two targets: Catalyst target, this target depends on #2 and embeds it into its bundle. macOS target, the command line tool. Both targets have package dependency to the same package. I used this to embed the CMD tool. Everything builds, runs and works fine until I try to archive the project. Archiving stops early with such error: error: Multiple commands produce '/Users/kse2/Library/Developer/Xcode/DerivedData/PkgTest-clngkndczxoprpdlwefqqiqlryjt/Build/Intermediates.noindex/ArchiveIntermediates/PkgTest/IntermediateBuildFilesPath/UninstalledProducts/macosx/MacrosForSwift.o' note: Target 'MacrosForSwift' (project 'MacrosForSwift') has a command with output '/Users/kse2/Library/Developer/Xcode/DerivedData/PkgTest-clngkndczxoprpdlwefqqiqlryjt/Build/Intermediates.noindex/ArchiveIntermediates/PkgTest/IntermediateBuildFilesPath/UninstalledProducts/macosx/MacrosForSwift.o' note: Target 'MacrosForSwift' (project 'MacrosForSwift') has a command with output '/Users/kse2/Library/Developer/Xcode/DerivedData/PkgTest-clngkndczxoprpdlwefqqiqlryjt/Build/Intermediates.noindex/ArchiveIntermediates/PkgTest/IntermediateBuildFilesPath/UninstalledProducts/macosx/MacrosForSwift.o' What I have tried to fix archiving: Changing PkgTestCMD target to be on Catalyst/iOS instead of macOS. This works but I'm not sure how to properly run CMD tool with iOS SDK (if this correct at all): I need the main thread to be 'unblocked' and be active while background tasks exist. Adding an aux framework that act as container for the package. Doesn't work. Splitting targets into different projects, making workspace and cross-project reference. Doesn't work. My understanding is that archiving attempts to produce .o files for both Catalyst and macOS simultaneously, due to PkgTest being Catalyst and PkgTestCMD being macOS targets. How to archive such a project? Is there a way to separate archiving of CMD and main app? Maybe separate .o files into different directories. Simple building and running the project works, why archiving doesn't want to? I have a test project for the issue: PkgTest. main branch is the source project, DepFramework contains attempt #2, Workspace—#3. Thank you!
0
0
34
4d
There are still preview uploads in progress.
Hello everyone, I’m stuck with an App Store Connect issue and would really appreciate any insight from the community. I am unable to submit my app for review due to the following persistent error: “Unable to Add for Review – There are still preview uploads in progress.” What makes this particularly confusing is that there are no previews currently uploading. Here is everything I have already tried: Deleted all App Preview videos and all screenshots Confirmed Media Manager shows no active uploads Re-uploaded App Preview videos fully compliant with Apple specs: H.264 AAC stereo audio Constant 30 FPS Correct resolution Uploaded a new build with a higher build number (Build 3) Waited more than 24 hours after upload Logged out / logged in, refreshed, tried multiple browsers and sessions Confirmed TestFlight build upload completed successfully Despite all of this, the error persists and also prevents: Adding the app for review Creating a new app version (the “Add Version” button does not appear) Apple Developer Support has suggested submitting a higher build number, which I have done, but the issue remains. At this point, it seems like a stuck / ghost App Preview upload job on the App Store Connect backend. Has anyone experienced a similar issue? If so: How was it resolved? Did Apple need to manually clear or reset something on their side? Any advice would be greatly appreciated. Thank you in advance.
2
1
209
4d
Not seeing any AI/Agent options in Xcode 26.3
I've installed Xcode 26.3 on Sequoia 15.7.3 but I'm not seeing any of the AI options showing in Xcode that I see in usage/example videos. For example that AI icon in the top left hand corner isn't visible, and if I select Settings there is no Intelligence section, yet there is in all the demo videos. Why am I not seeing any of these new features?
1
1
66
4d
Document Type Export / Import in Xcode - Shared via Messages
I’ve created a document type for my app and set it up in the Info Configuration in Xcode. This all works as expected: Implemented with the Transferrable API and ShareLink, I can share an app’s file via the Files app or Notes and then import the file via a Share extension and the fileImport swiftUI api. My question is regarding Messages, specifically. It appears as a ShareLink option and I’m able to send my app’s document type via a message, but I’m unable to open it or share it (internally, with my app), other than being able to forward or delete it. If I copy the file, I can’t access it within my app (it’s still stored in the Messages private bundle) and startAccessingSecurityScopedResource returns false as expected. The message does detect the right icon, so it’s recognizing the custom document type. If my Share Extension, exported document type, and transferable implementation is configured correctly, should I be able to open a file for my app shared via Messages? Is this an allowed action? I get various answers from AI, and I can’t test this in the Simulator on pre-26 devices.
1
0
68
5d
USDZ model files when opened in Preview turns black
On macOS 26.2 (Tahoe), the Preview app fails to render many USDZ models correctly. The issue appears inconsistent: • Some USDZ files open normally in Preview • Some USDZ files open but the viewport turns completely black (no geometry, no material, no lighting) • All the same files open correctly when opened using “Open With → Xcode” This was not the behavior on macOS 15.7.2, where the exact same USDZ files rendered consistently in Preview without failures.
1
0
109
5d
BLE Advertising in Background
For our research study, it is essential that the app can advertise BLE packets even when the app is no longer in the foreground (for example, when it is in the app switcher / recents state). Is it supported to advertise BLE packets while the app is in the background or recents state? If so, what are the specific requirements or limitations we should be aware of (background modes, payload size, timing, etc.)? Are there any constraints that would prevent consistent BLE advertising for research use cases?
2
0
92
5d
Xcode 26.x Frequently Freezes During Breakpoint Debugging with Simulator
When I use Xcode 26 (0.1, 1) for debugging and hit a breakpoint, using "step over" causes the debugger to freeze at a random line of code. Clicking "Pause program execution" indicates that the line is being executed, but the breakpoint never exits, seemingly causing a freeze. The application on the simulator also becomes unresponsive. However, when I do not use breakpoints, my program runs smoothly, and debugging on a physical device does not cause any freezes. This issue only occurs with the simulator. I am using Xcode on Apple Silicon, and due to some third-party SDKs that depend on Rosetta, our app can only run on the Rosetta simulator. We did not encounter this issue when using Xcode 16.x for simulator debugging. The current situation with Xcode 26.x significantly reduces our development efficiency. What could be causing this, and is there a solution?
3
2
429
5d