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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

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/ Xcode couldn't find any tvOS App Development provisioning profiles matching ’ I followed the instructions and created it manually, but it still doesn't work. Why is that? I remember it used to be created automatically and take effect right away.
3
0
102
1w
XCode problem
Right now, I am trying the tutorial for SwiftUI from the Apple Developer Program inside of Xcode, but I encountered a problem. Inside of the selectable canvas mode in Xcode, I wanted to command-control-click the element (in this case, a text) to bring up the editing popover and select "Show SwiftUI Inspector." For some reason, on the popover menu, the only option was "Embed." I only wanted the menu point Show SwiftUI Inspector, and I also tried the shortcut Ctrl+Option, but nothing worked. Now is there another method to get to this menu? Or can you help me with that? Noah
0
1
27
1w
CompileAssetCatalogVariant failed with nonzero exit code.
I'm running in a very very very weird error. I have a large asset catalog, consisting of about 2700 assets for 1.19GB of size. I can successfully build and run my project with both release and debug scheme, when a real device or simulator is selected. However, whenever I select Any iOS device (arm64), about 80ish seconds in the build process, the building fails with the following output: CoreUI: Error: unable to add asset to store *** Terminating app due to uncaught exception 'IBPlatformToolFailureException', reason: 'The tool closed the connection (AssetCatalogSimulatorAgent) What I tried and failed: Cleaning DerivedData and restarting PC Building the same project on three different devices, each with a different version of XCode. All failed. running sudo killall -9 com.apple.CoreSimulator.CoreSimulatorService Scanning for duplicate image files, found none. Scanning for duplicate .imageset folders in different folders, found none. Scanning for images that declared a different format than theirs, eg .webp renamed as .png, and found none. Creating an empty Hello World project, and just adding my asset catalog. Build fails for Any iOS device, succeeds for simulator or physical device. Uninstalling and reinstalling XCode command line tools. Manually compiling via actools. Changed "Embed Assets Pack in Product Bundle" from No to Yes. I don't have any .svg file in my assets. What I tried and failed but gives more insight: Now the only thing that I was able to come up with was deleting folders to narrow down where the problem was. So I found that there is a 700MB folder called T, containing T1, T2, ..., T6. Eventually managed to narrow down even more to T3, T4, T6. I created a distinct .xcassets catalog for each subfolder and tried to compile individually with actools, along with assets.xcassets (the main one). Here's the thing: T3.xcassets + assets.xcassets compiles T4.xcassets + assets.xcassets compiles T6.xcassets + assets.xcassets compiles T3.xcassets + T4.xcassets + assets.xcassets compiles. T3.xcassets + T6.xcassets + assets.xcassets compiles. T4.xcassets + T6.xcassets + assets.xcassets compiles. T3.xcassets + T4.xcassets + T6.xcassets + assets.xcassets crashes with CoreUI: Error: unable to add asset to store. I've been stuck for days now and can't deploy my finished app I worked on for the last three years because of this.
4
0
101
1w
Apple Watch may need to be unlocked to recover from previously reported preparation errors
I'm trying to run(debug) an Xcode watch app project on my watch. My phone is connected to my computer via USB cable, my watch is paired to my phone. When I open Xcode and then open "Devices and simulators", I can see my phone properly connected. But these errors show up for my watch........ Apple Watch may need to be unlocked to recover from previously reported preparation errors Ensure the device is unlocked and associated with the same local area network as this Mac. A connection to this device could not be established. Timed out while attempting to establish tunnel using negotiated network parameters. I have booted computer, phone and watch. I have turned wifi off and on, on all 3 devices. I have turned developer mode on the watch off and then back on again. Anyone have any ideas how to fix this?
4
1
196
1w
Unable to compile Core Image filter on Xcode 26 due to missing Metal toolchain
I just install xcode 26.0.1 throungh app store, but when i 'xcodebuild -downloadComponent MetalToolchain', i get wrong Metal Toolchain 17A324, which is the wrong version. The correct version is 17A5241e i think. This issue i saw 26.1 release has fixed, https://developer.apple.com/documentation/xcode-release-notes/xcode-26_1-release-notes. How can i get update?
4
0
143
1w
Xcode26.1 compile error: cannot execute tool 'metal' due to missing Metal Toolchain
When I use Xcode26.1 or Xcode26.0.1 compile my project, Xcode failed with error error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain. I search around and found this is a known issue and fixed in Xcode26, but I get this error in latter versions. I tried all the methods in documents(https://developer.apple.com/documentation/xcode-release-notes/xcode-26-release-notes) to intall Metal component, but it still compile error with the same error. I also delete Xcode and all related components restart computer and reinstall Xcode26.1, it's not work also. macOS version: 26.0.1 (25A362) Xcode version: 26.1 MetalToolchain version: 17.0 (17B54)]
1
0
87
1w
Xcode_26 not compiling Metal project
Hello Xcode 26.0.1 (17A400) Missing some Metal components When building a program using Metal, it induces an unexpected error : “error: error: cannot execute tool 'metal' due to missing Metal Toolchain; use: xcodebuild -downloadComponent MetalToolchain Command CompileMetalFile failed with a nonzero exit code” Which terminates the build The fix given “xcodebuild -downloadComponent MetalToolchain” using sudo does not work Did someone find a work around or could resolve the issue? Many thanks Jean MacBook Air M4; macOS 26.0.1; Xcode 26.0.1
3
2
229
1w
ToolbarItem with .hidden() or .opacity(0) leaves a visible frame when built with Xcode 26 (worked fine in Xcode 16.4)
In Xcode 16.4, I could hide a ToolbarItem simply by applying .hidden() or .opacity(0), and the button disappeared completely — including its touch area and layout space. However, when I build the same code with Xcode 26, the button visually disappears but its frame and tap area remain, as if the ToolbarItem were still present but invisible. This causes an empty tappable area to remain in the toolbar. Here’s a simplified example: .toolbar { ToolbarItem(placement: .topBarLeading) { Button("Back") { // action } .opacity(isSelectionMode ? 0 : 1) // or .hidden() – both produce the same issue } ToolbarItem(placement: .principal) { Text("Title") } ToolbarItem(placement: .topBarTrailing) { Button("Select") { isSelectionMode.toggle() } } } Expected behavior (Xcode 16.4):  When isSelectionMode becomes true, the Back button disappears completely and its space in the toolbar is released. Actual behavior (Xcode 26):  The Back button becomes invisible, but its tappable area and layout spacing remain, leaving an empty spot in the toolbar. To work around this, I tried conditionally including the ToolbarItem only when isSelectionMode == false, like this: @ToolbarContentBuilder private var toolbarLeadingContent: some ToolbarContent { if !isSelectionMode { ToolbarItem(placement: .topBarLeading) { Button("Back") { } } } } However, this approach fails to build when the minimum deployment target is iOS 15, showing the compiler error: 'buildIf' is only available in iOS 16.0 or newer I understand that @ToolbarContentBuilder relies on buildIf internally for conditional branches, which explains the limitation, but this means there’s currently no iOS 15–compatible way to completely remove a ToolbarItem at runtime. So my questions are: Is the layout change in Xcode 26 an intentional behavior change in SwiftUI? What’s the correct way to fully remove a ToolbarItem on iOS 15–compatible projects without using buildIf?
0
0
42
1w
Regarding the Deployment Targets setting for Xcode 26
Our project plans to upgrade Xcode from 16.2 to Xcode 26. We’ve noticed that the information on https://developer.apple.com/support/xcode/ states that the Deployment Targets for Xcode 26 supports iOS 15–26.1. However, the Deployment Targets for our current project is set to iOS 13. Does this mean that we must set the project’s Deployment Targets to iOS 15 or higher if we want to upgrade to Xcode 26? Can we still set the Deployment Targets to iOS 13? If we upgrade to Xcode 26 and set the Deployment Targets to iOS 13, will there be any problems?
2
0
108
1w
Xcode 26 / iOS 26 - XIB incorrectly references "HiraginoKakuGothic.ttc" causing build warnings
Hello, I'm encountering a persistent issue when building my project with Xcode 26 and iOS 26. The console shows errors related to font file references that don't actually exist in my project. After investigation, I found that the issue originates from XIB files incorrectly referencing HiraginoKakuGothic.ttc: <customFonts key="customFonts"> <array key="HiraginoKakuGothic.ttc"> <string>HiraginoSans-W3</string> </array> </customFonts> The problem appears to be triggered when setting UILabel fonts to "ヒラギノ角ゴシック W3 16.0" in Interface Builder, which causes the XIB to reference HiraginoKakuGothic.ttc. Interestingly, when I create a new project and use the same fonts ("ヒラギノ角ゴシック W3 16.0"), it does NOT automatically reference HiraginoKakuGothic.ttc. Here's what I've tried: ①Changed both UILabels' fonts to system font ②Verified in XIB Source Code that the .ttc references were gone ③Cleaned Build Folder ④Cleared DerivedData ⑤Restarted Xcode ⑥Set the labels back to "ヒラギノ角ゴシック W3 16.0" ⑦Checked XIB Source Code again - the non-existent .ttc references reappeared Even if I manually remove the customFonts references from the source code, they get regenerated as soon as I make any font changes in Interface Builder. I've also noticed that Xcode 16.1 has the same underlying issue, though it doesn't produce the console errors that Xcode 26 does. This seems to be a long-standing XIB issue, possibly related to reference caching. While new projects aren't affected, existing projects continue to maintain these incorrect references. My questions: How can I permanently resolve this issue in my existing project? What's the potential impact of these incorrect font references? Is there a way to clean up these cached references without affecting the rest of the project? Any insights or workarounds would be greatly appreciated. Thank you.
0
0
36
1w
XCPreviewAgent crashes with KERN_PROTECTION_FAILURE on macOS 26.0.1 Tahoe
Hello, I'm experiencing consistent crashes of XCPreviewAgent when using Xcode Previews on macOS 26.0.1 Tahoe (25A362). Configuration: macOS: 26.0.1 (25A362) - stable release Xcode: 16.0 (23.0.54) - stable release Hardware: MacBook Pro M4 Project: SwiftUI iOS app Issue: Every time I try to use Xcode Previews, XCPreviewAgent crashes with: Exception Type: EXC_BAD_ACCESS (SIGBUS) Exception Subtype: KERN_PROTECTION_FAILURE at 0x0000000340e54000 Termination Reason: Namespace SIGNAL, Code 10, Bus error: 10 The crash occurs in shared memory region during dynamic library loading. What I've tried: Cleared all caches: rm -rf ~/Library/Developer/Xcode/DerivedData Deleted Preview data: rm -rf ~/Library/Developer/Xcode/UserData/Previews Reset simulators: xcrun simctl --set previews delete all Switched xcode-select to /Applications/Xcode.app/Contents/Developer Tried both Xcode stable and Xcode beta Created fresh simulators Clean build (Cmd+Shift+K) Rebooted Mac multiple times The app runs fine on simulator (Cmd+R), but Previews consistently crash.
1
0
60
1w
Xcode 16.4
Hi I have downloaded Xcode 16.4 with MacOS Sequoia 15.7.1 as a XIP. It has downloaded but only as a 5GB file and it won't show up in my privacy settings/or even in storage- can someone tell me what I am doing wrong please- I know it should be about 50GB. Thank you
1
0
35
1w
Avoid IPv6 communication when debugging with real device
We are experiencing troubles in our organization when we want to debug iOS applications on physical iPhones and iPads. Our iPhones (iPhone 16e, iOS 18.5) are not recognized by Xcode 16.4, but in the Finder they show up fine using the USB cable. We are aware, that the communication is different and there is an ad-hoc network that gets created to exchange the device profile. Together with our IT department responsible for our security infrastructure we narrowed it down to the following reason: As we are blocking all IPv6 traffic for local networking, the iPhone cannot communicate with Xcode to make the first connection and load the device profile. As they are not planning on changing this behavior, I am reaching out to you, if there is a way to force this first handshake between Xcode and iOS device to use IPv4? Or is there any other way to enable debugging for these devices? Any ideas would be very helpful.
3
0
247
1w
WKWebView Persistent 1st-Party Cookie Deletion: Automatic Removal Policies in iOS/Safari
Our current iOS application utilizes WKWebView to display a web application. We've observed intermittent deletion of non-expired 1st-party persistent cookies within this web application, leading to session drops. Here are our environment details and specific questions: Environment: App Build: Built with Xcode 16.2. WebView Class: WKWebView. Cookie Type: 1st-Party Persistent Cookie (Explicit expiration set, not a session cookie). Domain Configuration: The content server and the cookie-issuing server are the same (same IP address, same eTLD+1). The Cookie is set via the Set-Cookie HTTP Header on the server side. Questions: Automatic Deletion Policy: Are there any scenarios (e.g., related to iOS system behavior, Safari policies, or Intelligent Tracking Prevention (ITP)) where iOS or Safari might automatically delete non-expired 1st-party persistent cookies used by WKWebView? Deletion Conditions: If the answer to Q1 is Yes, under what specific conditions (e.g., memory pressure, inactivity, storage limits, specific ITP criteria) does this cookie deletion occur, and does the behavior differ significantly across various iOS versions? OS Update Impact: Are there any known specifications or documented cases where an iOS version update itself triggers the mass deletion of existing cookies stored in the WKWebsiteDataStore? Mitigation Strategy: If this automatic deletion is a known behavior, what mitigation strategies are officially recommended to ensure the persistence of essential 1st-party authentication cookies (e.g., manual synchronization with WKHTTPCookieStore or Keychain/UserDefaults)? Official Documentation: If the answer to Q1 is Yes, please provide URLs to any official Apple documentation or technical notes that detail the specifications or behavior of 1st-party persistent cookie deletion within WKWebView.
0
0
38
1w
Impossible to connect iPhone 7 (iOS 15.8) with xCode 26
I have spent nearly an hour trying to get my iPhone 7 with iOS 15.8 to be recognized within xCode 26. I did not have this issue with the previous version of xCode. I have tried rebooting my Mac, rebooting my iPhone 7, removing the iPhone 7 from the list of devices that belong to my account, verified that I have support files for iOS 15.8 installed, signing out of my Apple account and signing back in....nothing works. Every time I go to "Windows > Devices" I see the iPhone 7, but I get a never-ending spinning circle next to the iPhone 7 (which is shown as connected) along with a banner that says "xCode will continue when Joe's iPhone 7 is finished." I can leave the phone connected to my Mac for an hour, and this message and the spinning circle next to the iPhone 7 never changes.
5
0
240
1w
Unable to launch tests in Xcode 26
I am trying to upgrade my app to use Xcode 26 and I cannot get my tests to launch. I am trying to launch tests to the simulator, and I always get this error after 300 second timeout: "encountered an error (The test runner hung before establishing connection.)" There are no other errors getting logged. I can run to the same simulator just fine, and in Xcode 16 the tests launch with no issues. The tests also run fine on an actual iPhone. Thanks in advance.
6
0
197
1w