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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class
Can anyone explain why I would be getting this warning ? [Internal] Thread running at User-interactive quality-of-service class waiting on a lower QoS thread running at Default quality-of-service class. Investigate ways to avoid priority inversions. The code (NB: This method is called on the main thread) - (void)parseAudioTracks:(NSArray<AVAssetTrack *> *)audioTracks { NSMutableArray<AVAudioMixInputParameters *> *inputParameters = [NSMutableArray arrayWithCapacity:audioTracks.count]; NSMutableArray *tracksNames = [NSMutableArray array]; NSMutableArray *tracksChannels = [NSMutableArray array]; NSUInteger lastChannel = 0; for ( NSUInteger i = 0 ; i < audioTracks.count; i++ ) { AVAssetTrack *track = audioTracks[i]; for ( AVMetadataItem *item in track.metadata ) <-- WARNING HERE ...```
2
0
66
1w
Xcode 26, _UIAccessibilityTraitToggleButton crash , under iOS 26
hi , There is a crash when we run on an **iOS 16 real device ** if we set a .toggleButton trait for accessibilty . it has version check as apple doc refers (IOS 17 +) but it crashes so there is someinconsistency between availbility in ios 18 + , somehow other xcodes made it available from 17 for now we commented our code , but would like dto report this to be fixed cheers
0
0
31
1w
Running external binaries from Swift Package (TTS engine): Operation not permitted from Xcode app
Hi everyone, We’re developing a macOS SwiftUI app that uses a local Swift Package (CasSherpaCore) to invoke an external compiled binary (sherpa-onnx-offline-tts) for text-to-speech synthesis using system calls. The package works flawlessly when tested from terminal or via a lightweight test C program. However, when we invoke it from a SwiftUI app (even when Full Disk Access granted to Xcode and Terminal), we consistently get the error: sh: /Users/xxxxxxxxxxx/SherpaONNX/sherpa-onnx/build/bin/sherpa-onnx-offline-tts: Operation not permitted We’ve tried: Granting Full Disk Access to Xcode and Terminal. Removing the quarantine flag with xattr -d com.apple.quarantine. Setting executable permission via chmod +x. Using both system() and Process in C and Swift contexts. Testing within a Swift Package that’s integrated into the app as a local dependency. Running the command manually from terminal (works perfectly). It appears that macOS (or Xcode’s runtime sandbox) is restricting execution of binaries from certain locations or contexts when launched via system() inside the app. Questions: Is there a specific entitlement or configuration that allows execution of local binaries from a SwiftUI macOS app? Is this related to System Integrity Protection (SIP) or a hardened runtime limitation? Are there best practices or alternative approaches to safely execute local TTS binaries from within a Swift app? Any help would be deeply appreciated. This is a core feature in our project and we’re stuck at this point. Thank you so much in advance!
1
0
41
1w
How to disable Stereo Spatialization in Apps
I have an App that has working audio for most devices except for iOS18 + Air pods pro connected. Eventually I realized that this is due to the Audio Spatialization which is enabled by default. I found a information property list key called AVGameBypassSystemSpatialAudio which can be enabled to true AVGameBypassSystemSpatialAudio and now the audio works for 90% of the game. However my game has a .MP4 which when it is played will be paused when the air pods are connected and after force skipping the video the Spatialization is now enabled and the app no longer has audio. I checked through the logs and found this part mediaplaybackd <<<< FigFilePlayer >>>> itemfig_establishedStereoAudioSpatializationPreferenceForAsset: <0x53451c000|I/OWH.01>: Stereo Spatialization allowed by default due to asset containing video After this line I can see the Spatialization being enabled. Does anyone know how to disable this auto setting of stereo Spatialization by default?
0
0
88
1w
Device not detected
Trying to test applications on AVP as opposed to simulator. AVP can connect to MacBook via Mac virtual display so connection exists, but in X code under Windows devices the AVP does not show up same holds true on the AVP itself under remote devices. The MacBook Pro does not appear. I am signed in under the same account on the same Wi-Fi network. I have tried all basic troubleshooting. It is not clear to me that I am logged in as a developer, which could be the issue, but I am using OS 26, which does not appear to have the developer option under privacy and security where it used to reside in previous versions of the OS.
0
0
77
1w
Apple Watch Logs and Debugging
Developing a standalone app for the Apple Watch. Unless I turn off Bluetooth on the paired iPhone, the Apple Watch’s Wi-Fi deactivates every ~30 seconds, which causes the connection to Xcode to drop. How is this supposed to work? I can see my app’s logs in Xcode, but I can’t view any other system logs from the Apple Watch. I tried using the Console app, with the iPhone connected via USB, trusted, etc, but I don't see any system logs. How can I access full system logs? Thanks!
1
0
122
1w
Proper includes into Package.swift
Ok, I have a bit of special problem. I want to use the "Swift Upcoming Feature Flags" in my packages. The problem is that we have quite a lot of Packages in a quite deep tree: at the root of the Package directory there are four dirs: AppA/ AppB/ Shared/ Temporary/ also the packages ExternalLibs and BuildPlugins. Temporary contains Packages that need rework and the other three subdirs each contain the subdirs: Features/ Utilities/ Services/ All in all there are over 100 packages. Now I would like to use definitions like https://github.com/treastrain/swift-upcomingfeatureflags-cheatsheet to use in the Package.swift files. And as you might guess, I do not want to copy those into each and every Package.swift file. It seems like SPM is only finding includes by itself if they are in the exact same directory as the Package.swift file 🙄 That's not at all helpful… Has anyone found a way to do useful includes into Package.swift files? Any help appreciated. Thank You Roddi
0
0
94
1w
Strange error when trying to upload app containing a Help Book
I create a help book for my macOS app and it works locally. However, when I try to upload the app to App Store Connect I get a strange error: Image: Text: Bad CFBundleExecutable. Cannot find executable file that matches the value of CFBundleExecutable in the nested bundle DottieHelp [com.gingerbeardman.Dottie.pkg/Payload/Dottie.app/Contents/Resources/DottieHelp.help] property list file. (ID: 48052567-91cc-43ca-8d7c-0f14bd60e6da) This is curious, because there is no executable in the help file. If I delete CFBundleExecutable from the help target in Xcode, it keeps coming back. Why? But if I do an Archive build, then go deep into the bundle and manually remove entry for CFBundleExecutable then the build uploads fine. Any ideas how I can prevent Xcode from adding CFBundleExecutable key to the info.plist of a help file? macOS 14.7.6 (23H626) Xcode 16.2 (16C5032a)
2
0
94
2w
Xcode 26: Cannot generate provisioning profile for Mac Catalyst app in macOS 26 VM
Filed FB17873536 for this, posting here for reach. I cannot create a provisioning profile to run my Mac Catalyst app on a macOS 26 VM for my project with automatically manage signing (Xcode Managed Profile) enabled. I keep getting an error that “There is a problem with the request entity A device with number '' already exists on this team.” Disabling the device in Certificates, Identifiers, & Profiles does not work; I get the prompt to register the device on the next build but it results in the same error. “Download Manual Profiles” does not work, either. Additionally, in developer beta 2 (macOS build 25A5295e, Xcode build 17A5241o), I now get a second error message that Provisioning profile "Mac Catalyst Team Provisioning Profile: doesn't include the currently selected device "Virtual Machine" (identifier ). Clearing out the existing files in ~/Library/Developer/Xcode/UserData/Provisioning Profiles/ didn’t work either. Steps to reproduce: Create and set up a macOS 26 VM in the latest version of UTM for Mac Install Xcode 26 in the VM and sign into your Apple ID in Xcode preferences Open a Mac Catalyst app’s Xcode project and attempt to build it An alert comes up that the device is not registered in the developer account. Click the Register button to register it The process fails with the error mentioned above and it’s impossible to build for Mac Catalyst after this point. (Sign to Run Locally is not an option for me because I use entitlements that remove that option) I would appreciate any advice on how to get this working. Hopefully I will not have to create an entirely new macOS 26 VM. Thank you!
1
0
228
2w
Suddenly, cannot install app on device
Hi, I am using Xcode 16.4, and my test device is Iphone 16 pro max. Everything was working fine until today when I get an error that I cannot install the app on the device. The error I get is: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.cRjyg7/extracted/[myapp].app : 0xe8008015 (A valid provisioning profile for this executable was not found.) Please ensure sure that your app is signed by a valid provisioning profile. Creating a new project and installing it to the mobile works fine. Please can someone from Apple or the community respond? there are many posts with this error but none were solved. Troubleshooting attempts included: Resetting all certificates. delete the app from the device unpairing device codesigning via cli reloading older git code commit Nothing is working. thanks
1
1
470
2w
xcodebuild/codesign failing over SSH on 15.x Host OS
We're seeing a pretty big problem with 15.x hosts and using SSH to execute builds. Yet this works just fine in the terminal over VNC. We see similar limitations with SSH and Virtualization too. They look related, but don't know. Xcode 16.4 15.4.1 Host OS Mac Mini M1. Let me know what else is needed. + xcodebuild -workspace /Users/veertu/anka-arm/./Anka.xcworkspace . . . build build /Users/veertu/anka-arm/build/Build/Products/Release/libpolicy.dylib: errSecInternalComponent Command CodeSign failed with a nonzero exit code ** BUILD FAILED ** /Users/veertu/anka-arm/build/Build/Products/Release/libpolicy.dylib: errSecInternalComponent Command CodeSign failed with a nonzero exit code ** BUILD FAILED ** Watching the Console logs I see . . . codesign CSSM Exception: -2147415840 CSSMERR_CSP_NO_USER_INTERACTION codesign error while checking integrity, denying access: CSSM CSSMERR_CSP_NO_USER_INTERACTION error 14:53:57.404848-0500 codesign SecKeyCreateSignature failed: Error Domain=NSOSStatusErrorDomain Code=-25308 "CSSM Exception: -2147415840 CSSMERR_CSP_NO_USER_INTERACTION" (errKCInteractionNotAllowed / errSecInteractionNotAllowed: / Interaction is not allowed with the Security Server.) UserInfo={numberOfErrorsDeep=0, NSDescription=CSSM Exception: -2147415840 CSSMERR_CSP_NO_USER_INTERACTION} default 14:53:57.405567-0500 codesign MacOS error: -2070 . . .
1
1
142
2w
Only see "Personal team" although I've been added to my company team
Hello, I've been added as an "App Manager" to a team of my company to which the app I'm developing belongs. I've received the invite e-mail, done all required step. On the websites (Apple Developer and App Store Connect), everything to be fine: I properly appear as a member of the team, I see the application, I can edit it. However, when I log in in Xcode with that account, I only see the "Personal team". Therefore, I got the error "Failed Registering Bundle Identifier" (which makes sense since the app belongs to the team of my company, not to my Personal team). Since the Apple ID I used is my personal Apple ID (which happens to be my personal email address), and I already done some stuff with it, I feared that there was a problem with this particular Apple ID. Therefore, we tried to add me to the team with my professional email address. This time, we added this address as a Developer in the Team. But still the same problem: When I tried to log in in Xcode with that 2nd address, I still only see the Personal team. Note that professional email address has never been used on any Apple product before. I also tried to log out / log in multiple times, restarting XCode, and still the same problem. What are we missing? How can I be able to select the right team in Xcode?
0
0
15
2w
Xcode Crash on View Hierarchy debugger for mixed UIKit / SwiftUI app
For a large / older iOS app project, we have noticed the the view hierarchy debugger works fine for our UIKit screens, but runs into the following crasher whenever we try to launch the view hierarchy debugger on a UIHostingVC screen with SwiftUI content: Unable to capture the view hierarchy "AppName" encountered an unexpected error when processing the request for a view hierarchy snapshot. -- The operation couldn’t be completed. Log Title: Data source expression execution failure. Log Details: error evaluating expression “(BOOL)[[(Class)objc_getClass("DebugHierarchyTargetHub") sharedHub] performRequestInPlaceWithRequestInBase64:@"..."]”: error: Execution was interrupted, reason: EXC_BAD_ACCESS (code=2, address=0x16b23bff8). Has anyone successfully resolved the underlying issue in this crasher? Tried all the typical recommendations for a clean build, clear derived data, use the "Debug -> View Debugging" menu - all with no resolution. Reported using Feedback Assistant: FB18514200 Thanks
1
0
116
2w
What is the minimum supported value for -mmacosx-version-min?
I have XCode 16.4 installed with macOS SDK 15.5. When building using that SDK, what is the oldest/minimum supported value for -mmacosx-version-min? Specifically, is -mmacosx-version-min=11.0 still supported? Also, has it been announced for macOS 26 what the oldest/minimum supported value will be for -mmacosx-version-min? Specifically, will -mmacosx-version-min=11.0 still be supported? Where would this be documented?
1
0
25
2w
A Summary of the WWDC25 Group Lab - Developer Tools
At WWDC25 we launched a new type of Lab event for the developer community - Group Labs. A Group Lab is a panel Q&A designed for a large audience of developers. Group Labs are a unique opportunity for the community to submit questions directly to a panel of Apple engineers and designers. Here are the highlights from the WWDC25 Group Lab for Developer Tools. Will my project codebase be used for training when I use Xcode's intelligent assistant powered by cloud-based models? When using ChatGPT without logging in, your data will not be used to improve any models. If you log in to a ChatGPT account, this is based on your ChatGPT account settings, which allows you to opt-out (it defaults to on). When using Xcode with accounts for other model providers, you should check with the policies of your provider. And finally, at no point will any portion of your codebase be used to train or improve any Apple models. We'd love to make our SwiftUI Previews (and soon, Playgrounds) as snappy as possible. Is there any way to skip certain build steps, such as running linters? It seems the build environment is exactly the same (compared to a debug build), but maybe there's a trick. Starting with Xcode 16, SwiftUI previews use the exact same build artifacts as the regular build. The new Playgrounds support in Xcode 26 uses these build artifacts too. Shell script build phases are the most common thing that introduces extra build time, so as a first step, try turning off all shell script build phases (like linters) to get an idea if that’s the issue. If those build phases add significant time to your build, consider moving some of those phases into asynchronous steps, such as running linters before committing instead of on every build. If you do need a shell script build phase to run during your build, make sure to explicitly define the input and output files, as that is a huge way to improve your build performance. Are we able to provide additional context for the models, like coding standards? Documentation for third party dependencies? Documentation on your own codebase that explains things like architecture and more? In general, Xcode will automatically search for the right context based on the question and the evolving answer, as the model can interact multiple times with your project as it develops an answer. This will automatically pick up the coding style of the code it sees, and can include files that contain architecture comments, etc. Beyond automatic context, you can manually attach other documents, even if they aren't in your project. For example, you could make a file with rules and ideas and attach it, and it will influence the response. We are very aware of other kinds of automatic context like rule files, etc, though Xcode does not support these at this time. Once ChatGPT is enabled for Coding Intelligence in Xcode 26, and I sign into my existing ChatGPT account, will the ChatGPT Coding Intelligence model in Xcode know about chat conversations on Xcode development done previously in the ChatGPT Mac app? Xcode does not use information from other conversations, and conversations started in Xcode are not accessible in the web UI or ChatGPT app. Is there a plan to make SwiftUI views easier to locate and understand in the view hierarchy like UIKit views? SwiftUI uses a declarative paradigm to define your user interface. That allows you to specify what you want, with the system translating that into an efficient representation at runtime. Unlike traditional AppKit and UIKit, seeing the runtime representation of SwiftUI views isn't sufficient in order to understand why it's not doing what you want. This year, we introduced a SwiftUI Instrument that shows why things are happening, like view re-rendering. Is it possible to use the AI chat with ChatGPT Enterprise? My company doesn't allow us to use the general ChatGPT, only the enterprise version they have setup that prevents data from being leaked Yes, Xcode 26 supports logging into any existing ChatGPT account, including enterprise accounts. If that does not meet your needs, you can also setup a local server that implements the popular chat completions REST API to talk to your enterprise account how you need. Now that Icon Composer is here, how does it complement or replace existing vector design tools such as Sketch for icon design? Icon Composer complements your existing vector design tools. You should continue to create your shapes, gradients, and layers in another tool like Sketch, and compose the exported SVG layers in Icon Composer. Once you bring your layers into Icon Composer, you can then use it to influence the translucency, blur, and specular highlights for your icon. What’s one feature or improvement in the new Xcode that you personally think developers will love, but might not immediately discover? Maybe something tucked away or quietly powerful that’s flown under the radar so far? One feature we're particularly excited about is the new power profiler for iOS, which gives you further insights into the energy consumption of your app beyond what was possible with the energy instrument previously. You can learn more about how to use this instrument and how it can help you greatly reduce your apps battery usage in the documentation, as well as the session Profile and optimize power usage in your app. There were also improvements in accessibility this year with Voice Control, where you can naturally speak your Swift code to Xcode, and it understands the Swift syntax as you speak. To see it in action, take a look at the demonstration in What’s new in Xcode 26. We have a software advisory council that is very sensitive to having our private information going to the cloud in any form. What information do you have to help me guide Xcode and Apple Intelligence through the acceptance process? One thing you can do is configure a proxy for your enterprise that implementing the popular Chat Completions API endpoint protocol. When using a model provider via URL, you can use your proxy endpoint to inspect the network traffic for anything that you do not want sent outside of your enterprise, and then forward the traffic through the proxy to your chosen model provider. Are there list of recommended LLMs to use with Xcode via Intelligence/Local? I've tried Gemma3-12B, but.. I hope there are better options? Apple doesn't have a published list of recommended local models. This is a fast-moving space, and so a recommendation would become out of date very quickly as new models are released. We encourage you to try out the local model support in Xcode 26 with models that you find meet your needs, and let us and the community know! (continued below)
1
0
305
2w
StoreKit2: Testing AppTransaction Receipt Verification?
I just boxed up AppTransaction API. In the debug environment it appears to always return a VerificationResult that is .verified Unlike Storekit1 calling AppTransaction.shared does not seem to cause a sandbox receipt to actually get written on the app bundle in Derived data. I was trying to purposefully mess with the receipt in order to get AppTransaction to fail so I can test how my app behaves when errors occur but there is no receipt to mess with. I tried using the old exit(173) API and it does cause a receipt to be fetched but that seems to be completely ignored by AppTransaction, it validates even if you trash or tamper with the receipt given by exit(173). Is there a good way to test receipt validation failure using the high level Storekit2 API?
1
1
83
2w