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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

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
222
4d
Code Coverage Not Accurate in Xcode 26
Description: I’m noticing that the code coverage metrics in Xcode 26 are not accurate compared to earlier versions. In Xcode 15, the same set of unit tests shows around 38% coverage, but in Xcode 26, even though all the tests are running successfully (for example, the SegmentedUI test cases), the code coverage is displayed as 0%. Has anyone else observed this behavior in Xcode 26? Is there any known issue, workaround, or configuration change required to get the correct coverage report? Environment: Xcode 26 iOS 18 SDK Unit tests running under XCTest Any insights or suggestions would be appreciated.
2
4
398
4d
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
58
4d
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
18
4d
"Failed to install or launch the test runner" error
We have multiple Jenkins jobs running UI Tests on a Mac with a device attached. This works most of the time but sometimes the tests don't run and the xcreport generated has an error like: BCOVBRDCoverageUITests-Runner encountered an error in BCOVBRDCoverageUITests failed with: Failed to install or launch the test runner. (Underlying Error: Failed to create directory on device 'Brightcove's iPhone 14 Plus' (00008110-000C54912246401E) to hold runtime profiles for application with bundle ID 'com.brightcove.BCOVBRDCoverageUITests.xctrunner': (null). (Underlying Error: The system failed to get the path on the remote device for the provided domain. (Underlying Error: The connection was interrupted.))) Has anyone else run into this? Any ideas on how to get around it? Kicking off another job after seeing this behavior works fine. The failures seem to be random or we haven't noticed a pattern yet.
1
1
663
4d
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
63
5d
Xcode Crashes when viewing XCUITest Result
I've been working on UI Tests for a month or two and things have been great. But I believe there was a recent update to Xcode [running Version 26.2 (17C52)] and since then about 80% of the time when I try to view the test results so I can see the screenshots and video, Xcode crashes hard and I have to open it again. I've tried cleaning the Build folder and Derived Data and all sorts of stuff like that. Restarted Xcode, restarted my computer, etc. Any idea of how I can avoid these crashes?
3
1
169
5d
ISO 14443-4 Reading issue
I am working with a Texas Instruments RF430 NFC tag, which is compliant with: ISO/IEC 14443-4 (ISO-DEP) NFC Forum Type 4 Tag NFC-B protocol NDEF-formatted storage I’m using an iPhone 12 running iOS 18, and my app uses the Core NFC framework. Using NFCNDEFReaderSessionDelegate, I am able to successfully read the first NDEF message from the tag. However, the tag stores multiple NDEF messages, and I would like to access the others. Based on the tag’s specification, these messages are accessible via an NDEF file located at file ID 0xE104. To try and access this additional NDEF file, I attempted to use NFCTagReaderSession with the NFCTagReaderSessionDelegate, intending to issue APDU commands. However, the tagReaderSession(_:didDetect:) delegate method is never called, even though the tag is present and detected using NFCNDEFReaderSession. My questions: Does Core NFC on iOS 18 support issuing custom APDU commands to ISO 14443-4 (NFC-B) tags like the TI RF430? Is the use of NFCTagReaderSession with NFC-B fully supported for tags that implement ISO-DEP (even if they are NDEF-formatted)? Is there any known limitation or configuration required to ensure tagReaderSession(_:didDetect:) is triggered for NFC-B/ISO-DEP tags?
3
0
294
5d
Help: Compiled Timeline Issues
I have developed a fun living diorama world using Reality Composer Pro and XCode. Everything is as it should be, and it looks/works great ... until it does not. If I seem to make any change to any of the 10 timelines that I am using (all on the same scene, no nested scenes), running the app in simulator, device, and via testflight throws errors around compiled timelines, leading to the black screen of death. Every time I clean and run, the timelines in questions might change. Its very frustrating and impossible to track down. Heres are some examples. AssetLoadRequest failed because asset failed to load '/ (3661553931319769725 Timeline (RealityFileAsset)URL/file:///var/containers/Bundle/Application/F4408256-6014-4264-9E4B-F74AEF0EDE53/SantasVillage.app/RealityKitContent_RealityKitContent.bundle/RealityKitContent.reality/Timeline_779.compiledtimeline)' (failed to register asset) Asset / (13631856135570808851 AnimationLibraryAsset (RealityFileAsset)URL/file:///var/containers/Bundle/Application/F4408256-6014-4264-9E4B-F74AEF0EDE53/SantasVillage.app/RealityKitContent_RealityKitContent.bundle/RealityKitContent.reality/AnimationLibraryAsset_1.compiledanimationlibraryasset) failure: failed to register asset Asset 10430065658338454790 AnimationScene (RealityFileAsset)URL/file:///var/containers/Bundle/Application/F4408256-6014-4264-9E4B-F74AEF0EDE53/SantasVillage.app/RealityKitContent_RealityKitContent.bundle/RealityKitContent.reality/AnimationScene_14.compiledanimationscene failure: failed to register asset I went with recommended fixes of closing RCP > Clean Build Folder > Delete Derrived Date (multiple ways) > Re-Open Xcode > Reset Package Cache > Re-Open RCP via XCode > Make a Change > Save > Clean Build Folder Again > Run. Sometimes it works. Most times it does not. I then found my own little work-around, but its not always working as is literally costing me days of wasted time messing around with this. I will DISABLE all timelines, do the above clean method, rerun with no timelines, and it resolves. Then, turn on timelines ONE BY ONE and run until I get another error. Then, rebuild that timeline and nothing else. This is not sustainable. There must be some better way to do this? Or, perhaps I am doing something wrong? Please help if you can.
3
0
213
6d
Unable to download iOS simulator runtime 26.x on Xcode
Hi everyone, I'm experiencing a persistent issue for months now where I'm unable to download the iOS 26 simulator Runtime. I've tried reinstalling Xcode and also Xcode Beta but same issue. iOS 26 Simulator is also not on developers download page, so manual installation is impossible. And sadly I can't compile any code without having iOS 26 simulator installed. Anyone able to get passed this? Hardware: M1 Pro OS: Tahoe 26.1 Heres the error Download failed. Domain: DVTDownloadableErrorDomain Code: 41 User Info: { DVTErrorCreationDateKey = "2026-01-07 11:35:35 +0000"; } -- Download failed. Domain: DVTDownloadableErrorDomain Code: 41 -- Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({ RequestedBuild = 23C54; }) Domain: DVTDownloadsUtilitiesErrorDomain Code: -1 -- Download failed due to not being able to connect to the host. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime) Domain: com.apple.MobileAssetError.Download Code: 60 User Info: { checkNetwork = 1; } -- System Information macOS Version 26.1 (Build 25B78) Xcode 26.2 (24553) (Build 17C52) Timestamp: 2026-01-07T12:35:35+01:00
2
1
311
6d
iOS Simulators Fail Download
I've been going through different fixes for a few weeks and nothing seems to work. Prior to updating everything to iOS 26 and OS 26, everything worked normally except for the predictive code which wouldn't download. Download failed. Domain: DVTDownloadableErrorDomain Code: 41 User Info: { DVTErrorCreationDateKey = "2026-01-02 23:41:12 +0000"; } Download failed. Domain: DVTDownloadableErrorDomain Code: 41 Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({ RequestedBuild = 23C54; }) Domain: DVTDownloadsUtilitiesErrorDomain Code: -1 Download failed due to a bad URL. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime) Domain: com.apple.MobileAssetError.Download Code: 49 User Info: { checkConfiguration = 1; } System Information macOS Version 26.0 (Build 25A354) Xcode 26.2 (24553) (Build 17C52) Timestamp: 2026-01-02T16:41:12-07:00 What I've Tried Cleared caches Restarted my machine Reinstalled Xcode Installed other versions of Xcode Installed Xcode-beta Using a VPN Not using a VPN Changing DNS settings Using a different Wifi network Using an older machine Using an older OS I've run out of options and I have no idea what else to do. The issue every time seems to point back to Apple servers.
1
1
176
6d
When trying to run SwiftUI previews, it fails with "SimulatorShutdownUnexpectedlyError - Simulator was shutdown during an update"
My main app target builds fine and can run on Simulator without issue. Whenever I try to run a Preview, I get this error: == DATE: Monday, November 3, 2025 at 2:52:23 PM Pacific Standard Time 2025-11-03T22:52:23Z == PREVIEW UPDATE ERROR: SimulatorShutdownUnexpectedlyError: Simulator was shutdown during an update Simulator [F85A5AF1-F52C-4662-AFCD-762F87AF537D] failed to boot and may have crashed. This seems like it started happening after updating to MacOS 26. I've tried reinstalling all Simulators, tried on Xcode 26, deleted derived data, restarted Xcode and my Mac several times. What other troubleshooting steps can I take?
4
1
139
6d
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
41
6d
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
42
6d
Can safe area layout guidelines be used in a macOS XIB?
The documentation of the NSPopover property hasFullSizeContent says that when it's true, you should Use the safeAreaLayoutGuide of the contentViewController view to ensure that your content is fully visible and doesn’t become clipped when displayed. I can do that by adding auto-layout constraints programmatically, but is there a way to do it in the xib? When I googled it, the AI summary begins To use safe areas in a Mac XIB (Interface Builder), enable the "Use Safe Area Layout Guides" checkbox in the File Inspector for your view but I have not found any non-AI indications that such a checkbox exists for macOS. (I'm using Xcode 26.2.)
0
0
44
1w