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

Posts under Xcode tag

200 Posts

Post

Replies

Boosts

Views

Activity

Resolving a "Simulator runtime is not available" error
Some Macs recently received a macOS system update which disabled the simulator runtimes used by Xcode 15, including the simulators for iOS, tvOS, watchOS, and visionOS. If your Mac received this update, you will receive the following error message and will be unable to use the simulator: The com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime is not available. Domain: com.apple.CoreSimulator.SimError Code: 401 Failure Reason: runtime profile not found using "System" match policy Recovery Suggestion: Download the com.apple.CoreSimulator.SimRuntime.iOS-17-2 simulator runtime from the Xcode To resume using the simulator, please reboot your Mac. After rebooting, check Xcode Preferences → Platforms to ensure that the simulator runtime you would like to use is still installed. If it is missing, use the Get button to download it again. The Xcode 15.3 Release Notes are also updated with this information.
0
0
9.7k
May ’24
iOS Simulator fails to boot (18.6 / 26.1 / 26.2) – launchd_sim could not bind to session
Hi, I’m facing a consistent simulator boot issue that appears to start after iOS 18.2 simulator runtimes and persists in 18.6, 26.1, and 26.2. Observed behavior iOS 18.2 simulator works fine iOS 18.6 simulator does NOT boot iOS 26.1 / 26.2 simulators do NOT boot Tried everything reinstall/clear cache and all and event formatted the system Unable to boot the Simulator NSPOSIXErrorDomain Code: 4 Failure Reason: Interrupted system call Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit responding macOS: Sequoia Xcode: 26.1, 26.2 Machine: Apple Silicon Unable to boot the Simulator. Domain: NSPOSIXErrorDomain Code: 4 Failure Reason: Interrupted system call User Info: { DVTErrorCreationDateKey = "2025-12-26 02:19:27 +0000"; IDERunOperationFailingWorker = "_IDEInstalliP.honeSimulatorWorker", Session = "com apple CoreSimulator.SimDevice CCDECA56-4A59-491B-A830-0F3928FCD957"; } Failed to start launchd_sim: could not bind to session, launchd_sim may have crashed or quit responding Domain: com.apple.SimLaunchHostService.RequestError Code: 4 Event Metadata: com.apple. dt. DERunOperationWorkerFinished : { "device_identifier" = "CCDECAE6-4A59-491B-A830-0E3928FCD957"; "device_model" = "iPhone18, 1"; "device_osBuild" = "26.1 (23B86)"; "device_osBuild_monotonic" = 2301008600; "device_os_variant" = 1; "device_platform" = "com apple.platform.iohonesimulator"; "device_platform_family" = 2; "device_reality" = 2; "device_thinningType" = "iPhone18,1"; "device_transport" = 4; "launchSession_schemeCommand" = Run; "launchSession_schemeCommand_enum" = 1; "launchSession_targetArch" = arm64; "launchSession_targetArch_enum" = 6; "operation_duration_ms" = 1183; "operation_errorCode" = 4; "operation_errorDomain" = NSPOSIXErrorDomain; "operation_errorWorker" = "_IDEInstalliPhoneSimulatorWorker"; "operation_error_reportable" = 1; "operation_name" = IDERunOperationWorkerGroup; "param_consoleMode" = 1; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 3; "param_destination_isProxy" = 0; "param_destination_platform" = "com apple platform Please help on this as it got stuck. Thanks
4
5
546
17m
Application Hangs with Nested LazyVStack When Accessibility Inspector is Active
Description I've encountered a consistent hang/freeze issue in SwiftUI applications when using nested LazyVStack containers with Accessibility Inspector (simulator) or VoiceOver (physical device) enabled. The application becomes completely unresponsive and must be force-quit. Importantly, this hang occurs in a minimal SwiftUI project with no third-party dependencies, suggesting this is a framework-level issue with the interaction between SwiftUI's lazy view lifecycle and the accessibility system. Reproduction Steps I've created a minimal reproduction project available here: https://github.com/pendo-io/SwiftUI_Hang_Reproduction To Reproduce: Create a SwiftUI view with the following nested LazyVStack structure: struct NestedLazyVStackView: View { @State private var outerSections: [Int] = [] @State private var innerRows: [Int: [Int]] = [:] var body: some View { ScrollView { LazyVStack(alignment: .leading, spacing: 24) { ForEach(outerSections, id: \.self) { section in VStack(alignment: .leading, spacing: 8) { Text("Section #\(section)") // Nested LazyVStack LazyVStack(alignment: .leading, spacing: 2) { ForEach(innerRows[section] ?? [], id: \.self) { row in Text("Section #\(section) - Row #\(row)") .onAppear { // Load more data when row appears loadMoreInner(section: section) } } } } .onAppear { // Load more sections when section appears loadMoreOuter() } } } } } } Enable Accessibility Inspector in iOS Simulator: Xcode → Open Developer Tool → Accessibility Inspector Select your running simulator Enable Inspection mode (eye icon) Navigate to the view and start scrolling Result: The application hangs and becomes unresponsive within a few seconds of scrolling Expected Behavior The application should remain responsive when Accessibility Inspector or VoiceOver is enabled, allowing users to scroll through nested lazy containers without freezing. Actual Behavior The application freezes/hangs completely CPU usage may spike The app must be force-quit to recover The hang occurs consistently and is reproducible Workaround 1: Replace inner LazyVStack with VStack LazyVStack { ForEach(...) { section in VStack { // ← Changed from LazyVStack ForEach(...) { row in ... } } } } Workaround 2: Embed in TabView TabView { NavigationStack { NestedLazyVStackView() // ← Same nested structure, but no hang } .tabItem { ... } } Interestingly, wrapping the entire navigation stack in a TabView prevents the hang entirely, even with the nested LazyVStack structure intact. Questions for Apple Is there a known issue with nested LazyVStack containers and accessibility traversal? Why does wrapping the view in a TabView prevent the hang? Are there recommended patterns for using nested lazy containers with accessibility support? Is this a timing issue, a deadlock, or an infinite loop in the accessibility system? Why that happens? Reproduction Project A complete, minimal reproduction project is available at: https://github.com/pendo-io/SwiftUI_Hang_Reproduction
2
0
134
8h
Document Type Export / Import in Xcode - Shared via Messages
I’ve created a document type for my app and set it up in the Info Configuration in Xcode. This all works as expected: Implemented with the Transferrable API and ShareLink, I can share an app’s file via the Files app or Notes and then import the file via a Share extension and the fileImport swiftUI api. My question is regarding Messages, specifically. It appears as a ShareLink option and I’m able to send my app’s document type via a message, but I’m unable to open it or share it (internally, with my app), other than being able to forward or delete it. If I copy the file, I can’t access it within my app (it’s still stored in the Messages private bundle) and startAccessingSecurityScopedResource returns false as expected. The message does detect the right icon, so it’s recognizing the custom document type. If my Share Extension, exported document type, and transferable implementation is configured correctly, should I be able to open a file for my app shared via Messages? Is this an allowed action? I get various answers from AI, and I can’t test this in the Simulator on pre-26 devices.
0
0
19
9h
Getting "Something went wrong" when changing Xcode version to 26.2 for a Xcode Cloud workflow
My workflow is using Xcode 16.4 and macOS Tahoe 26.2 (25C56). I am trying to change Xcode version to 26.2. When I click Save after some time I get "Something went wrong" error message without any additional details (see screenshot). I get the same error for the following cases: Tried changing a different workflow Tried to deactivate a workflow Tried various combinations of Xcode (26.1, 26.1.1, 26.2) + mac OS (26.1, 26.2) Tried creating a new workflow with Xcode 26.2 (haven't tried any other Xcode versions though)
0
0
5
12h
Using an API key with xcodebuild commands for Enterprise builds
Hey folks, Looking for some assistance with using an API key with xcodebuild commands to archive/export builds on our Enterprise developer account. The goal here is to allow Xcode to completely manage signing/certificates with our cloud distribution certificate, since these builds are happening in CI and we don't want to be manually handling user sessions/certificates on these machines. This is working great with our App Store account, but with our Enterprise account we're getting errors both archiving and exporting the builds. Here's an example of an export command that is giving errors: xcodebuild -exportArchive -exportOptionsPlist /path/to/exportOptions.plist -archivePath /path/to/archive.xcarchive -exportPath /path/to/export -authenticationKeyID *** -authenticationKeyIssuerID *** -authenticationKeyPath /path/to/key.p8 -allowProvisioningUpdates I've put some example values there, but we've double/triple checked the real values when this is actually running. These are the errors we're getting: 2026-02-02 12:30:04.022 xcodebuild[59722:1854348] DVTServices: Received response for 0794248F-E534-474D-ABBF-40C1375B6590 @ <https://appstoreconnect.apple.com/xcbuild/QH65B2/listTeams.action?clientId=XABBG36SBA>. Error = Error Domain=DVTPortalResponseErrorDomain Code=0 "Communication with Apple failed" UserInfo={NSLocalizedDescription=Communication with Apple failed, NSLocalizedRecoverySuggestion=A non-HTTP 200 response was received (401) for URL https://appstoreconnect.apple.com/xcbuild/QH65B2/listTeams.action?clientId=XABBG36SBA} 2026-02-02 12:30:04.173 xcodebuild[59722:1854348] DVTServices: Received response for 1D51FCD1-1876-4881-BE89-DD44E78EA776 @ <https://appstoreconnect.apple.com/xcbuild/QH65B2/listTeams.action?clientId=XABBG36SBA>. Error = Error Domain=DVTPortalResponseErrorDomain Code=0 "Communication with Apple failed" UserInfo={NSLocalizedDescription=Communication with Apple failed, NSLocalizedRecoverySuggestion=A non-HTTP 200 response was received (401) for URL https://appstoreconnect.apple.com/xcbuild/QH65B2/listTeams.action?clientId=XABBG36SBA} 2026-02-02 12:30:04.322 xcodebuild[59722:1854344] DVTServices: Received response for 25D7983F-1153-47C9-AE8A-03A8D10B6453 @ <https://appstoreconnect.apple.com/xcbuild/QH65B2/listTeams.action?clientId=XABBG36SBA>. Error = Error Domain=DVTPortalResponseErrorDomain Code=0 "Communication with Apple failed" UserInfo={NSLocalizedDescription=Communication with Apple failed, NSLocalizedRecoverySuggestion=A non-HTTP 200 response was received (401) for URL https://appstoreconnect.apple.com/xcbuild/QH65B2/listTeams.action?clientId=XABBG36SBA} 2026-02-02 12:30:04.483 xcodebuild[59722:1854344] DVTServices: Received response for 8A56C98B-E786-4878-856F-4D7E3D381DEA @ <https://appstoreconnect.apple.com/xcbuild/QH65B2/listTeams.action?clientId=XABBG36SBA>. Error = Error Domain=DVTPortalResponseErrorDomain Code=0 "Communication with Apple failed" UserInfo={NSLocalizedDescription=Communication with Apple failed, NSLocalizedRecoverySuggestion=A non-HTTP 200 response was received (401) for URL https://appstoreconnect.apple.com/xcbuild/QH65B2/listTeams.action?clientId=XABBG36SBA} error: exportArchive Communication with Apple failed error: exportArchive No signing certificate "iOS Distribution" found We get very similar errors when archiving as well. Are we doing something incorrect here? Is API key usage with xcodebuild not supported for Enterprise builds? Appreciate any help y'all can provide!
0
0
24
16h
BLE Advertising in Background
For our research study, it is essential that the app can advertise BLE packets even when the app is no longer in the foreground (for example, when it is in the app switcher / recents state). Is it supported to advertise BLE packets while the app is in the background or recents state? If so, what are the specific requirements or limitations we should be aware of (background modes, payload size, timing, etc.)? Are there any constraints that would prevent consistent BLE advertising for research use cases?
1
0
32
16h
String Catalog stops updating upon changing source code
If you add a new string in your app (for example String(localized: "contact_support_message", defaultValue: "Please contact support")), then later you change that default value and rebuild, the string catalog updates to match as expected. But once that string is translated, changing the default value in code and rebuilding does not update the catalog. You seemingly have to go manually change the default value for English in the catalog to match the code (which marks the translation as Needs Review). Is there a better way? Or is there a way to determine what strings have default values in code that do not match the catalog values to see if any were missed as wording was tweaked over time?
3
0
128
18h
Xcode Cloud is unable to connect to the repository
Hello, I am trying out Xcode Cloud for the first time. I could connect to Github in the initial setup and had a few failed builds (package resolution error), which I resolved fairly quickly. Now whenever I am trying to build, I get the following error: Xcode Cloud is unable to connect to the repository “<respository-name>”. Reconnect the repository to resume builds. I am unable to remove the connection from settings as well because it's stuck in a loading state. Is there a way to fix this?
17
4
11k
21h
Scene-based Launch Detection
Our app supports UIScene. As a result, launchOptions in application(_:didFinishLaunchingWithOptions:) is always nil. However, the documentation mentions that UIApplication.LaunchOptionsKey.location should be present when the app is launched due to a location event. Given that our app is scene-based: How can we reliably determine whether the app was launched due to a location update, geofence, or significant location change? Is there a recommended pattern or API to detect this scenario in a Scene-based app lifecycle? This information is critical for us to correctly initialize location-related logic on launch. Relevant documentation: https://developer.apple.com/documentation/corelocation/cllocationmanager/startmonitoringsignificantlocationchanges()
0
0
25
21h
JSON Tutorial
HiSuppose i made a macOS App and want to connect to Oracle or mySQL Database I heard best way is using JSON which i dontknow anything about it, where can I find good reading about it thats specifically related to macOS or iOS Apps ?--Kindest Regards
3
0
433
21h
Help, I'm New and Lot
Hello, I created a code in Xcode on my Mac. Once it was debugged I tried to run it on a simulator. Every time I run it on a simulator I get the white screen with the spinning red box. I'm very new at this and I am creating this app for my own child. As a teacher I couldn't stand the other math fact apps. You'll have to talk to me like an infant.
1
0
70
1d
Is this normal while developing an app on the watch?
I used to develop iPhone apps about a decade ago and am now back at it with an iPhone and companion Apple Watch app. Why does it suck so bad? I a must be doing something wrong, but what I am doing is out of the box. The majority of the time when I go to build on the watch I get: Previous preparation error: A connection to this device could not be established.; Timed out while attempting to establish tunnel using negotiated network parameters. Which I then first try to force quit the app on the watch and if that does not work, reboot the watch (which is pretty ridiculous). I tried Gemini and it gave me the following explanation: This is arguably the single most frustrating error in the entire watchOS development ecosystem. As an expert, I can tell you that you are not doing anything wrong; you are fighting a fragile architecture. Here is the technical breakdown of why this happens and a workflow to mitigate it without constant reboots. The Technical "Why" This error message reveals that the issue lies in the CoreDevice (and formerly usbmuxd) infrastructure, specifically in the secure transport layer. The "Tunnel" Failure: Xcode attempts to establish a secure, encrypted tunnel (DTXConnection) to the Apple Watch to push the debugger and the app binary. Unlike the iPhone, which can sustain a high-bandwidth connection easily, the Watch aggressively manages its radios (Bluetooth vs. WiFi vs. AWDL) to save battery. The "Handshake" Timeout: If the Watch is on Bluetooth (Low Energy) when Xcode initiates the tunnel, the bandwidth is insufficient. The system tries to escalate the connection to WiFi (or Apple Wireless Direct Link). If this negotiation takes even a few milliseconds too long—due to 2.4GHz interference, router mDNS configuration, or the Watch CPU being throttled—the handshake times out. The "Previous Preparation Error": This is the insidious part. Once the handshake fails once, Xcode’s device service caches that failure state for the device UUID. It marks the device as "unreachable" to prevent the IDE from hanging indefinitely on subsequent tries. Why you see it constantly: You aren't actually triggering a new connection attempt; you are hitting the cached "failed" state immediately. Unfortunately, the solutions it gives me are: The "Wired Proxy" Method (Most Reliable) This is the gold standard for watchOS debugging. Do not rely on "Connect via Network" for the Watch directly if you can avoid it. Disable WiFi on your Mac (temporarily) or ensure the Mac and iPhone are on the exact same SSID. Plug your iPhone into the Mac via USB. Ensure the Watch is paired to that iPhone. Result: Xcode will tunnel the instructions through the USB connection to the Phone, and the Phone acts as a high-bandwidth proxy to the Watch. This eliminates the "Mac-to-Watch" WiFi negotiation failure point. Do you hit this regularly? What do you do to make for a smooth development and deployment process? Or is it really this fragile? Thanks for any help! Bryan
6
1
352
1d
Apple wants me to change the Bundle ID (Non XCODE)
Hello! I have a web extension I've written to Google Chrome and Mozilla Firefox. It's made up of simple files. The extension (content.js) A manifest (manifest.json) file which explains the extension The icon (icon.png) Apple has developed App Store Connect / Xcode Cloud specifically for this. I upload those three files as a zip. I move it over to TestFlight for testing and then select Distribution to put it through Apple Review. This is my entire process. I have been doing this for 4+ months and Apple reviewed my application and put it up. I have then gone through 13 subsequent reviews (ALL POSITIVE) and have gone through version upgrades for months, no issue. On the 15th review, they want me to change the name of my application. I have done that in the content.js, the manifest.json, and anywhere that allows me to change it in App Store Connect. There is apparently one more place they want it changed. This is on the App Information / General Information tab, specifically the "BundleID". The tip on that field says: The bundle ID must match the one you used in Xcode. It can't be changed after you upload your first build. Or, I am not understanding what their issue is or what else I can change. I was told by Review team I must use XCODE to change this. I tell them I don't use XCode (they demand now I use Xcode, which seems completely irrelevant here and a red herring The tooltip itself says I can't change it anyway? Has anyone been told after they released their application they have to change their name later on in life?
3
0
246
3d
TestFlight version of Mac Multiplatform is on the wrong AppStore, but not the iOS TestFlight build
Hello, I'm sure I've probably missed a checkbox somewhere.. I have a mulitiplatform app, when building from Xcode, and not using the testing config, both iOS and macOS show the correct App Store currency.. When I distribute a build through TestFlight, my Mac version shows a different country/currency price (the US one). I can't find anywhere to change this. My Mac is signed into the same sandbox account as my iOS device. Can anyone help?
1
0
143
4d
Apple watch Xcode pairing & connection issues
I’m blocked debugging a watchOS app on a physical Apple Watch. The iPhone connects to Xcode normally (wired), but the Watch either fails to connect with a tunnel timeout or disappears entirely from Xcode after I unpaired it inside Devices & Simulators. Environment Mac: macOS 26.x (Apple Silicon Mac) Xcode: 26.2 iPhone: iOS 26.1 Apple Watch Ultra: watchOS 26.2 (build 23S303) Connection: iPhone connected to Mac via USB (trusted). Watch paired to iPhone and working normally in the Watch app. Issue A (when Watch is visible in Xcode) In Xcode → Window → Devices and Simulators, the Watch shows up but is not usable and fails to connect. Error: “Previous preparation error: A connection to this device could not be established.” “Timed out while attempting to establish tunnel using negotiated network parameters.” In some attempts the Watch shows “Capacity: Unknown” / limited details, and then fails during preparation. Issue B (after unpairing Watch in Xcode only) I unpaired/removed the Watch in Xcode (Devices & Simulators). I did not unpair the Watch from the iPhone. Now: iPhone appears in Xcode and works normally for builds. Watch is still paired to the iPhone and works normally. Watch no longer appears anywhere in Xcode Devices & Simulators (no paired watch section, no watch run destination). What I’ve tried Reboots of Mac, iPhone, Watch (multiple times) Watch unlocked, awake; iPhone unlocked and close to Watch Verified Watch is paired and connected in iPhone Watch app Developer Mode enabled on iPhone and Watch Wi-Fi and Bluetooth ON (Mac/iPhone/Watch), tried toggling both Tried on home Wi-Fi and also with iPhone hotspot (same result) Resetting trust prompts / reconnecting iPhone via USB, re-trusting Mac Apple Watch: “Clear Trusted Computers” Xcode: removing/re-adding devices; clearing derived data; restarting Xcode Watch Developer networking test: Responsiveness = Medium (430 RPM) Questions 1. Is this a known issue/regression with Xcode 26.2 + watchOS 26.2 tunneling (CoreDevice / devicectl)? 2. Is there an Apple-supported way to force Xcode to re-discover a paired Watch after it was removed from Xcode Devices & Simulators (without unpairing the Watch from the iPhone)? 3. Any recommended logs or diagnostic steps I should collect (Console logs, sysdiagnose, specific Xcode/CoreDevice logs) to include in a Feedback report? If helpful, I can provide the full error text from Xcode’s Devices window and any logs you recommend. Thank you in advance,
6
3
435
4d
Unable to Verify Code Signature with Error 0xe8008018 Despite Troubleshooting Attempts
Hello everyone, I am encountering a persistent issue with Xcode where I’m unable to install my app on a testing device due to the following error message: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.SznYNY/extracted/iForC.app : 0xe8008018 (The identity used to sign the executable is no longer valid.) Here’s what I have tried so far to resolve this issue: 1. Ensured that all my certificates and provisioning profiles are current and valid. 2. Removed all related certificates from my Keychain and reinstalled new ones. 3. Cleaned and rebuilt the project multiple times. 4. Unpaired the device and paired it again. 5. Reinstalled the latest version of Xcode. 6. Performed a complete restore of my Mac. Despite these troubleshooting steps, I am still facing the same issue. I would greatly appreciate any insights or experiences related to this error from anyone who has overcome similar challenges. Thank you in advance for your help!
13
3
7.7k
5d
Xcode Metal Trace
Code is download from apple official metal4 sample [https://developer.apple.com/documentation/metal/drawing-a-triangle-with-metal-4?language=objc] enable metal gpu trace in macOS schema and trace a frame in Xcode. Xcode may show segment fault on App from some 'GTTrace' function when click trace button. When replay a .gputrace file, Xcode may crash , throw an internal error or a XPC error. The example code using old metal-renderer can trace without any problem and everything works fine. Test Environment: Xcode Version 26.2 (17C52) macOS 26.2 (25C56) M1 Pro 16GB A2442
2
0
407
6d
Errors with PerfPowerTelemetryClientRegistrationService and PPSClientDonation when running iOS application in Xcode
I've suddenly started seeing hundreds of the same block of four error messages (see attached image) when running my app on my iOS device through Xcode. I've tried Cleaning the Build folder, but I keep seeing these messages in the console but can't find anything about them. Phone is running iOS 26.1. Xcode is at 16.4. Mac is on Sequoia 15.5. The app is primarily a MapKit SwiftUI based application. Messages below: Connection error: Error Domain=NSCocoaErrorDomain Code=4099 "The connection to service named com.apple.PerfPowerTelemetryClientRegistrationService was invalidated: Connection init failed at lookup with error 159 - Sandbox restriction." UserInfo={NSDebugDescription=The connection to service named com.apple.PerfPowerTelemetryClientRegistrationService was invalidated: Connection init failed at lookup with error 159 - Sandbox restriction.} (+[PPSClientDonation isRegisteredSubsystem:category:]) Permission denied: Maps / SpringfieldUsage (+[PPSClientDonation sendEventWithIdentifier:payload:]) Invalid inputs: payload={ isSPR = 0; } CAMetalLayer ignoring invalid setDrawableSize width=0.000000 height=0.000000 I'm also seeing the following error messages: CoreUI: CUIThemeStore: No theme registered with id=0
6
3
280
6d