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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Using com.apple.application-instance for per-customer installers
We distribute our macOS products as a PKG downloaded from our website. To simplify configuration for our customers, we create a PKG for each customer that contains identifying data for that customer. We are currently doing this by notarizing the PKG for each customer and uploading the result. Since we sometimes exceed the notarization limit of 75/day, we began investigating other ways of including the identifying data. One avenue seemed to be the extended attribute com.apple.application-instance, but after experimentation it appears that this attribute does not persist through downloads. There are very few resources describing this attribute (TN2206) but a close reading seems to confirm that the attribute has to be set on the user’s machine. Can you confirm that this is the case? Is there any other way for customizing an installer PKG that won’t run afoul of notarization limits?
1
0
60
Aug ’25
Why doesn’t Apple fix Xcode’s performance and stability issues?
**Background: Many iOS/macOS developers have faced issues like: • Autocomplete randomly stopping • Indexing freezing or slowing down • SwiftUI previews breaking unexpectedly • Build process hanging or crashing Even after multiple updates, these issues seem to come back in different forms. ** Do you think Apple should consider a full architectural rewrite of Xcode? Would separating SDK updates from IDE updates help? How do you personally deal with Xcode’s instability in your workflow?
1
0
126
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
In Xcode 26 ß (iOS 26 simulator) UIBarButtonItem content disappear when tapped
Just testing an existing app with Xcode 26. I notice that content of UIBarButtonItem (either text or image) disappears when tapped (and reappear on release). Those are custom, bordered buttons. Attribute inspector: Buttons in Xcode: When selected in Xcode, we see a rectangle inside the rounder rect of iOS 26 In simulator: When tapped in simulator: I have edited code from backButton.setTitleTextAttributes([ .font : boldFont, .foregroundColor : UIColor.systemBlue, ], for: .normal) to backButton.setTitleTextAttributes([ .font : boldFont, .foregroundColor : UIColor.systemBlue, ], for: [.normal, .focused, .selected, .highlighted]) to no avail. What am I missing ?
1
0
212
Aug ’25
No active account
I created an app that uses the camera function in Xcode, but it says I don't have camera permission. The app only runs once and then won't run again. The log below says "No active account." Is this because my paid account isn't properly reflected in Xcode? In Xcode Settings > Account, I'm logged in my acciunt, with the team set to "my Organization name" and the role set to "admin." However, in Manage Certificates, the Status is blank. It should say "Valid." How can I properly reflect my account in Xcode? Error enumerating all transactions: Error Domain=ASDErrorDomain Code=509 "No active account" UserInfo={NSLocalizedDescription=No active account}
0
0
123
Aug ’25
load_eligibility_plist errors
I'm just getting started with swift development using Xcode 164 on a MacBook Pro running Sequoia 15.6. When I try to run the simplest "Hello World" app against iPhone simulators, I get the error messages below. I've looked at that location and none of the directory structure /private/var/db/eligibilityd below the 2224B135-8383-4C69-B339-B6DF9D88F6FD folder exists. Just wondering if I have a config error somewhere or if there's somewhere else I should be looking to correct this. It doesn't occur when I run on a physical iPhone device. Error message: load_eligibility_plist: Failed to open /Users/****/Library/Developer/CoreSimulator/Devices/DB1919F3-ECB8-4C55-817C-85B68F083F57/data/Containers/Data/Application/2224B135-8383-4C69-B339-B6DF9D88F6FD/private/var/db/eligibilityd/eligibility.plist: No such file or directory(2) Failed to send CA Event for app launch measurements for ca_event_type: 0 event_name: com.apple.app_launch_measurement.FirstFramePresentationMetric Failed to send CA Event for app launch measurements for ca_event_type: 1 event_name: com.apple.app_launch_measurement.ExtendedLaunchMetrics
0
1
201
Aug ’25
Xcode 26 Link Error
Using xcode 26 with linker flag -ld_classic,get an error : 0 0x1042b9778 __assert_rtn + 160 1 0x1042bc560 ld::tool::SymbolTableAtom&lt;x86_64&gt;::classicOrdinalForProxy(ld::Atom const*) (.cold.3) + 0 2 0x1041f3da8 ld::tool::SymbolTableAtom&lt;x86_64&gt;::classicOrdinalForProxy(ld::Atom const*) + 172 3 0x1041f4c1c ld::tool::SymbolTableAtom::addImport(ld::Atom const*, ld::tool::StringPoolAtom*) + 140 4 0x1041f6500 ld::tool::SymbolTableAtom::encode() + 396 5 0x1041e83a8 ___ZN2ld4tool10OutputFile20buildLINKEDITContentERNS_8InternalE_block_invoke.413 + 36 6 0x182a95b2c _dispatch_call_block_and_release + 32 7 0x182aaf85c _dispatch_client_callout + 16 8 0x182acc478 _dispatch_channel_invoke.cold.5 + 92 9 0x182aa7fa4 _dispatch_root_queue_drain + 736 10 0x182aa85d4 _dispatch_worker_thread2 + 156 11 0x182c49e28 _pthread_wqthread + 232 A linker snapshot was created at: /tmp/app-2025-06-13-215652.ld-snapshot ld: Assertion failed: (it != _dylibToOrdinal.end()), function dylibToOrdinal, file OutputFile.cpp, line 5196. clang++: error: linker command failed with exit code 1 (use -v to see invocation)
17
5
1.6k
Aug ’25
Generating Dark Mode isn't working.
I'm writing an app using the latest Xcode 26 beta, and I'm finding an issue with dark mode and Date and time pickers. Basically, when I preview a view using the canvas in Xcode, it works as expected, however, when I build and run the app in a simulator or on my phone, dark mode looks horribly wrong. When I try building the app using Xcode 16, it looks as expected, but with Xcode 26, it looks like the shot. I haven't seen anything listed as a bug, but I'd appreciate any suggestions. Thanks.
2
0
61
Aug ’25
Xcode Simulator Can't Boot
I am facing a recurring issue with Xcode iOS simulator. 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: Deleting Xcode cache Reinstalling iOS Simulator runtimes Completely uninstalling Xcode and deleting all developer data, then reinstalling None of the above steps fix the problem. The only fix I have found is to completely reinstall MacOS 15.4.1. THIS IS TERRIBLE! I have already reinstalled MacOS 15.4.1 once to fix the issue, and I don't want to do it again. If there is another solution, please help me find it! Thank you!!
15
2
300
Aug ’25
Why does dependency analysis work for a script that outputs a folder that is copied in copy bundle resources but not once that script is moved to an aggregate target?
This question is a component of this question and an extension to this question which has been solved. This situation might feel a pinch constructed but it is a simplified version of one step of the original question. Basically in my app I have a script that outputs a folder with a few files inside of it. This folder is output to $(BUILT_PRODUCTS_DIR)/build/ and is referenced via a PBXBuildFile. Because I put a wait in the script (to simulate a long build I have in my real project) it is very obvious when the script is or isn't run. The goal would be for it to run only when its dependencies have changed. The trick is if I put this script as a "run script" phase within my final target dependency analysis works great. The script only runs when the dependencies are updated. However if I put the "run script" phase into an aggregate target then add it as a Target Dependency in the main target Xcode wants to run the script every time. Regardless of if the dependencies have changed. However if you build just the aggregate target alone everything goes just fine. It only builds when it has to. To me this does not quite make sense. I thought that dependency analysis of the script within my aggregate target would be the same regardless of whether that script was within the aggregate target or the main target. In my app I ideally need the aggregate target to be shared by multiple other targets. While I could put the script in each it would be more foolproof to have them share an aggregate target. Why would dependency analysis come to a different conclusion when the script is within an aggregate target that is a target dependency of the main target? If it helps here is the script and the entire project can be found here on GitHub if you would like to play with it. mkdir -p "${SCRIPT_OUTPUT_FILE_0}/build/" echo "Pausing for 10 seconds before creating files..." sleep 10 cat "${SCRIPT_INPUT_FILE_0}" cat > "${SCRIPT_OUTPUT_FILE_0}/build/index.html" << EOF <!DOCTYPE html> <html> <head> <title>Simple Page</title> </head> <body> <h1>Welcome to Simple Page</h1> <p>Generated at: $(date)</p> </body> </html> EOF cat > "${SCRIPT_OUTPUT_FILE_0}/build/page.html" << 'EOF' <!DOCTYPE html> <html> <head> <title>Simple Page</title> </head> <body> </body> </html> EOF
0
0
44
Aug ’25
tvOS icon missing layers
I have an AppleTV app which I released in 2016. I've updated it and released a new version every year without much hassle. This year, with tvOS 17.2, the layered app icon isn't working right. This is a two-layer image made with PNGs. When it's selected, it looks right and the layers move correctly: But when it's not selected, the background layer disappears: Screenshots are from the simulator but it also happens on the device. It's inconsistent; sometimes it's the front layer that disappears. Occasionally both layers work, but I can't tell why. I've spent a day trying everything. Very frustrated. The icon previews correctly in Xcode and in Parallax Viewer. The image sizes are correct: 400 x 240 for Small, 800 x 480 for Small@2x, 1280 x 768 for Large. The back layer is a non-transparent PNG. I tried adding a Large@2x set. Didn't help. Originally I had a three-layer image with no middle layer PNG. I deleted the empty middle layer, but that didn't help. All the PNG files are from GnuIMP. Same color space, even. I was using the filenames tvicon-back-s.png and tvicon-back-s@2x.png. I tried taking out the @ sign in case that was confusing Xcode. (It never has before, but I am flailing here.) Anybody have any clues? If it's an Apple bug and there's nothing I can do, I'm going to just push the release button and hope it fixes itself someday.
7
0
1.4k
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
Cannot find 'atomic_flag' in scope in Xcode 26
Hi, In Xcode 16.4, the atomic_flag() method can be used, but in Xcode 26.0, it is not available. An error message saying Cannot find 'atomic_flag' in scope is displayed. This can be reproduced simply by trying to use atomic_flag() in a newly created empty project. Thank you. Xcode: Version 26.0 beta 4 (17A5285i), macOS: 15.5(24F74) import SwiftUI struct ContentView: View { var body: some View { VStack { Image(systemName: "globe") .imageScale(.large) .foregroundStyle(.tint) Text("Hello, world!") } .padding() .task { _ = atomic_flag() } } }
1
1
108
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