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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Does Xcode force to download latest iOS simulator after update?
I have Xcode on my mac. I am iOS Dev. I do not know what version of Xcode was before I did next steps, but I could say that I had iOS Simulator 18.3.1. So I update my Xcode to Version 16.3 (16E140). At this version is available iOS Simulator 18.4. But from some time before Xcode separate downloading components and actual Xcode itself. So i make update and do not download latest iOS simulator. What i have: in Xcode -> Settings -> Components under " Other Installed Platforms" i have iOS 18.3.1 and 17.5 in Choose Destination dropdown menu i have nothing. And Xcode say me that i need install iOS Simulator. After some time with ChatGPT I could not do nothing from this. I try go to : Window -> Device and Simulators and here create new simulator with 18.3.1 and make it appear Always. But it didn't help. Solution I did: I download latest version 18.4 because i could not wait because i need fix bug only 1 hour shift and it was this hour so i fast download the simulator. After downloading 18.4 in Choose Destination dropdown it appears all versions of simulaors and 18.3.1 and that i created and 17.5 Question: Does Xcode force to install latest version of iOS simulator? What is the sense of this upgrade that now Xcode is updating faster because it download 8 GB not 16 if eventually I need download 8 GB again ? The new what i could do download Xcode in the evening and Simulator in the morning?
0
0
136
Apr ’25
Xcode 16.2 archive fails to compile XIB
Xcode 16.2 archive fails to compile XIB Xcode Archive command fails most of the time while compiling an XIB which was created in older Xcode. XIB was updated in Xcode 16.2 version also which did not fix this issue. Archive from Xcode app works but Xcode build command fails and no reason shown by the command. ** ARCHIVE FAILED ** The following build commands failed: CompileXIB /Users…/Resources/Nibs/<XIB_NAME>.xib
0
0
87
Apr ’25
Configure Format to Multiple Lines?
Is there any way to modify the behaviour of this command? I really dislike that it adds a break after the opening parenthesis and would also prefer it to use the traditional multi-line style where the lines are aligned with their semicolons. Alternatively, is there a way to run the "Format File with 'swift-format'" command without implicitly triggering "Format to Multiple Lines", as it apparently does? Having to reformat my method's signatures afterwards really makes this feature unattractive to me at the moment.
0
0
146
Jan ’25
Xcode - Command "Find Selected Symbol in Workspace" gives no result
Example: I have a state var curHighScore declared in ContentView. I select it, right click and select "Find Selected Symbol in Workspace" The result is : 1 resul in 1 file, i.e. the line of declaration of the var But obviously, the same var is used at line #102: How come this occurence is not found by the search command. Such happens every now and then. Is there something I am missing ? What is causing this ? Thanks for your help.
0
1
231
Feb ’25
new rsync version not working as expected
after upgrade macos version to 15.4 the rsync start failing that cause the xcodebuild fail and not generate ipa rsync: on remote machine: --extended-attributes: unknown option rsync error: syntax or usage error (code 1) at main.c(1802) [server=3.4.1] rsync(73444): error: unexpected end of file rsync(73444): error: io_read_nonblocking rsync(73444): error: io_read_buf rsync(73444): error: io_read_int rsync(73444): warning: child 73445 exited with status 1
0
0
213
Apr ’25
Assistance Required for Accessing Non-Secure HTTP API in Ionic Build App
Dear Team, I was previously able to access a non-secure HTTP API in my Ionic-built app. However, I am now encountering an error where the API requests are being rejected. Interestingly, this API works perfectly on Android and web platforms without any issues. As part of my troubleshooting, I have already added the following lines to my Info.plist file: <key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict> Could you kindly suggest any alternative solutions or additional settings required to access this HTTP API? Your help would be greatly appreciated. Thank you, Mozib
0
0
169
Jan ’25
XCODE Account not found
I have one of our developer when he attempts to login to xcode on his macos device, he get a message that account is not found but he has an account and he logs in to app developer portal with no issue. Thanks
0
0
45
Apr ’25
Invalid binary for tvOS app which integrates an xcframework
We're building an SDK (let's call it MyFramework) which is distributed as an .xcframework for developers to integrate it into their own apps. Recently, we've added tvOS support by adding it as a supported destination for the SDK. Essentially, the SDK became a cross-platform framework and easy to be adopted in both iOS and tvOS apps. The .xcframework is generated fine, all builds correctly. We've tested the SDK integrated in test apps. We've also submitted an iOS archive app to the AppStore connect, just to make sure all is well with the AppStore submission. However, when I tried submitting a tvOS archive app (that integrates the same SDK) to the AppStore connect, the build was marked as invalid binary and we've got the following error message: ITMS-90562: Invalid Bundle - One of the nested bundles is built for a platform which is different from the main bundle platform. Please make sure that all bundles have correct platform specification. First, I thought that any of the modules of the framework was not correctly configured for tvOS but that was not the case. Everything compiles ok and it runs in debug as expected. It only fails when trying to submit the tvOS app that integrates the SDK. After a lot of investigating, we realised that the reason for the AppStore submission error is because we codesign the framework. We use codesign to distribute it as cryptographically signed xcframework. codesign --timestamp -v --sign "Apple Distribution: Company (xxxxxxxxxx)" "MyFramework.xcframework" As soon as we remove the above line from our CI/CD pipeline that generates the xcframework, and submit a tvOS archive app that integrates the unsigned framework, the AppStore submission error goes away and the TestFlight build can be tested. I've also tried to just strip the _CodeSignature folder from the .xcframework package but it still fails. So the only solution currently is to not codesign the xcframework to be able to upload tvOS archive apps that integrate the SDK to the AppStore connect. However, we're still puzzled as to why only the tvOS archive app gets the invalid binary error when it integrates a signed SDK. I feel like the error message is quite misleading if we have to stop signing the SDK xcframework for it to be accepted during the AppStore submission. Anyone has any idea? Or has anyone encountered a similar issue? Thanks!
0
0
167
Mar ’25
Integrating binary inside Framework via SPM
So I will summary an issue one of our clients has asked us on GitHub: https://github.com/pendo-io/pendo-mobile-sdk/issues/233 Project that is a custom framework that uses different SPM packages (one of them is Binary package), we have our main logic inside that framework and we have different targets that use this framework, everything works on the simulator, but running the app on the actual device provokes a crash saying "Binary framework was not found". We have like 20 other SPM packages that work fine, this is the first one we have an issue with. Please note I understand that SPM will not copy paste the Binary for the magic framework as it does for the apps so I suggested to embed it manually. So my question is what the best(easy) way to do it. Please refer to the following issue for more details: https://github.com/pendo-io/pendo-mobile-sdk/issues/233
0
0
80
Mar ’25
Preview broken
Hello, I am doing the SwiftUI tutorial with Xcode 16.2 For the watch app the simulator working fine but the preview keep saying “This app cannot run on the selected target device.” while the preview is working …… For the macOS part the simulator working fine but the preview is totally broken with -> ”ContentView.swift” not found in any targets. While it is correctly added to the target … Please fix or make tutorial clear.
0
0
154
Feb ’25
Build Libraries For Distribution flag usage
I want to build an ios .xcframework (for external delivery) and .framework(for internal debugging) in order to package some code to a customer for incorporation into their app. My framework has a dependency upon RealmSwift, which I've added using SPM. There is a warning saying Module RealmSwift was not compiled with library evolution support. And when building SwiftVerifyEmittedModuleInterface fails with an error saying "missing required modules: 'Realm.Private', 'Realm', 'Realm.Swift'" By default, Build Libraries For Distribution was set to YES, however if I turn it off then the warning and error go away and I can cleanly build the framework. I've been attempting to get a good understanding of this flag and if it should be used or not, most material says yes but doesn't go a good job of explaining why. However anyway I can't get the framework to build with RealmSwift as a dependency without turning off this flag. Therefore is that ok to proceed down that route? Does the fact the xcframework will only ever be distributed to one consumer affect decisions (i.e. binary compatibility etc.) Thanks
0
0
120
Mar ’25
The behavior of the app using the Promises library changes between Xcode 15.4 and Xcode 16.2.
I’m creating code that performs asynchronous processing using the Promises library (https://github.com/google/promises). In this context, when building the app in Xcode 15.4 and Xcode 16.2, the behavior differs between the two. I’m using version 2.1.1 of the library. Also, I’ve tried using the latest version, 2.4.0, but the result was the same. Has anyone encountered the same issue or know an effective solution? Here's a simple code that reproduces this issue. @IBAction func tapButton(_: UIButton) { _ = getInfo() } func getInfo() -> Promise<Void> { Promise(on: .global(qos: .background)) { fulfill, _ in self.callApi() .then { apiResult -> Promise<ApiResult> in print("\(#function), first apiResult: \(apiResult)") return self.callApi() // #1 } .then { apiResult in print("\(#function), second apiResult: \(apiResult)") // #2 fulfill(()) } } } func callApi() -> Promise<ApiResult> { Promise(on: .global(qos: .background)) { fulfill, _ in print("\(#function), start") self.wait(3) .then { _ in let apiResult = ApiResult(message: "success") print("\(#function), end") fulfill(apiResult) } } } struct ApiResult: Codable { var message: String enum CodingKeys: String, CodingKey { case message } } The Swift Language version in the build settings is 5.0. The console output when running the above code is as follows: When built with Xcode 15.4: 2025/03/21 10:10:46.248 callApi(), start 2025/03/21 10:10:46.248 wait 3.0 sec 2025/03/21 10:10:49.515 callApi(), end 2025/03/21 10:10:49.535 getDeviceInfo(), first apiResult: ApiResult(message: "success") 2025/03/21 10:10:49.535 callApi(), start 2025/03/21 10:10:49.536 wait 3.0 sec 2025/03/21 10:10:52.831 callApi(), end 2025/03/21 10:10:52.832 getDeviceInfo(), second apiResult: ApiResult(message: "success") The process proceeds from #1 to #2 after completing the code comment in #1. When built with Xcode 16.2: 2025/03/21 09:45:33.399 callApi(), start 2025/03/21 09:45:33.400 wait 3.0 sec 2025/03/21 09:45:36.648 callApi(), end 2025/03/21 09:45:36.666 getDeviceInfo(), first apiResult: ApiResult(message: "success") 2025/03/21 09:45:36.666 callApi(), start 2025/03/21 09:45:36.666 wait 3.0 sec 2025/03/21 09:45:36.677 getDeviceInfo(), second apiResult: Pending: ApiResult 2025/03/21 09:45:39.933 callApi(), end The process does not wait for the code comment in #1 to finish and outputs the #2 print statement first. Additionally, even with Xcode 16.2, when changing the #2 line to "print("(#function), second apiResult: (apiResult.message)")", the output becomes as follows. From this, it seems that referencing the ApiResult type, which is not a String, might have some effect on the behavior. 2025/03/21 10:05:42.129 callApi(), start 2025/03/21 10:05:42.131 wait 3.0 sec 2025/03/21 10:05:45.419 callApi(), end 2025/03/21 10:05:45.437 getDeviceInfo(), first apiResult: ApiResult(message: "success") 2025/03/21 10:05:45.437 callApi(), start 2025/03/21 10:05:45.437 wait 3.0 sec 2025/03/21 10:05:48.706 callApi(), end 2025/03/21 10:05:48.707 getDeviceInfo(), second apiResult: success Thank you in advance
0
0
155
Mar ’25
Xcode 16 Automatically Builds & Runs Simulator While Editing Storyboard
I’m experiencing an issue in Xcode 16 where the app randomly builds and runs in the simulator while I’m designing items in the storyboard. Here’s what I’ve tried so far to stop this behavior: Disabled "Show Live Issues" in the General settings Removed all key bindings related to Build & Run in the Key Bindings settings Checked for unintentional shortcut triggers, but nothing seems to be causing it Update XCode from 16.1 to 16.2 Delete Derived Data Despite these actions, Xcode still automatically builds and launches the simulator at unexpected times, disrupting my workflow. Is there any setting or hidden configuration that could be causing this? How can I completely prevent Xcode from running the simulator automatically while editing UI in the storyboard? Would really appreciate any guidance on this!
0
0
99
Mar ’25
XLSXWriter Help
Hello, I am brand new to development in Xcode. I have created a Mac app that I need to use XLSXWriter to export a workbook and sheet. Is GitHub the only place for this download or is there an apple developer specific area to get the library? Thanks
0
0
132
Jan ’25
Need Help Updating a Custom WireGuard SPM for Xcode 16 & Swift 6
Hey iOS Dev's, I’m currently working on a Swift Package Manager (SPM) for WireGuard, originally developed by a previous team member. It was working fine in Xcode 15.2, but after upgrading to Xcode 16 and Swift 6, I need to update the SPM to ensure compatibility with my base projects and other projects relying on it. With Apple making Xcode 16 mandatory for app submissions starting April 24, this has become an urgent issue. I’ve searched extensively but haven’t found a working solution yet. Has anyone faced similar challenges with Swift 6 migration and SPM updates? Any insights, best practices, or debugging tips would be greatly appreciated! Let’s connect and collaborate—I’d love to discuss possible solutions! 😊 #iOSDevelopment #Swift6 #Xcode16 #SPM #WireGuard #iOS #Swift #SoftwareEngineering #AppStore
0
0
92
Apr ’25
XCode 16 run Fastlane fail when called get_version_number function after convert project from groups to folders
My project is using Fastlane 2.226.0. After converted groups to folders on XCode 16, I got an error when executed below function in Fastfile: get_version_number(xcodeproj: "MyProject.xcodeproj", target: "MyProject") Below is the error message output after I ran fastlane: Unable to find XCode build setting: MARKETING_VERSION
0
0
101
Mar ’25
Xcode crash reports from TestFlight
My application is in flightTest mode. I received my first two crash reports in XCODE /Organizer. The context is well described, and I was able to isolate the locations where very serious errors occurred. My application is connected. I'm missing one piece of data in this crash report: the time of the crash. This will help me see what (in my case) static data was being read on the data server at that time. This will help me investigate. Is it possible to obtain this information?
0
0
80
Mar ’25
MapKit not working in Swift Playgrounds
This is the complete Playground code: import MapKit import SwiftUI import PlaygroundSupport struct AddressSearchView: View { @State private var region = MKCoordinateRegion( center: CLLocationCoordinate2D(latitude: 37.7749, longitude: -122.4194), span: MKCoordinateSpan(latitudeDelta: 0.01, longitudeDelta: 0.01) ) var body: some View { VStack { Map(position: .constant(MapCameraPosition.region(region))) { } .frame(height: 300) } } } struct AddressSearchView_Previews: PreviewProvider { static var previews: some View { AddressSearchView() } } PlaygroundPage.current.setLiveView(AddressSearchView()) When I try to run this I get this in the debug console: error: Couldn't look up symbols: protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI protocol witness table for _MapKit_SwiftUI.EmptyMapContent : _MapKit_SwiftUI.MapContent in _MapKit_SwiftUI Hint: The expression tried to call a function that is not present in the target, perhaps because it was optimized out by the compiler. the preview never shows up. If I use other SwiftUI components and not the map it works fine. What is happening? Playground target is Swift 6 macOS (iOS does the same). Xcode 16.2
0
0
233
Mar ’25