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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Created

Unable to download Metal toolchain with Xcode Beta 5
I'm unable to download the Metal toolchain with Xcode. When trying to do it via the command line, I get the following: > xcodebuild -downloadComponent metalToolchain -exportPath /tmp/MyMetalExport/ Beginning asset download... 2025-08-06 19:46:19.983 xcodebuild[1395:22024] Writing error result bundle to /var/folders/48/1k1jfsxn56zcs4qr_719rc1w0000gn/T/ResultBundle_2025-06-08_19-46-0019.xcresult xcodebuild: error: Failed fetching catalog for assetType (com.apple.MobileAsset.MetalToolchain), serverParameters ({ RequestedBuild = 17A5295f; }) From Console.app: DVTDownloadsFetchAssetCatalog() complete assetType (com.apple.MobileAsset.MetalToolchain), options: (MADownloadOptions allowsCellular: 0 resourceTimeout: 60 canUseCacheServer: 0 discretionary: 0 disableUI: 0 sessionId: (null) additionalServerParams:{ RequestedBuild = 17A5295f; } allowsExpensiveAccess:1 requiresPowerPluggedIn: 0 prefersInfraWiFi: 1 liveServerOnly: -1 DownloadAuthorizationHeader: not present analyticsData: not present allowDaemonConnectionRetries: 0), result: (59), catalogError: (Download failed due to not being able to find the host. (Catalog download for com.apple.MobileAsset.MetalToolchain)) Note that I am online. I've tried restarting my computer and Xcode and using a different network.
20
16
827
Aug ’25
Icon Composer's minimum window size is too big for smaller MacBook video modes
I've filed a FB already through standard channels (FB ID: FB19032008) but I'll post it here in case it may get some attention from others experiencing similar issues. On macOS 26 Beta 5 and Xcode 26 Beta 5 (and earlier revisions afaik) Icon Composer specifies a minimum window size that greatly exceeds the bounds of the 1280x800/832pt video modes available on 13in MacBooks, and which also is too large for the default 1440x900 video mode on non-notched 13in MacBook Air/Pro models as this causes a default-size 64pt dock to occlude the window. I've attached screenshots depicting this behaviour in the two above described cases. Best solution seems like reducing min window size to something that will fit reasonably in a 1280x800pt viewport including the dock and menu bar (e.g. 1000x600 or something).
2
0
89
Aug ’25
Configure document used by my swiftui document app
Trying to configure info.plist and the base application the application works with the application. I consistently get two errors. Validation failed Disallowed UTTypes value. The Info.plist key 'UTTypeIdentifier' under 'UTImportedTypeDeclarations' in 'Blood Pressure Management V2.0.app' has disallowed values '[com.example.item-document]'. A Uniform Type Identifier starting with one of the patterns in the list '( "com.example." )' is disallowed. (ID: f2dbfe04-4f06-47ac-b74f-28ec238238c4) Validation failed The product archive is invalid. The value of the CFBundleDocumentTypes key in the Info.plist must be an array of dictionaries, with each dictionary containing at least the CFBundleTypeName key. (ID: fad3e65a-dc9d-4d9e-9506-703b874f71c6) Is there any clear documentation with examples? I have not found it yet.
0
0
32
Aug ’25
Xcode 16.4 can't choose a lower version iOS simulator to debug
My Xcode version is 16.4, I have added an old version simulator (iPhone 13 with iOS 17.2) to the simulator list, but I can't use it for debugging, and all on display are iPhone 16 with 18.6 (the latest iOS devices). The setting "Minimum Deployments" for my App is 16.6. In addition, when I downloaded an iOS 16.0 version simulator, Xcode automatically added all iPhone 15 models of the simulator, but I still can't use them. In short, I can only use the default iPhone 16 simulators. So, if I want to debug my App using iPhone 13 (iOS 17.2), what should I do? Thank you for your reply. :) Another small issue, my App's destination has been set to support only iPhone, why are those iPad simulators still appearing?
6
0
178
Aug ’25
Xcode 16.2: Unsigned IPA uses older SDK version (17.5 instead of 18.2)
Hellp I'm facing an issue with Xcode 16.2 when building iOS apps for different clients. I have a white-label app, and I build: A signed IPA for some clients An unsigned IPA for others For the signed app, I use: /usr/bin/xcodebuild \ -sdk iphoneos18.2 \ -configuration Release-*** \ -workspace /Users/runner/work/1/s/ios/Runner.xcworkspace \ -scheme Runner \ build -verbose \ CODE_SIGN_STYLE=Manual \ CODE_SIGN_IDENTITY=XXXXXXXX \ PROVISIONING_PROFILE=XXXXXXXXX \ PROVISIONING_PROFILE_SPECIFIER=XXXXXX For the unsigned app, I use: /usr/bin/xcodebuild \ -sdk iphoneos18.2 \ -configuration Release-*** \ -workspace /Users/runner/work/1/s/ios/Runner.xcworkspace \ -scheme Runner \ build \ CODE_SIGNING_ALLOWED=NO When I inspect the resulting Runner binary: The signed IPA correctly shows SDK 18.2 The unsigned IPA shows SDK 17.5 Why is the unsigned build using SDK 17.5 even though I explicitly specify -sdk iphoneos18.2 ? To check the SDK version used in the compiled binary, I use the following Python script with the lief library: import lief binary_path = "Runner" # Path to the extracted binary binary = lief.parse(binary_path) for command in binary.commands: if command.command.name == "BUILD_VERSION": for attr in dir(command): if not attr.startswith('_'): try: value = getattr(command, attr) print(f" {attr}: {value}") except Exception as e: print(f" {attr}: <error {e}>") print('-' * 40) Thanks in advance for your help!
1
0
38
Aug ’25
I’ve been trying to make a purchase in the sandbox environment for the past two days, but I keep encountering this error. It was working fine before, but the issue started occurring two days ago. Any idea what might be wrong?
Hi, I am trying to do some purchase on sandbox envirnment and facing this error from last 2 days. Any idea what is wrmong here &lt;SKPaymentQueue: 0x158ac1030&gt;: Payment completed with error: Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={client-environment-type=Sandbox, storefront-country-code=IND, NSUnderlyingError=0x15ae9c0c0 {Error Domain=AMSErrorDomain Code=305 "Purchase Failed Server canceled the purchase" UserInfo={AMSFailureReason=Server canceled the purchase, AMSURL=https://sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy?guid=00008030-0004388026C2802E, AMSDescription=Purchase Failed, AMSStatusCode=200, AMSServerPayload={ "cancel-purchase-batch" = 1; customerMessage = "Unable to process your request."; dialog = { defaultButton = ok; explanation = "Please try again later.\n\n[Environment: Sandbox]"; initialCheckboxValue = 1; isFree = 1; "m-allowed" = 0; message = "Unable to process your request."; okButtonString = OK; }; failureType = ""; "m-allowed" = 0; metrics = { actionUrl = "sandbox.itunes.apple.com/WebObjects/MZBuy.woa/wa/inAppBuy"; asnState = 0; dialogId = "MZCommerce.SystemError"; eventType = dialog; message = "Unable to process your re"; mtEventTime = "2025-08-06 06:56:30 Etc/GMT"; mtTopic = "xp_its_main"; options = ( OK ); }; pings = ( ); }, NSDebugDescription=Purchase Failed Server canceled the purchase}}} Optional(Error Domain=SKErrorDomain Code=0 "An unknown error occurred" UserInfo={NSLocalizedDescription=An unknown error occurred, NSUnderlyingError=0x15a152280 {Error Domain=ASDErrorDomain Code=500 "(null)" UserInfo={NSUnderlyingError=0x15a1501e0 {Error Domain=AMSErrorDomain Code=305 "(null)"}}}})
1
0
52
Aug ’25
ba-package tool not available
Hi, I'm trying to setup background assets hosted on Apple servers. I currently have installed Xcode 16.4 and Xcode beta 4. I have also freshly installed the command line tools for both. When I run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer xcrun ba-package template I get xcrun: error: sh -c '/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk -find ba-package 2> /dev/null' failed with exit code 17664: (null) (errno=No such file or directory) xcrun: error: unable to find utility "ba-package", not a developer tool or in PATH If I try to use Xcode beta 4: sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer xcrun ba-package template I get: dyld[92926]: Library not loaded: /System/Library/PrivateFrameworks/ManagedBackgroundAssetsHelper.framework/Versions/A/ManagedBackgroundAssetsHelper Referenced from: <7F150064-45BF-31D7-BAFD-32911BB9F569> /Applications/Xcode-beta.app/Contents/Developer/usr/bin/ba-package Reason: tried: '/System/Library/PrivateFrameworks/ManagedBackgroundAssetsHelper.framework/Versions/A/ManagedBackgroundAssetsHelper' (no such file), '/System/Volumes/Preboot/Cryptexes/OS/System/Library/PrivateFrameworks/ManagedBackgroundAssetsHelper.framework/Versions/A/ManagedBackgroundAssetsHelper' (no such file), '/System/Library/PrivateFrameworks/ManagedBackgroundAssetsHelper.framework/Versions/A/ManagedBackgroundAssetsHelper' (no such file, not in dyld cache) [1] 92926 abort xcrun ba-package template Any tip?
3
0
141
Aug ’25
App ID limit reached without any information beforehand
I setup an App that I have been testing on my macOS and iOS in Xcode. Then I realized I have 6 more apps I need to start working on. I have plans to become a developer in the Apple program but I want to get further in my coding to move forward. Apparently the UI Tests in my 6 Apps and those Apps took 10App ID limits from my account. I have App I have App UI Test and then and again up to a total of 5 of those 6 apps. My main app is now locked out of development? I wasn't planning on working on the other apps until I got my big first app developed. What can I do?! I am stuck. I can't work on my main app, nor can I work on the other apps. I'm not ready to at all.
3
0
71
Aug ’25
Unable to download XCode Runtime Simulator on Xcode 16.4 or Xcode 26b3
Hi, I'm unable to download the iOS 18.5 (22F76) and iOS 18.6 (22G86) Simulator runtimes on macOS 15.6 (24G84). The issue persists across multiple versions of Xcode, including 16.4 (16F6) and Xcode 26 beta 3 (17A5276g). Symptoms: In Xcode > Settings > Platforms (Components tab), clicking “Get” for iOS 18.5 / 18.6 either does nothing or results in a download failure. CLI command sudo xcodebuild -downloadPlatform iOS fails with: Domain: DVTDownloadableErrorDomain, Code: 41 HTTP 403 Forbidden from Amazon S3/CloudFront Switching to admin user, different networks, and clean reinstall of Xcode had no effect. I also attempted manual installation using the .dmg files from the developer portal. After mounting (e.g. Xcode_15_Simulator_Runtime_iOS_18.2.dmg), I extracted iOS 18.2.simruntime, but Xcode does not recognize it. File structure inside the extracted .simruntime: Contents/ ├── Info.plist (missing runtime identifier) ├── MacOS/ ├── Resources/ └── _CodeSignature/ Expected structure (from working install): Contents/ ├── Info.plist (with runtime info) ├── RuntimeRoot/ ├── Resources/ └── _CodeSignature/ Even copying a working .simruntime from another machine did not resolve the issue. Additionally, in Xcode 26 beta 3 I received: Download failed. Domain: DVTDownloadableErrorDomain Code: 41 Domain: com.apple.MobileAssetError.Download Code: 60 Message: Download failed due to not being able to connect to the host. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime) This appears to be either a CDN-level or catalog configuration issue. Any guidance or workaround would be appreciated. Thanks!
2
0
293
Aug ’25
Xcode forces my Macbook to restart when previewing canvas
I can't use Xcode without it crashing. Just writing a very simple iOS app with SwiftUI (using only forms and sections). Whenever my canvas updates to correspond to my changes it forces my Macbook to restart. Does anyone have a solution for this. I'll be honest it's becoming really frustrating. Thank you. Macbook M3 Pro 16GB ram, 500gb Space (400gb free space)
1
0
57
Aug ’25
Xcode restarts my Macbook when previewing canvas
I have an issue with Xcode that it crashes my Macbook and restarts it instantly when I unpause the preview canvas. I managed to make it run for a minute longer by not watching a youtube video. I am writing a very simple SwiftUI project for iOS nothing too big to warrant any issues. Does anyone have a solution to fix this? Macbook Pro M3 16GB RAM, 500GB SSD (plenty of storage space) Tahoe 26.0
1
0
56
Aug ’25
Xcode folder reference to an aggregate target's output folder breaks between Debug/Release builds. BUILT_PRODUCTS_DIR not relative to the aggregate
In my project I have an aggregate target that runs a script that generates a "web bundle" in a folder build/ with all the html/css/resources needed for the website. These resources are generated via a script. I use these resources in multiple targets so I have created an aggregate target to make this simple. However, I have not found this simple. If I have the aggregate target output to $(DERIVED_FILE_DIR)/ then it outputs to a path that looks like this DerivedData/BrowserApp-bla/Build/Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/DerivedSources/build/index.html If I then drag that folder into Xcode and create a folder that references it. Then take that reference and make it relative to build products I get this A9DE6A502E41E397005EF4E0 /* build */ = { isa = PBXFileSystemSynchronizedRootGroup; name = build; path = "../../Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/DerivedSources/build"; sourceTree = BUILT_PRODUCTS_DIR; }; This is because to the main BrowserApp target the BUILT_PRODUCTS_DIR is DerivedData/BrowserApp-bla/Build/Products/Debug-iphonesimulator. You can see that the reference essentially has to maneuver out of the built products folder for the main BrowserApp target and into the built products directory for WebBundle. This is ok for a debug build I suppose you can imagine that this is going to break down the moment you have a release build. Now if we ignore that problem then comes the problem of getting it in Copy Bundle Resources. Xcode 16s PBXFileSystemSynchronizedRootGroup is a great improvement but does not help here. The only way I have found to get the folder copied is to hop into an earlier Xcode or make the following modifications. Change the PBXFileSystemSynchronizedRootGroup into a PBXBuildFile (In PBXFileReference section) A9DE6A502E41E397005EF4E0 /* ../../Intermediates.noindex/client.build/Debug/WebBundle.build/DerivedSources/build */ = {isa = PBXFileReference; lastKnownFileType = text; path = ../../Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/DerivedSources/build; sourceTree = BUILT_PRODUCTS_DIR; }; (In the mainGroup PBXGroupSection) A9DE6A502E41E397005EF4E0 /* ../../Intermediates.noindex/client.build/Debug/WebBundle.build/DerivedSources/build */, Then remove any references for A9DE6A502E41E397005EF4E0 as a synchronized group Create a PBXBuildFile using the previous PBXBuildFile as its fileRef then add it to the copy resources stage (In PBXBuildFile section) 96516AC32BF928DD00576562 /* ../../Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/DerivedSources/build in Resources */ = {isa = PBXBuildFile; fileRef = A9DE6A502E41E397005EF4E0 /* ../../Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/DerivedSources/build */; }; (In the PBXBuildResources phase for the resources section of the main target) 96516AC32BF928DD00576562 /* ../../Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/ I do not know of a way to do this with a PBXFileSystemSynchronizedRootGroup so these manual changes seem necessary. After these changes I have the following: And you can confirm the entire folder is accessible to the app. However if you try to build for release/Archive you get lstat(/Users/calebkierum/Library/Developer/Xcode/DerivedData/BrowserApp-bla/Build/Intermediates.noindex/ArchiveIntermediates/BrowserApp/Intermediates.noindex/BrowserApp.build/Debug-iphonesimulator/WebBundle.build/DerivedSources/build): No such file or directory (2) Which makes sense. The file reference has a relative path that explicitly mentions "debug" however because this path is based on an aggregate target I am not sure how you really update this reference for release.
3
0
67
Aug ’25
How to use a folder generated by an Xcode Aggregate Target as a resource in another target?
I have a multi target project where every target relies on a built "web bundle" which is basically a collection of html, optimized images, and optimized javascript. Right now that web bundle is built in a pre build step by running a script. The script takes awhile to run and outputs to a folder that is referenced into the project via a PBXFileReference which is then referenced in the Copy Bundle Resources step. 96516AC22BF928DD00576562 /* build */ = {isa = PBXFileReference; lastKnownFileType = folder; name = build; path = "../web-ui/build"; sourceTree = "<group>"; } .... 96516AC32BF928DD00576562 /* build in Resources */ = {isa = PBXBuildFile; fileRef = 96516AC22BF928DD00576562 /* build */; }; As a step, I wrote an aggregate target that can also run this script. I specified its input and output files and turned off sandboxing. It does exactly what I need it to. Critically it is ran based on dependency analysis. If I modify any file in web-ui it rebuilds, if I dont I can repeatedly build the aggregate target and it will not re-run the script. This is perfect. A97590172E419CBA00741928 /* Build Web Bundle */ = { isa = PBXShellScriptBuildPhase; buildActionMask = 12; files = ( ); inputFileListPaths = ( ); inputPaths = ( "$(SRCROOT)/xcodescripts/build-web-bundle.bash", "$(SRCROOT)/web-ui/index.html", "$(SRCROOT)/web-ui/vite-env.d.ts", "$(SRCROOT)/web-ui/vite.config.ts", "$(SRCROOT)/web-ui/tsconfig.json", "$(SRCROOT)/web-ui/stats.html", "$(SRCROOT)/web-ui/postcss.config.js", "$(SRCROOT)/web-ui/package.json", "$(SRCROOT)/web-ui/justfile", "$(SRCROOT)/web-ui/src/", ); name = "Build Web Bundle"; outputFileListPaths = ( ); outputPaths = ( "$(SRCROOT)/web-ui/build/", ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; shellScript = "exec \"${SCRIPT_INPUT_FILE_0}\"\n"; }; You may notice I reference a src file. This is made possible via a flag USE_RECURSIVE_SCRIPT_INPUTS_IN_SCRIPT_PHASES which allows Xcode to check folder dependencies recursively. The problem is that my other targets do not automatically recognize that they need to run the "WebBundle" aggregate target in order to update a resource they copy in their "Copy bundle resources" phase. So I tried adding it as a Target Dependency. A9DE685B2E41C9A8005EF4E0 /* PBXTargetDependency */ = { isa = PBXTargetDependency; target = A97590132E419C1200741928 /* WebBundle */; targetProxy = A9DE685A2E41C9A8005EF4E0 /* PBXContainerItemProxy */; }; Unfortunately this breaks whatever magic was allowing the script to be run only when there are web bundle changes. Every build it runs the "Build Web Bundle" script. I think what I am missing is a way to specify in these other targets that a resource they are used to copying from the Xcode PBXFileReference is produced by the aggregate target. This way they can start to reason about the dependencies. Other possibilities are that I should be building the web bundle to a separate location. Or that these references are somehow broken in another way. To be clear the folder format is as thus project/ iOS/ client.xcodeproj web-ui/ build/ (web bundle build is output here and referenced relatively) src/ index.html (and other things)
5
0
91
Aug ’25
Unable to Download App Version Information in Xcode Organizer Despite Admin Privileges. (from Reports Hangs, Launches, Disk Writes)
I am writing to report a critical issue with the Xcode Organizer. It is failing to download App Version Information from App Store Connect, which prevents our team from accessing vital performance reports like disk writes, hangs, and launches. Other features such as Crashes, Metric's items work fine. When I open the "Reports" tab in the Xcode Organizer, it consistently shows the following error: Xcode failed to load builds for "{Service}". "{Account}" failed with error: No Versions. [Important Context] What is particularly concerning is that this functionality used to work correctly. We were able to see build versions and access their reports up until a certain build in the past. However, at some point, this stopped working, and now no versions are loaded. Given that I am an Admin and this feature was previously working, the issue does not appear to be a simple permissions problem. It seems a change has occurred, either on the server-side or in how Xcode interacts with our app's record on App Store Connect. Could you please help us understand: What might have caused this sudden change that prevents build versions from being loaded? What steps can we take to resolve this "No Versions" error and restore access to our performance reports? Thank you for your investigation into this matter.
2
0
101
Aug ’25
can't create info.plist from info-> URL Types
Hi, In Google Admob get started page they are suggesting to update info.plist file with keys. https://developers.google.com/admob/ios/quick-start#update_your_infoplist However, I can't find info.plist in the project folder. On the internet, there are videos suggesting to create info.plist file from pressing + under Targets -> info -> URL Types section. Unfortunately , I can't generate the info.plist using that method. How should I proceed? It is difficult to enter all the keys defined in the Google Admob link there are 40+ keys. Thank you for your help.
3
0
79
Aug ’25
AppShortcuts
I currently use AppShortcutsProvider successfully to register AppShortcut items that appear in the Shortcuts app and in Spotlight on iOS 18 (built with Xcode 16.4). However, I'm unable to set a branded image asset (SVG or PNG) as the tile icon — only SF Symbols are allowed via systemImageName: String, and specifying an asset name results in a blank icon in the UI. Interestingly, other apps (e.g. Notes, Talabat, Photos) seem to display a custom image as the shortcut’s icon in Shortcuts, despite current documentation stating otherwise. I'm kindly requesting Apple formalize and support this capability.
1
0
98
Aug ’25
Xcode error uploading to App store connect
Since last week I get this error when uploading my app to app store Connect: Unsupported SDK or Xcode version. Your app was built with an SDK or version of Xcode that isn’t supported. Although you can use beta versions of SDKs and Xcode to build and upload apps to App Store Connect, you need to use the latest Release Candidates (RC) for SDKs and Xcode to submit the app. For details on currently supported SDKs and versions of Xcode, visit: https://developer.apple.com/news/releases. (ID: 18be8ca4-805d-4cc2-9b3d-3c7a97a89c7b) I could upload before. I have the Tahoe Beta 26.0 iOS installed and the xcode 26.0 beta 4. Does anyone has advise on how to solve this issue?
3
0
100
Aug ’25
Unexpected bundle class 16 declaring type public.gpx
I have a minimal macOS document based app written in SwiftUI in Xcode 16.3. It is created from the standard template replacing all occurences of 'com.example.plain-text' with 'com.topografix.gpx' and changing the file extension in info.plist from 'exampletext' to 'gpx'. Those changes are sufficient to allow opening, editing and saving of .gpx files. However, when opening, editing or saving, the following message is written to the console 6 times. Unexpected bundle class 16 declaring type public.gpx While this is not preventing the app from working, I would like to understand the origin of the message and fix the underlying problem.
1
0
151
Aug ’25