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
MainMenu issue if I start a new Xcode Objective-C Cocoa Mac Storyboard/XIB application.
I'm reading a bit outdated book about Cocoa/Objective-C applications development and I'm trying to code some examples. And so I ended up with an almost empty NSDocument-based app with runtime errors like that: Internal inconsistency in menus - menu <NSMenu: 0xbc726d040> Title: Window Supermenu: 0xbc726d080 (Main Menu), autoenable: YES Previous menu: 0x0 (None) Next menu: 0x0 (None) Items: ( "<NSMenuItem: 0xbc6fcd9a0 Minimize, ke='Command-M'>", "<NSMenuItem: 0xbc6fcda40 Zoom, ke mask=''>", "<NSMenuItem: 0xbc6fcdae0, separator, ke mask=''>", "<NSMenuItem: 0xbc6fcd900 Bring All to Front, ke mask=''>" ) believes it has <NSMenu: 0xbc726d080> Title: Main Menu Supermenu: 0x0 (None), autoenable: YES Previous menu: 0x0 (None) Next menu: 0x0 (None) Items: ( ) as a supermenu, but the supermenu does not seem to have any item with that submenu It looks like as if the menu tries to include itself as a submenu. Am I right? I have no ideas what led to this. If I'm not mistaken this has started since macOS Tahoe. The code that is not a boilerplate one I have: // Document.m #import "Document.h" @implementation Document @synthesize text; - (NSString *)windowNibName { return @"SampleDocument"; } - (void)windowControllerDidLoadNib:(NSWindowController *)aController { [super windowControllerDidLoadNib:aController]; if (self.text == nil) { self.text = @""; } self.textField.stringValue = self.text; } - (NSData *)dataOfType:(NSString *)typeName error:(NSError **)outError { self.text = self.textField.stringValue; return [self.text dataUsingEncoding:NSUTF8StringEncoding]; } - (BOOL)readFromData:(NSData *)data ofType:(NSString *)typeName error:(NSError **)outError { if ([data length] > 0) { NSString * string = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; self.text = string; } else { self.text = @""; } return YES; } + (BOOL)autosavesInPlace { return YES; } @end There are two xib's: MainMenu.xib and Document.xib but I won't include them here. Please advise how to fix this menu issue.
0
0
25
7h
NSLocationTemporaryUsageDescriptionDictionary crashes Xcode 13
I just submitted a feedback for this (FB9662125) but in the spirit of “share and enjoy”… The cool new Generate Info.plist File feature in Xcode 13 crashes if you try to put an NSLocationTemporaryUsageDescriptionDictionary in your Info.plist file. Here’s a simple repro scenario: Create a minimal iOS app (no Core Data, no tests) Go to target settings → Info tab → Custom iOS Target Properties Click the (+) button on any row to begin inserting a new row Select Privacy - Location Temporary Usage Description Dictionary Click somewhere else or press Return to commit the selection Xcode crashes immediately More generally, it seems that Xcode crashes any time it tries to regenerate your Info.plist file if it contains an NSLocationTemporaryUsageDescriptionDictionary, even if (for example) you manually pasted that dictionary into the file earlier. In that case, merely tapping the (+) button in step 3 above is enough to crash it.
18
7
4.8k
9h
Unable to find identity (but have private key and certificate)
I'm unable to sign the an example application using xcode and "automatically manage signing". The error I'm getting is: CodeSign [...] (in target 'foobar' from project 'foobar') Signing Identity: "Apple Development: [xxxx] " /usr/bin/codesign --force --sign 4ABB258102FF656E9F597546A49274C28D2B8B3E -o runtime --timestamp\=none --generate-entitlement-der [filename] 4ABB258102FF656E9F597546A49274C28D2B8B3E: no identity found Command CodeSign failed with a nonzero exit code However, I am able to see a certificate and a private identity on my keychain: % security find-certificate -aZ | grep -i 4ABB258102FF656E9F597546A49274C28D2B8B3E SHA-1 hash: 4ABB258102FF656E9F597546A49274C28D2B8B3E and % security find-key -s | grep -q 'Apple Development' && echo YES YES what is puzzling is that security does not find an identity: % security find-identity -p codesigning Policy: Code Signing Matching identities 0 identities found Valid identities only 0 valid identities found but XCode claims that everything is working fine. Anybody knows what might I be missing? I tried logging out, requesting new certificates, rebooting, moving them to another keychain, and asking to developer friends.
3
0
198
1d
Need Step-by-Step Instructions for Submitting React Native/Expo App to TestFlight & App Store (Individual Account)
Hello - I’m the Account Holder for an individual Apple Developer Program account. I’m working with freelance junior developers who are building my app in React Native mainly in TypeScript (.tsx) with some JavaScript, with code in GitHub. The app currently runs in Expo Go now. I’ve been directed to this forum for step-by-step guidance. Specifically I need clear, sequential instructions I can give my developers (and what I personally must do on my Mac) so they can produce a properly signed iOS build for TestFlight (internal testing), and Upload that build to App Store Connect and then submit the release to the App Store. Context: This is an individual developer account (not an organization). I am the only person with a Mac. I added them as developers but was told I need to be the one to upload the final build (is this true, and if so, what do they send me to do that, and when they send it to me, can you please tell me exactly what I need to do from there?) I was told about Swift Playground, possible SwiftUI conversion if needed, APK file, and using my Xcode for final submission, but not sure what to make of this that will get it on TestFlight from the current React Native. What I would like to ask for help with is a concise, step-by-step checklist (including exact menu names / commands or tools like EAS Submit, Transporter, or Xcode) of the developers' steps and my admin/account holder steps, so I can hand it to the developers and make sure nothing is missed to get on TestFlight. I’m on a tight timeline, so any clear, detailed guidance would be extremely appreciated. Thank you so much. I have looked everywhere and cannot find a step-by-step!
1
0
20
1d
Icon Composer: Any way to add icons to the app bundle for older macOS versions?
Several app developers are struggling with the inability to provide a separate app icons that looks nice on older macOS versions while at the same time provide Icon Composer icons that look great on macOS Tahoe 26. An ability to provide separate icons is super important to those who have app icons that follow the curvature of the default icon borders (as the corner rounding radius is different for Sequia and Tahoe). Take a look at this for example: https://github.com/ghostty-org/ghostty/issues/7564#issuecomment-3042061547 Question: Is there a definitive/recommended way to address this issue? How can a developer add a glass icon variant that looks good on Tahoe and provide a bitmap icon for older macOS versions? Some background info: Prior to Xcode 26 beta 4, one could add an App Icon to Assets to be used as app icon for legacy macOS versions (Sequia and older) and use a new Icon Composer icon (placed in the project root) for macOS Tahoe 26. Enabling "Include all app icon assets" under target settings ensured that older macOS versions would use the old app icons while Tahoe the new Icon Composer glass one. Since Xcode beta 4 this technique no longer works. Xcode instead insists on populating Assets.car with Icon Composer generated variants, disregarding the App Icon provided in Assets. Although the App Icon in Assets makes its way to a .incs file in the app bundle's Contents/Resources folder, but that is not used by macOS anymore and is there for some compatibility purposes. The Assets.car file (which matters) only contains the variants generated by Icon Composer and does not contain the png icons provided in the Assets.
12
12
1k
2d
Unable to View Crash Logs in Xcode Organizer
Hi everyone, I’m currently unable to view crash logs in Xcode Organizer for any of the apps in my account. When I try to access crash reports, I receive the following error: "An error occurred preventing Xcode from downloading version information from App Store Connect. An unexpected error occurred: [<__NSDictionaryM> valueForUndefinedKey:]: this class is not key value coding-compliant for the key [App Name] [Version] (iOS App)." The error message references an app name and version that were previously used. Notably, the original app name included an @ symbol (e.g., @ExampleApp). We suspected this might be contributing to the issue, so we updated the app name to remove the symbol. However, the error persists and still references the old name. Has anyone experienced something similar or found a workaround? Any guidance would be greatly appreciated! Thanks in advance.
1
0
81
3d
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
2
1
57
3d
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
5
1
343
3d
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
2
0
56
3d
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'.
3
1
148
3d
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
896
3d
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://developer.apple.com/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
86
4d
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
23
4d
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
233
4d
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
4d
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
968
4d
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
227
4d