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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Xcodebuild does not find any simulators
I am trying to integrate fastlane, which relies on xcodebuild. So this is my first experience with xcodebuild. Whenever I run a command to test or build the target in the folder where all the files of the project are stored, the action failes with Unable to find a device matching the provided destination specifier For example I might be running this command: xcodebuild \ -project Hoerspielzentrale.xcodeproj \ -scheme HoerspielzentraleUITests \ -destination 'platform=iOS Simulator,name="Screenshot Simulator”' \ test However the mentioned error is returned: xcodebuild: error: Unable to find a device matching the provided destination specifier: { platform:iOS Simulator, OS:latest, name:"Screenshot Simulator” } The requested device could not be found because no available devices matched the request. I can confirm that the simulator exists, is available and it can be booted. I have tried different simulators, different schemas, referencing them by their identifier, switching Xcode Versions, reset all simulators, derived data and build folder. After the error a complete list of all available destinations can be found, where I can see the simulator I try to use. Available destinations for the "HoerspielzentraleUITests" scheme: { platform:iOS, id:dvtdevice-DVTiPhonePlaceholder-iphoneos:placeholder, name:Any iOS Device } { platform:iOS Simulator, id:dvtdevice-DVTiOSDeviceSimulatorPlaceholder-iphonesimulator:placeholder, name:Any iOS Simulator Device } { platform:iOS Simulator, id:961DC569-9931-419A-B46E-769AAFA73EA2, OS:18.5, name:Screenshot Simulator } { platform:iOS Simulator, id:961DC569-9931-419A-B46E-769AAFA73EA2, OS:18.5, name:Screenshot Simulator } { platform:iOS Simulator, id:5E51FD98-C451-472F-9CDE-08D49E6B737B, OS:18.5, name:Screenshot Simulator Pro } { platform:iOS Simulator, id:5E51FD98-C451-472F-9CDE-08D49E6B737B, OS:18.5, name:Screenshot Simulator Pro } The rest of the list was omitted. I am currently completely stuck. Thank you
1
0
80
3w
Bug in Xcode AI coding assistant
I've been experimenting with using local LLMs in place of ChatGPT in coding assistant. I was able to do this using LM Studio. I found that switching LLMs was a little clunky, but eventually, I was able to make it work. However, none of the LLMs I tried were able to generate error free Swift code. Not surprising at this stage. I decided to train an LLM (Llama3.1-8b) with Apple's Swift Programming language reference, using Open WebUI, and this worked. I was able to get the LLM to generate working Swift Code that I was able to test in Playgrounds. The problem I'm having now is that Xcode is locked up on the last LLM I tried out. I've tried deleting all the LLM providers in Settings, leaving only ChatGPT, but Xcode still defaults to the local LLM, even though it throws errors if you try to ask it a question. I've tried reinstalling Xcode, downloading new versions of sample Xcode projects, and deleting various data files, all to no avail. I would really like to test the new LLM I've trained in coding assistant, but right now, Xcode won't let me. It won't even let me revert to ChatGPT.
2
0
75
3w
UI Automation not waiting on WatchOS?
On my MacBook Pro M4 with macOS 15.5 and Xcode 16.4, I have a simple SwiftUI-based WatchOS application consisting of a NavigationSplitView that displays a short List of items, and a detail view consisting of a TabView {...}.tabViewStyle(.verticalPage) that displays a fixed number of "pages" of detailed information about the selected list item. When I use XCTest UI Automation with XCUIApplication(), I am finding that I need to add a sleep(1) after every interaction, such as a .tap() or .swipeUp() before I can attempt any assertion such as XCTAssertGreaterThan(app.cells.count, 3) to ensure that the top level List of items is more than 3. All the added sleep(1) statements are making the tests very slow... It appears that the WatchOS implementation of UI Automation lacks the ability to wait until the UI event queue is idle. Am I the only one seeing this?
0
0
62
3w
Device "..." isnt' registered in your developer account
Hi, I'm using Xcode 15.4. (always export as "Ad Hoc" with automatic signing) and just ran into a weird problem when I tried to run my app with the "play" button on a new iOS 18 iPhone: The build fails every time with the following error message in the "Signing & Capabilities" tab: Device "..." isnt' registered in your developer account. I added the iPhone's UDID to my developer account yesterday but I'm still getting the same error today. There's a "Register Device" button below the error message and when I click it, there are two new errors: There is a problem with the request entity: A device with number '...' already exists on this team. Provisioning profile "iOS Team Provisioning Profile: ...." doesn't include the currently selected device "...." (Identifier ...) The "try again" button below the first part doesn't do anything. How do I fix this?
1
0
74
3w
Privacy features in Coding Intelligence
What is the policy for data sharing when using Coding Intelligence in Xcode 26? In many environments, sending out source code or even meta data that may be stored in external systems is not allowed. Is there any kind of policy on data persistency / sharing when using the default provider? Is there a way to limit data sharing apart from running models locally?
0
0
51
3w
GIT incorrectly monitoring changes to system files
I have a small playground approx 150 lines no SwiftUI It also has a 70 line text file Xcode now thinks I have over 4000 files that have changed and they are Xcode or system files If I am looking at this list then the Mac Mini will freeze with a frozen mouse, just a stuck mouse pointer. After a minute or so the Mac will reboot itself. Any suggestions as to how to fix this would be appreciated. I have already reinstalled Xcode and the tools and its still the same.
1
0
59
3w
The async/await API crashes in Xcode 16.3 and later
We use several UIKit and AVFoundation APIs in our project, including: setAlternateIconName(_:completionHandler:) getAllTasks(completionHandler:) loadMediaSelectionGroup(for:completionHandler:) Moreover, we use the Swift Concurrency versions for these APIs: @MainActor func setAlternateIconName(_ alternateIconName: String?) async throws var allTasks: [URLSessionTask] { get async } func loadMediaSelectionGroup(for mediaCharacteristic: AVMediaCharacteristic) async throws -> AVMediaSelectionGroup? Everything worked well with these APIs in Xcode 16.2 and earlier, but starting from Xcode 16.3 (and in 16.4), they cause crashes. We've rewritten the APIs to use completion blocks instead of async/await, and this approach works. Stack traces: setAlternateIconName(_:completionHandler:) var allTasks: [URLSessionTask] { get async } loadMediaSelectionGroup(for:completionHandler:) Also, I attached some screenshots from Xcode 16.4.
6
0
227
3w
How to Download IOS 26 beta runtime simulator using "xcodebuild" tool?
How to download the runtime simulators for the most recent Xcode 26 beta? The current download command I’m using doesn’t seem to work, and I’m encountering the following issues: The runtime simulator download command (xcodebuild) requires the version number to be specified explicitly. I’ve tried multiple variations of version names/numbers but haven’t been able to identify the correct naming convention used by Apple for the Xcode 26 beta simulator runtimes. $ xcodebuild -downloadPlatform IOS -exportPath ~/Downloads -buildVersion 26 Finding content...iOS 26 is not available for download. $ xcodebuild -downloadPlatform iOS -exportPath ~/Downloads -buildVersion 26.0 Finding content...iOS 26.0 is not available for download. $ xcodebuild -downloadPlatform iOS -exportPath ~/Downloads -buildVersion 26.0 beta Finding content...iOS 26.0 is not available for download. $ xcodebuild -downloadPlatform iOS -exportPath ~/Downloads -buildVersion "26.0 beta" Finding content...iOS 26.0 beta is not available for download. $ xcodebuild -downloadPlatform iOS -exportPath ~/Downloads -buildVersion "26.0_beta" Finding content...iOS 26.0_beta is not available for download. $ xcodebuild -downloadPlatform iOS -exportPath ~/Downloads -buildVersion 26.0_beta Finding content...iOS 26.0_beta is not available for download.
1
0
115
3w
What's the trick for copying a file to a simulator session?
Apple claims you can share files to the Xcode simulator. The first step works (share-to-simulator context menu exists). But when you execute this nothing happens. This contradicts the apple documentation which states: a Simulator opens the Files app, and lets you select where to save the files. If I instead try to drag and drop between the Mac and the simulator's file manger I receive the message: Simulator device failed to open file:///Users/me/Downloads/Exchange/ExampleExport.json. So what is the trick? Is there a missing authorisation that I need to set in the simulator's settings for example? MacOS: 15.5 Xcode: 16.4 (16F6) ... the latest stable Apple versions.
3
0
63
3w
XCframeworks with arm64e slices on Xcode 26
I have a XCFramework which contains slices for both arm64 and arm64e binaries, but some of my apps are only built for arm64. Prior to Xcode 26, this was not an issue, despite the binary in Frameworks folder still containing the arm64e slice. But now with Xcode 26 I get several errors when uploading to the Appstore: Validation failed Inconsistent arm64e support. The main bundle 'HackerNews.app' does not support arm64e. Verify that the all of the targets including [HackerNews.app/Frameworks/Sentry.framework] have consistent support for arm64e. (ID: 542eb011-2689-47fe-a5d5-d043342820a8) Validation failed Invalid architecture. The iOS 17.4 SDK or later is required for an arm64e slice. The bundle executable in “HackerNews.app/Frameworks/Sentry.framework” contains an arm64e slice with the iOS 17.2 SDK. (ID: 60f2cb75-e4be-4583-bebd-36d119275419) Is this intended behavior with Xcode 26?
0
0
51
3w
Xcode 26 Beta-2 - missing context actions
If I control-click (or right-click) on a view, there is no longer an option to extract to subview. I also looked under the refactor option that comes up and it's not there either. Was this intentional? If so, is there an easy method to extract to a subview like in earlier versions of Xcode? Also, if I control click on a view and the context menu comes up, there used to be different embed options (ZStack, HStack, etc) now there's only embed. Not a big issue because you can just change Container to whatever.
1
1
44
3w
Xcode Memory Usage
Last week I bought an M4 Pro Mac mini with 24GB RAM to use as my “beta testing” machine. I don’t want to use my main machine for beta OS testing, so figured this config would be perfect for that. However, there have been several times when running Xcode 26 on macOS Tahoe, along with a simulator or two, that memory pressure has gone up into the “yellow” and keeps increasing. I am surprised that 24GB doesn‘t seem like enough RAM. I don’t have giant projects or use anything else on this machine. It’s pretty simple stuff. Maybe this is to be expected with betas: memory leaks, non-optimized code, etc. I’m considering returning the machine while I can. What do others find is a good amount of RAM for fairly modest development needs?
1
0
55
3w
UIScene Storyboard - Main and Main_iphone
Under threat of future crashes, I'm adding support of UIScene to my existing apps. Each app has two storyboards - Main for iPads and Main_iphone for iPhones. Pre-UIScene, all looks great. With the addition of the Application Scene Manifest, the iPhone versions of the app are using the Main storyboard instead of the Main_iphone storyboard. Do I need to add an item to the plist for this other storyboard? At what level in the plist is this added? Another Scene Configuration? Another Window Application Session Role? Another Storyboard Name?
2
0
61
3w
XCode 26 beta 2 build error with AVAsset loading
I have this build error with Xcode 26 beta 2: var asset:AVURLAsset? func loadAsset() { let assetURL = URL.documentsDirectory .appendingPathComponent("sample.mov") asset = AVURLAsset(url: assetURL, options: [AVURLAssetPreferPreciseDurationAndTimingKey: true]) /*Error: Type of expression is ambiguous without a type annotation */ if let result = try? await asset?.load(.tracks, .isPlayable, .isComposable) { } } Is there an issue with try? in the new Swift compiler? Error: Type of expression is ambiguous without a type annotation
0
0
68
3w
Download fails on XCODE AI
Like so many, i am getting The operation couldn’t be completed. (ModelCatalog.CatalogErrors.AssetErrors error 1.) Domain: ModelCatalog.CatalogErrors.AssetErrors Code: 1 User Info: { DVTErrorCreationDateKey = "2025-06-25 12:50:18 +0000"; } Failed to find asset: com.apple.fm.code.generate_small_v1.tokenizer.generic - no asset Domain: ModelCatalog.CatalogErrors.AssetErrors Code: 1 System Information macOS Version 16.0 (Build 25A5295e) Xcode 16.4 (23792) (Build 16F6) Timestamp: 2025-06-25T08:50:18-04:00 error when trying to download the AI extension in XCODE running Tahoe Beta 2; latest Xcode version
5
0
55
3w