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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Network Connection Issue on Xcode 16.3 Simulator
Hi, I just migrated from Xcode 15 to Xcode 16.3 RC. When I run my app on any simulator, iOS 17 or iOS 18, I seeing strange behavior the second time I launch the app. The app uses a few frameworks, such as Firebase Crashlytics, and the network calls all work fine on the initial launch. however, subsequent launches consistently get the following error: Task <17ACD3D4-FB31-4091-A797-D573F31909C2>.<2> finished with error [-1001] Error Domain=NSURLErrorDomain Code=-1001 "The request timed out." UserInfo={_kCFStreamErrorCodeKey=-2102, NSUnderlyingError=0x600000c46910 {Error Domain=kCFErrorDomainCFNetwork Code=-1001 "(null)" UserInfo={_kCFStreamErrorCodeKey=-2102, _kCFStreamErrorDomainKey=4}}, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <17ACD3D4-FB31-4091-A797-D573F31909C2>.<2>, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <17ACD3D4-FB31-4091-A797-D573F31909C2>.<2>" ), NSLocalizedDescription=The request timed out., The only way to run again on that simulator is to Erase All Content and Settings. I did not see this issue in Xcode 16, and my app has been in production for over a year without networking issues. Pushing to my phone works fine. Running on MacBook Pro apple silicon - Sequoia 15.3.2 Any help would be greatly appreciated! Thanks, Mike
11
11
2.7k
Apr ’25
Using Previews causes a system crash on Xcode 26 Beta 4 and MacOS 26 Beta 4
Hey, I've updated to both Xcode 26 Beta 4 and MacOS 26 Beta 4. Both run super stable so far. However, every time I use Xcode Previews for a few minutes, the entire system freezes for a few seconds and then crashes and reboots. I'm trying to generate a system diagnosis (which it offers me after the reboot), but it seems to be stuck generating. It's hard to say what exactly causes the crash, unfortunately. But it happened multiple times after starting to use Xcode Previews. Anyone else has that problem? I've also filed a feedback for this: FB19013059 Cheers Dennis
11
12
609
Aug ’25
Swift Assist
Hi, I'm testing out Xcode 16 beta and I have a couple of questions: Is Swift Assist only available on Sequoia? I see that predictive code completion is per https://www.apple.com/newsroom/2024/06/apple-empowers-developers-and-fuels-innovation-with-new-tools-and-resources/, but I tried the beta on Sonoma and I'm not seeing it Regarding Swift Assist - I understand that code is only used to process requests and never stored on servers, and Apple will not use it to train machine learning models. However, my company's security team may still decide that using Swift Assist is too much of a risk. How can we disable it across multiple developer machines? Thank you!
11
4
13k
Apr ’25
ZSH Won't Run an M1 Command Line Tool Built in Xcode
I have a command line tool that zsh refuses to run when built for Apple Silicon or as a univerisal binary (the specific message is zsh: killed TOOL_NAME). I can only get it to run if I build it exclusively for Intel/Rosetta. Running/debugging from within Xcode works fine for any architecture. The tool is a very simple C/C++ unix command-line tool; it doesn't have any external dependencies beyond the C runtime and the C++ STL. I suspect something in code signing is going awry, but I've tried various team and certificate combinations without any luck. I've also tried enabling/disabling the app sandbox, also without any luck. (The app is not for distribution so it doesn't really need to be code signed at all.) Any suggestions?
11
0
8.3k
Feb ’25
Errors running with ASAN when targeting iOS Devices
I'm unable to run my app with ASAN enabled when targeting a physical iOS device. Simulator targets do work. With Xcode 12 and an iPad mini 4 running iOS 14 beta 1 I get the following error during app launch ==750==ERROR: AddressSanitizer failed to allocate 0xffffffffff9fc000 (-6307840) bytes at address 2db624000 (errno: 22) ==750==ReserveShadowMemoryRange failed while trying to map 0xffffffffff9fc000 bytes. Perhaps you're using ulimit -v With Xcode 11.5 and an iPad Air 2 running OS 12.4.1 the error is ==2177==Unable to find a memory range after restricting VM. ==2177==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clangcompilerrt/clang-1103.0.32.62/compiler-rt/lib/asan/asanmac.cc:92 "((0 &amp;amp;&amp;amp; "cannot place shadow after restricting vm")) != (0)" (0x0, 0x0) &amp;lt;empty stack&amp;gt;==2177==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clangcompilerrt/clang-1103.0.32.62/compiler-rt/lib/asan/../sanitizercommon/sanitizermallocmac.inc:143 "((!asaninitisrunning)) != (0)" (0x0, 0x0) warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available. AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report. (lldb) thread info -s thread #1: tid = 0x1076c2, 0x000000011531e984 libclangrt.asaniosdynamic.dylib`__asan::AsanDie() My coworker is able to use ASAN with the same App using iPad Pro 10.5, iPadOS 13.5.1, Xcode 11.5 Are there any configuration changes I need to make to be able to use ASAN on my devices?
11
1
9.1k
Sep ’24
ChatGPT in Xcode 26 not recognizing Plus subscription
Hi all, Has anyone else run into this issue in Xcode 26? I’m logged into my paid ChatGPT Plus account, but the Xcode integration doesn’t seem to recognize the subscription. After a short period of use, I get the following error: “Over daily limit. ChatGPT in Xcode will be unavailable for up to 24 hours. For higher limits, sign in with a paid ChatGPT account.” Since I’m already signed in with a paid account, this looks like either a bug or a limitation specific to Xcode. Is this expected behavior, or has anyone found a workaround to make Xcode properly recognize Plus accounts? Thanks in advance for any guidance.
11
3
301
1h
Xcode Cloud Dependency Resolution - out-of-date resolved file
When I try to build my iOS app using Xcode Cloud, it encounters an error when trying to resolve packages: an out-of-date resolved file was detected at [path to package.resolved], which is not allowed when automatic dependency resolution is disabled; please make sure to update the file to reflect the changes in dependencies Looking at my package.resolved file, it all seems to be in order. What can I do to fix it?
10
4
7.7k
Oct ’24
Reproducible Builds on iOS
Dear Apple Developer Forum! I'm in need of help regarding an issue that has to do with binaries. I'm building an iOS App that needs a fingerprint of its binaries, exclusively based on the source code written. A "reproducible" build, meaning that when I compile it on my machine and run checksum on it, the output (hash) will be the same, as if another device clones the project, compiles and checksums the values. The App depends on swift packages which depends on Swift Packages, which I've managed to compile to .o files, convert to .a files (static frameworks) and create xcframeworks, which the App depends on. They work great, once compiled, their checksum value does not change when App is compiled (unless source code of them is changed of course), but the Apps executable (checksummed inside the IPA) changes every time it's compiled. I'm guessing that perhaps the Xcode compiler injects a timestamp or other unique identifier in the binaries? Is there any way to have "reproducible" builds on iOS (Swift Xcode)? All input is greatly appreciated, Thank you very much, Kind regards Johan.
10
0
802
Mar ’25
Compile Failure on NSXPCInterface Initializer
I have a project that leverages XPC and has interoperability between Swift and Objective-C++. I am presently getting a compile-time error in one of our unit test targets, of "Argument passed to call that takes no arguments" on the following code: let interface = NSXPCInterface(with: XPCServiceDelegate.self) My XPCServiceDelegate protocol is defined as: @objc(XPCServiceDelegate) public protocol XPCServiceDelegate { //... } For the longest time, this code has compiled successfully, and it has not recently changed. There are two confusing things about this error. The first is that I have a different build scheme that will compile correctly other code with the same structure. The other is that I have team members that are able to compile my failing scheme successfully on the same XCode version, OSVersion, and branch of our repository. I've attempted numerous things to try to get this code to compile, but I've run out of ideas. Here's what I've tried: Clean build both on XCode 16.4 and XCode 26 Beta Delete DerivedData and rebuild on XCode 16.4 and XCode 26 Beta Delete and re-clone our git repository Uninstall and reinstall XCode Attempt to locate cached data for XCode and clear it out. (I'm not sure if I got everything that exists on the system for this.) Ensure all OS and XCode updates have been applied. The interface specification for NSXPCInterface clearly has an initializer with one arguement for the delegate protocol, so I don't know why the compiler would fail for this. Is there some kind of forward declaration or shadowing of NSXPCInterface? Do you have any ideas on what I could try next?
10
0
131
Aug ’25
WWDC24 - Xcode 16 + macOS 15 Beta 1 - Unable to Download Predictive Code Completion Model
Hi Excited to try out the new Xcode Swift code completion ML tools demo'd yesterday at the SOTU. I am running macOS 14.5, using a VM Via Virtualization Framework ( UTM.app) to run macOS 15 Beta 1. Ive installed XCode 16 Beta 1 in my Host OS (macOS 14.5) and was able to successfully install, boot, and set up macOS 15 as a VM client. Ive installed Xcode 16 in my VM Client, and upon launch, was asked to download the Predictive Text model. I see this error: The operation couldn’t be completed. (ModelCatalog.CatalogErrors.AssetErrors error 1.) Domain: ModelCatalog.CatalogErrors.AssetErrors Code: 1 User Info: { DVTErrorCreationDateKey = "2024-06-11 20:11:32 +0000"; } -- Failed to find asset: com.apple.fm.code.generate_small_v1.tokenizer - no asset Domain: ModelCatalog.CatalogErrors.AssetErrors Code: 1 -- System Information macOS Version 15.0 (Build 24A5264n) Xcode 16.0 (23037.4) (Build 16A5171c) Timestamp: 2024-06-11T13:11:32-07:00
10
5
4.2k
Sep ’24
How to disable Temporary Tabs in Xcode?
It's maddening. I just opened a file and now it's gone because I had the audacity to open another file. I've learned that I can double click the tab of the first file to make it a permanent tab... but, of course, I'll need to do that every time I ever open any file ever, and if I close that file and come back to it later I'm going to be constantly having to double click tabs just to make Xcode stop replacing my tabs for me. It's nuts. It's driving me insane. Please. Is there any way to just DISABLE the temporary tabs behavior? I don't find it helpful in any way and I find it to be destructive to my development workflows.
10
4
3.6k
May ’25
Xcode 16.3 Beta3: Developer Documentation Indexing does not end...resulting in Xcode CPU Usage high over long time.
macOS Version 15.3.2 (Build 24D81) After initiating via Shift/Command/0 the Developer Documentation Window, the indexing of v277 index structure is starting /Users/[name]/Library/Developer/Xcode/DocumentationCache/ ==> but unfortunately not ending! Activity Monitor reports during hours high CPU (~80%) for Xcode process, but the indexing does not stop or end. After hours it is still around 146 MB instead of about 550 MB as in previous releases. Indexing starts with 11 or more threads, but suddenly it drops to 10 threads and seems stopping, still using cpu. Also restarting Xcode does not help. Process restarts but after some minutes seems to hang or stuck around 200MB indexed. Also removing subfolders does not help. (NSOperatingSystemVersion(majorVersion/ 16, minorVersion/ 3, patchVersion/ 0) they are recreated but index still stucks after some time. No clue. will reverting back to 16.3 beta2 Reported via FB16926964
10
0
182
Apr ’25
Code signature not valid when running on Simulator in Xcode 16
I just upgraded to Version 16.0 (16A242d) and unfortunately the App that used to run perfectly fine on Xcode 15 is now broken. It crashes right after showing the Launch Screen on the Simulator. Here's the formatted error message in the Console: dyld[80159]: Library not loaded: @rpath/AppName-iOS.debug.dylib Referenced from: <App ID> /path/to/AppName-iOS.app/AppName-iOS Reason: tried: '/path/to/DerivedData/AppName-iOS.debug.dylib' (no such file), '/path/to/CoreSimulator/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/system/introspection/AppName-iOS.debug.dylib' (no such file), '/path/to/AppName-iOS.app/AppName-iOS.debug.dylib' (code signature not valid for use in process: Trying to load an unsigned library), '/path/to/DerivedData/PackageFrameworks/AppName-iOS.debug.dylib' (no such file), '/path/to/AppName-iOS.app/Frameworks/AppName-iOS.debug.dylib' (no such file), '/path/to/CoreSimulator/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot/usr/lib/AppName-iOS.debug.dylib' (no such file) For some reason the Library is unsigned and I've checked all the settings with no luck.
10
0
2.3k
Oct ’24
Xcode 16.3 Doesn't Remember Preview Pane Width
It seems like, by default, the preview pane tries to align to 50% of the editor pane's width. I prefer to shrink the preview pane to around ~30% of the screen so I have more space for code. This used to work fine—at least until I restarted Xcode. I never understood why the setting wouldn’t persist across sessions, but fine, that was a tradeoff I was willing to live with. However, with Xcode 16.3, it seems like Xcode forgets the manually adjusted preview pane width as soon as I switch to a different file. This has definitely impacted my productivity, as I now find myself readjusting the pane size dozens of times in a single session. Am I holding it wrong? Is anyone else experiencing this? And while we’re at it—why not make this a persistent setting so everyone can tweak the width to their liking?
10
8
295
Apr ’25
Unable to use iOS simulator below version 26 after installing Xcode 26 Beta 3
I installed the third beta of Xcode 26 with Xcode 16.4 installed on my machine. Once Xcode 26 was installed, all of my previous simulators were wiped out, leaving only the default iOS 26 simulators. I cannot create new simulators for iOS versions below 26. Here are my failed attempts to fix the issue: Restarted Xcode 16.4 and my machine Reinstalled the iOS 18.5 runtime Uninstalled Xcode 26 and iOS 26 runtime Reinstalled Xcode 16.4 Now, I literally cannot use a simulator in Xcode 16.4. Here is what I see when I try to create a new simulator in Xcode 16.4: According to Xcode, the iOS 18.5 runtime is installed, so I have no idea what is going on. Is this a known issue? And how do I get Xcode 16.4 working with the iOS simulator?
10
0
579
Jul ’25
Xcode "Connect via network" is stuck, controls disabled
Hi, since a while now, I've noticed that in Xcode 15 (beta 8), my iOS device running iOS 17 (latest beta), I can't seem to disable the setting "Connect via Network" in the Devices and Simulators window. The controls are disabled, and stuck to 'on'. I often also have issues with the 'Installing to device' step while development my apps, where a reboot of the iPad is required. My guess is that it gets stuck/confused how it is supposed to deploy and my network setup is a bit complicated due to VPN's, tight WiFi security etc. Unpairing the device doesn't help with resetting this setting. After unpairing the top-right header (with the Take Screenshot controls etc...) even still shows the details of the unpaired device. Anyone else has experienced this or know a solution.
10
14
5.8k
Jan ’25
On Log Noise - Debugging
I came across several "errors" being reported when I run my app, however my app seems to function correctly. I believe they fall in the category listed on this ( now locked ) thread https://developer.apple.com/forums/thread/115461 However, I wanted to post the ones I found to clarify ( close to submission) just in case any of these end up being more than just log noise later. PLEASE let me know if you've come across these before and whether they impacted anything or if you can confirm they are just log noise. Thanks in advance! -[RTIInputSystemClient remoteTextInputSessionWithID:performInputOperation:] perform input operation requires a valid sessionID. inputModality = Keyboard, inputOperation = , customInfoType = UIEmojiSearchOperations AVAudioSession_iOS.mm:2,223 Server returned an error from destroySession:. Error Domain=NSCocoaErrorDomain Code=4099 “The connection to service with pid 102 named com.apple.audio.AudioSession was invalidated from this process.” UserInfo={NSDebugDescription=The connection to service with pid 102 named com.apple.audio.AudioSession was invalidated from this process. CAReportingClient.mm:532 Attempted to remove a reporter not created by this client { careporter_id=408,331,130,765,320 } load_eligibility_plist: Failed to open //private/var/db/os_eligibility/eligibility.plist: Operation not permitted(1) - I verified and this file is indeed in non read mode on my Mac for the user. However it affects nothing. The following 2 pop up - although I have no explicit code or 3P code ( nor Ads) that require impressions - each time I click on the Game Center Access Point post authentication. Cannot add impressions because no tracker is specified by the metrics fields context. Did you forget to set one from your view controller or data source? Cannot add page fields because none are specified by the metrics fields context. Did you forget to add an PageMetricsPresenter to the object graph used for actions?
10
2
2.9k
Jun ’25
PreviewShell crashes and breaks the preview canvas
Since the first beta of Xcode 16, randomly when editing a SwiftUI view a crash report opens with the message "PreviewShell quit unexpectedly." After that, annoyingly often the canvas fails to reload correctly, and shows this broken thing: The only way to get it working again is to restart Xcode, but it happens so often that it really impacts productivity. Does this happen to anyone else? If so, have you found a solution? I've already filed a report (FB14876223)
9
8
3.3k
Sep ’24