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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Created

Video cannot be found in the bundle error message
I am having difficulty coding my video to play in the app I am developing. My video file is located in the navigator pane, along with the other swift files in the project, with an A to the right hand side of the file, which I thought means it is available in the bundle. Unfortunately, an error saying the video cannot be found in the bundle shows at the bottom of my Xcode screen, after previewing the project. The file names match. Any further trouble shooting I'm doing references the old Xcode app, so I am stuck.
2
0
202
3w
XCUIDevice.shared.appearance = .dark no longer works when running UI tests via xcodebuild on newer iOS versions
I am seeing a regression with XCUIDevice.shared.appearance = .dark in UI tests that only affects xcodebuild, not Xcode’s UI test runner. Setup • UI tests written using XCTest • Dark mode forced in setUp() using: XCUIDevice.shared.appearance = .dark • Tests target an iOS simulator • Same test target, same scheme Expected behavior The app launches in Dark Mode for UI tests, as it did previously. Actual behavior • When running UI tests from Xcode (Product > Test), Dark Mode is applied correctly. • When running the same UI tests via xcodebuild test, Dark Mode is ignored and the app launches in Light Mode. • No test failures, no warnings, no logs indicating the appearance override was skipped. Regression details • This used to work on older iOS versions when running via xcodebuild. • The regression appears after updating iOS simulators (exact version boundary still unclear). • No relevant changes were made to the test code, scheme, or CI configuration. • xcodebuild otherwise launches and runs UI tests normally. Notes • The issue is specific to XCUIDevice.shared.appearance. • Other UI test functionality behaves as expected. • This makes CI results inconsistent with local Xcode runs and breaks visual assumptions in snapshot and layout-based tests. Question Is this a known regression or an intentional behavior change in recent iOS / Xcode versions? If intentional, what is the supported way to reliably force Dark Mode in UI tests when running via xcodebuild? This currently makes xcodebuild-based CI UI testing unreliable compared to Xcode’s test runner.
1
0
68
3w
`ImageRenderer.render` halts program with `EXC_BREAKPOINT` inside SwiftUI/AttributeGraph
This extension View { public func renderSomething() async throws { let renderer = ImageRenderer(content: self) // renderer.colorMode = .linear renderer.render { size, context in print(size) // ... } // ... } } let view: some View = ... view.renderSomething() // → exception will cause the program to exit with EXC_BREAKPOINT deep inside SwiftUI. This worked with previous versions of Xcode, SwiftUI, and macOS. Xcode Version 26.2 (17C52), macOS Sequoia 15.7.3, using toolchain bundled with Xcode.
0
0
27
3w
Cannot overwrite Swift package default traits in Xcode
I am using swift-subprocess, and need to disable the SubprocessSpan trait because Xcode 26.2 does not ship with a bundled version libswiftCompatibilitySpan.dylib, causing everything to crash built with Xcode that happens to use Span. However, I cannot disable that trait by doing any of the following things: .package( url: "https://github.com/swiftlang/swift-subprocess.git", branch: "main", traits: [] ), .package( url: "https://github.com/swiftlang/swift-subprocess.git", branch: "main", traits: [.trait(name: "SubprocessFoundation")] ), Note that SubprocessSpan is default trait in subprocess: // Enable SubprocessFoundation by default var defaultTraits: Set<String> = ["SubprocessFoundation"] #if compiler(>=6.2) // Enable SubprocessSpan when Span is available [except it is not] defaultTraits.insert("SubprocessSpan") #endif The package still builds with the SubprocessSpan enabled. This is not an issue with the subprocess package. According to this, I should use swift build on the command line, yet this isn't -- as is upgrading to Tahoe -- an option because I need Xcode previews for SwiftUI. Help, what do I do now (other than downloading a toolchain) from swift.org)?
0
0
45
3w
Bug: Xcode 26.2 wants `ENABLE_DEBUG_DYLIB`: How do I enable that in `Package.swift`?
Xcode tells me Previewing in executable targets now requires a new build layout for unoptimized builds. Either set ENABLE_DEBUG_DYLIB to YES for this target, or break out your preview code into a separate framework with its own scheme. How do enable that in Package.swift. swiftSettings don't work (.define and unsafeFlags with -D ...). Creating a library product that the executable then depends on doesn't help either. I have two targets, one is an executable target. The #Preview macro is in the non-executable target.
2
1
110
3w
Installed Xcode - Canvas fails to boot
Downloaded Xcode 26.2 from App Store. Started new Project, which defaults to "hello world". The canvas "simulator" within fails to finish indexing (paused), or When the canvas is active, the first code change (i.e. just a return key at the end of a line) cause the Xcode program to come to a stop. Have ended Xcode and rebooted a number of times. A number of remedies are posted on the net. All a little different than the other. Is there a current remedy for Xcode 26.2 to this issue available? iMac on Sequoia 15.7.3 , 800 gb of available storage Xcode: 26.2 (24553) Instruments: 26.2 (64573.16) SDKs: DriverKit: 25.2: iOS: 26.2: (23C53) iOS Simulator: 26.2: (23C53) macOS: 26.2: (25C57) tvOS: 26.2: (23K50) tvOS Simulator: 26.2: (23K50) visionOS: 26.2: (23N301) visionOS Simulator: 26.2: (23N301) watchOS: 26.2: (23S303) watchOS Simulator: 26.2: (23S303)
1
0
119
3w
Uncategorized (Xcode): Unable to find a destination matching the provided destination specifier: { id:45967BD9-44E0-4D5D-8C43-C5437F48836A }
Hello I am using 26.2 (25C56) on my m4 air. when I am working on a Flutter project suddenly my app crashed and after when I tried to build the application again this error occurs. How to fix it. ? Launching lib/main.dart on iPhone 16e in debug mode... Xcode build done. 2.4s Failed to build iOS app Uncategorized (Xcode): Unable to find a destination matching the provided destination specifier: { id:45967BD9-44E0-4D5D-8C43-C5437F48836A }Available destinations for the "Runner" scheme: { platform:macOS, arch:arm64, variant:Designed for [iPad,iPhone], id:00008132-001E5102020B801C, name:My Mac } { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device } { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device } Could not build the application for the simulator. Error launching application on iPhone 16e.
1
0
63
3w
Debugging help: BUG IN CLIENT: For mixed reality experiences please use cp_drawable_compute_projection API
Hi, we've been developing an XR application for Apple Vision Pro which has worked fine so far. Now that the SDKs have updated to 26.2 (for Xcode and AVP versions) we've run into an error that prevents the app from launching. I get the following error when running the application in the AVP Simulator (building for destination Apple Vision Pro (26.2), and my colleague gets the same error when building for the device itself and launching there. BUG IN CLIENT: For mixed reality experiences please use cp_drawable_compute_projection API Type: Error | Timestamp: 2026-01-13 09:21:57.242191+02:00 | Process: My XR App | Library: CompositorNonUI | TID: 0x75e2c (copied with "all metadata") How can we debug this further? The error in the console doesn't seem to give any stack trace or clear pointer to the code which relates to it. I've tried searching for CompositorNonUI, but that doesn't yield any results in our project (nor Google nor the Apple developer forums). There is one post in the forum that has a similar error (https://developer.apple.com/forums/thread/788500?answerId=845039022#845039022) but searching in our project and it's dependencies, we don't seem to use ".tangent" anywhere either. Any help in either debugging to find more details on where the issue happens or pointers to fixing it much appreciated, thanks!
1
0
116
3w
App Store submission validation failed: Missing info.plist value WKApplication
I've developed a Multiplatform app under Xcode 26 (currently using 26.2 17C52). The current destinations of the single target are Mac, iPad and Mac(designed for iPad). The minimum deployments are MacOS 15.6 and iOS 18.6. All destinations build and perform correctly on physical devices (running OS 26 versions). The MacOS version has been submitted successfully to the AppStore for TestFlight usage. However, the iPad version shows a submission validation failure: Missing Info.plist value. A value for the key “WKApplication”, or “WKWatchKitApp” if your project has a WatchKit App Extension target, is required in “xxxxx.app/xxxxx.app” bundle. For details, see: https://developer.apple.com/documentation/watchkit/creating_independent_watchos_apps/setting_up_a_watchos_project (ID: 4911506c-39c3-4b69-a8bb-5e5dcd3dc2fb) The app has no WatchKit version (although one's planned for a future release). The Target's Build Settings include a "watchOS Deployment Target" and Info.plist values related to WatchKit. The Build Settings also include similar settings for TVOS and VisionOS. I'm unable to delete the aforementioned Build Settings (Can't select & use the delete key). The link in the message provides no help. Is this a bug in Xcode, or am I missing something? Regards, Michaela
2
0
113
3w
Library not loaded: @rpath/libswiftCompatibilitySpan.dylib – Building bundle target
I am building a bundle target for macOS 12 and later using Xcode. The bundle is not a standalone app, but a plug-in that is loaded by a host app. The code is written in Swift and uses the new Span API which is available in the OS-provided standard library in macOS 26 and backdeploys to macOS 10.14.4+. Xcode should instruct the linker to include libswiftCompatibilitySpan.dylib in the compiled bundle to provide this backdeployment, but that does not happen. SwiftPM does this additional linking by adding an rpath. When trying to load the bundle using the NSBundle.loadAndReturnError() API, I get the following error on macOS 15 (and no error on macOS 26): Error Domain=NSCocoaErrorDomain Code=3588 "dlopen(.../MyBundle.someBundle/Contents/MacOS/MyBundle, 0x0109): Library not loaded: @rpath/libswiftCompatibilitySpan.dylib Referenced from: <CE92806C-94B7-367E-895D-EF6DF66C7FC2> .../MyBundle.someBundle/Contents/MacOS/MyBundle Reason: tried: '/usr/lib/swift/libswiftCompatibilitySpan.dylib' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/libswiftCompatibilitySpan.dylib' (no such file), '/private/Frameworks/libswiftCompatibilitySpan.dylib' (no such file), '.../MyBundle.someBundle/Contents/MacOS/../Frameworks/libswiftCompatibilitySpan.dylib' (no such file), '/usr/lib/swift/libswiftCompatibilitySpan.dylib' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/libswiftCompatibilitySpan.dylib' (no such file), '/private/Frameworks/libswiftCompatibilitySpan.dylib' (no such file), '.../MyBundle.someBundle/Contents/MacOS/../Frameworks/libswiftCompatibilitySpan.dylib' (no such file)" UserInfo={NSLocalizedFailureReason=The bundle couldn’t be loaded., NSLocalizedRecoverySuggestion=Try reinstalling the bundle., NSFilePath=.../MyBundle.someBundle/Contents/MacOS/MyBundle, NSDebugDescription=dlopen(.../MyBundle.someBundle/Contents/MacOS/MyBundle, 0x0109): Library not loaded: @rpath/libswiftCompatibilitySpan.dylib Referenced from: <CE92806C-94B7-367E-895D-EF6DF66C7FC2> .../MyBundle.someBundle/Contents/MacOS/MyBundle Reason: tried: '/usr/lib/swift/libswiftCompatibilitySpan.dylib' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/libswiftCompatibilitySpan.dylib' (no such file), '/private/Frameworks/libswiftCompatibilitySpan.dylib' (no such file), '.../MyBundle.someBundle/Contents/MacOS/../Frameworks/libswiftCompatibilitySpan.dylib' (no such file), '/usr/lib/swift/libswiftCompatibilitySpan.dylib' (no such file, not in dyld cache), '/System/Volumes/Preboot/Cryptexes/OS/usr/lib/swift/libswiftCompatibilitySpan.dylib' (no such file), '/private/Frameworks/libswiftCompatibilitySpan.dylib' (no such file), '.../MyBundle.someBundle/Contents/MacOS/../Frameworks/libswiftCompatibilitySpan.dylib' (no such file), NSBundlePath=.../MyBundle.someBundle, NSLocalizedDescription=The bundle “MyBundle” couldn’t be loaded.} My setup: Xcode 26.2 macOS 26.2 (25C57) SDK (Built-in)
8
0
340
3w
Xcode Using 90GB with ~/Library/Developer — What Can I Safely Clean?
Hi everyone, I’m an iOS developer working on a Mac with limited storage (256 GB). I’ve noticed that the ~/Library/Developer folder is taking up almost 90 GB, mainly due to Xcode-related content. Inside it I see folders like: Xcode/DerivedData DocumentationCache iOS DeviceSupport UserData CoreSimulator/Devices Before deleting anything, I’d like to understand which of these folders are safe to clean up, and what the potential side effects might be (for example, rebuild times, simulator re-downloads, etc.). What is the recommended best practice to manage disk space when using Xcode on a low-storage machine? Thanks in advance for your help.
2
0
148
3w
Integration of other inputs to the Vision Pro
Hi, is it possible to integrate an out source input to the Vision Pro. What I want to achieve is, use a live video/ live feedback inside an application I'm developing, and present the video in a registered position in live space. If possible, does the input need to be from a specific type? are there other limitation for those kind of integrations?
0
0
63
3w
DerivedData on external drive breaks framework tests
Xcode, under Settings → Locations → Derived Data, lets us set a custom DerivedData location (such as on an external drive). Trying that, I discovered that this breaks the test system for Framework targets (and probably other types of test targets when not hosted in an app target) when the run destination is “My Mac”. This seems to be due to sandboxing (but this is not entirely clear). Xcode does not provide a warning about this limitation, and does not seem to offer a way to open sandbox access to an external volume(s). Instead, trying to run such tests results in a bunch of error messages in the console log that I did not find helpful in trying to diagnose what went wrong: Cannot find executable for CFBundle 0x86c47c2a0 </Volumes/external/Xcode/DerivedData/Build/Products/Debug/MyFrameworkTests.xctest> (not loaded) The bundle “MyFrameworkTests.xctest” couldn’t be loaded because its executable couldn’t be located. Try reinstalling the bundle. Program ended with exit code: 9 The solutions seem to be either run tests from the command line (to escape sandboxing), or just use the default DerivedData location (and accept its impact on the internal drive’s limited space).
0
0
23
3w
Xcode26.2构建的.a库,在Xcode16上运行正常。但是在Xcode13运行报错,报错内容如下:
Link EaseChat (arm64)34.1 seconds Undefined symbol:_objc_msgSend$appld Undefined symbo: objc msgSendssetisExitprocess Undefined symbol_objc_msgSendssetisWaitingLoginRoom: Undefined symbol_objc-misgSend$sleepForTimeinterval: Undefined symbol: objc_msgSendsisunsetting Undefined symbol: _objc_msgSend$subpathsAtPath:Untdetme vmbol!-sbie-miesentetoue yarp orse urityap icationtrou dent Undefined symbol: _obic-_msgSendsURLByAppendingPathComponent:isDirectory:Unerined symhol.-sbie- masindtereas pretory atlgtryohininronetate brectort Undefined symbol: -obic-msgSendScreatezegoReplayKitshareLogDirtNeedUntef nes ymhteo!-otbie-mesentdera otieton baevetr Undefined symbol: Undefined symbol: obic msssendsbolForkey: Undefined symbol:_obic_msgSendsintegerForkey: Undefined symbol:_objc_msgSendsnumberwithinteger: undefined symbol:_objc_msgSendsisWaitingLoginRoom Undefined ymbal!. sbic.-massendsgrevareteplay yecodayr_objc-_msgSendsprepareReplayLiveCapture Undefined symbol:_objc_msgSendssetConfig: Undefined symbol: -objc-ImsgSend SvidedEncodeResolutioUndefined symbol:_objc_msgSendssetRoomConfig: Undefined symbol:_objc_msgSend$roomapi undefined symbol: objc_msgSendssetUseriD: Underfined symbolt obic-massendssetLogintoken Undefined symbol_objc-_msgSendsmyUserDefaults2 Undefined symbol: -objc- msgSendstringForkey:SUundefined symteal -sbie-nasentesarcstrinatmoctenath entcadings ant
1
0
64
3w
Xcode Interface Localization
I understand that mastering essential English skills is fundamental for developers. However, as a Chinese developer, having an IDE with a Chinese interface when encountering Xcode operational issues can absolutely make development work twice as effective with half the effort. A native-language interface environment allows us to focus all our energy on project development. Xcode exists as our development “tool” to facilitate our work, not as another knowledge point requiring study—which could waste significant effort. Don't let an interface turn our beloved tool into a burden. Translated with DeepL.com (free version)
1
0
179
3w
DYLD_PRINT_STATISTICS
Did DYLD_PRINT_STATISTICS stop working? I am using Xcode 26.0.1 and have tried it on several simulators and real devices, but am not getting any output. I haven't used this environment variable in a few years so don't know when it might have stopped working. Has it been superseded or replaced?
2
0
238
3w
Xcode 26 swiftmodules are incompatible with Xcode 16
I am developing a binary SDK for consumption by others. When we updated to Xcode 26, any builds which are generated cannot be consumed by Xcode 16. The specifics lie in the optionals. The following Swift code generate a .swiftmodule func affectedApi() -> Int? { return 1 } In Xcode 16 it generated the following .swiftmodule in the framework. public func affectedIntApi() -> Swift.Int? In Xcode 26 it adds an "if" statement. #if compiler(>=5.3) && $NonescapableTypes public func affectedIntApi() -> Swift.Int? #endif That if statement prevents Xcode16 from seeing the API, and it causes compile failures. This happens regardless of which Swift version is used, and it only affects functions which use Optionals. Is there a way to prevent the compiler from wrapping the API in that statement?
2
0
130
3w
Can't specify platform version for xcodebuild download 26.x
Prior to iOS 26.0 we were able to download specific simulator runtimes from the command line by using a command like xcodebuild -downloadPlatform iOS -buildVersion 18.0 This is described in the documentation here. This no longer works for 26.x. If I run the following command: "xcodebuild -downloadPlatform iOS -buildVersion 26.0" it fails with the following error: "Finding content... iOS 26.0 is not available for download." If I omit the -buildVersion flag it will download the latest version, currently 26.2, but if I try and specify 26.2 as the buildVersion I still get "iOS 26.2 is not available for download". This behavior has been confirmed on Xcode 26.2. Perhaps related, it appears these runtimes are also no longer being made available for download on https://developer.apple.com/download/all
0
1
150
3w
XCTest resources aren't being copied into place correctly
So I have a project with an Objective-C framework which has unit tests. One of the unit tests has a file 'sample.emlx' in its 'Resources' folder, which has its target membership set to the tests target. I expect this file to be copied into the correct place, such that I can find it (in the 'setup') method with: NSBundle *bundle = [NSBundle bundleForClass:[self class]]; NSString *path = [bundle pathForResource:@"sample" ofType:@"emlx"]; NSData *content = [NSData dataWithContentsOfFile:path]; NSString *entire = [NSString stringWithUTF8String:content.bytes]; _sample = [entire componentsSeparatedByString:@"\n"]; NSLog(@"sample lines: %d", (int)_sample.count); The idea is to make an array where I can pull various subsections of lines out to test various parts of the code. This works every time, if I set a breakpoint at the "create the NSBundle" line, and single-step through the code after right-clicking on the specific test method I want to run It never works if I just right-click on the specific test method I want to run and allow it to run freely. I will always see "sample lines: 0" This is with the latest public Xcode, I haven't tried any beta variant.
0
0
45
3w