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

Xcode Documentation

Posts under Xcode tag

3,073 Posts
Sort by:
Post not yet marked as solved
0 Replies
10 Views
Hello, I've got a "other swift flag" set up for one of my schemes. It works when I build locally, but not when I try building using Xcode Cloud. My Other Swift Flags is set up like this: My code looks something like this: class Config { #if LIMITED static let configProperty = 1 #endif } However, Xcode Cloud says Config has no member 'configProperty', when I build my 'Limited' scheme.
Posted
by GBecker.
Last updated
.
Post not yet marked as solved
2 Replies
430 Views
During last night, Apple allegedly pushed new XProtect antivirus signatures. After that, I think XProtect found the malware Pirrit in my Xcode Simulator files from Apple. I'm not kidding. This is an excerpt from the XProtect log (notice the NSFilePath!): 2024-05-01 07:54:12.951 Pirrit 👉 no status_message report time 0.0000000 {"action":"report","path":{"modificationDate":732892166.8634809,"path":"\/Library\/Developer\/CoreSimulator\/Images\/1944D6AF-4D6B-4877-8F87-924EB62FC984.dmg","creationDate":732892166.8634809},"status":{"description":"Error deleting path: \/Library\/Developer\/CoreSimulator\/Images\/1944D6AF-4D6B-4877-8F87-924EB62FC984.dmg: Error Domain=NSCocoaErrorDomain Code=513 \"“1944D6AF-4D6B-4877-8F87-924EB62FC984.dmg” couldn’t be removed because you don’t have permission to access it.\" UserInfo={NSUserStringVariant=(\n Remove\n), NSFilePath=\/Library\/Developer\/CoreSimulator\/Images\/1944D6AF-4D6B-4877-8F87-924EB62FC984.dmg, NSUnderlyingError=0x1247612a0 {Error Domain=NSPOSIXErrorDomain Code=1 \"Operation not permitted\"}}.","causedBy":[],"code":24}} 2024-05-01 07:54:13.197 Pirrit message not in JSON format 2024-05-01 07:54:41.125 Pirrit ⚠️ FailedToRemediate time 0.0000280 {"caused_by":[],"execution_duration":2.8014183044433594e-05,"status_code":24,"status_message":"FailedToRemediate"} XProtect also detects another threat on my machine: 2024-05-01 10:09:58.530 BadGacha ⚠️ ThreatDetected time 0.0000120 {"caused_by":[],"execution_duration":1.2040138244628906e-05,"status_message":"ThreatDetected","status_code":21} Please check your XProtect logs. There is an app that can display these logs out there. Or you can use the system logging facility. I have deleted the whole Developer folders (both at / and ~) and reinstalled Xcode (not Beta). But a new XProtect scan finds Pirrit in the Core Simulator file again! I have also attempted to install an anti virus solution (Malwarebytes), but it does not detect anything. I am wondering if we should get someone from Apple involved. I am also wondering if I should reset my whole machine… Is anyone else seeing these issues in the XProtect log? It is unclear at this time whether there really is a Pirrit malware in Apple's Xcode simulator files or if there is some issue with XProtect like a faulty signature. Don't panic.
Posted
by otacon85.
Last updated
.
Post not yet marked as solved
7 Replies
171 Views
Hi all. I have a problem related to Xcode. Xcode says "iOS 17.2 simulator" is not installed, but I have been using this simulator for a long time and have installed the necessary SDKs. The problem has also been occurring for my colleagues since May 1, 2024. Restarting the Mac helps (there is no problem in Xcode after restarting Mac), but after reopening Xcode this problem repeats again. macOS 14.3.1 (23D60) Xcode 15.2 (15C500b)
Posted Last updated
.
Post not yet marked as solved
0 Replies
25 Views
Any ideas on this would be greatly appreciated. Is it a process error, set-up error or should I be raising a ticket for this? I continue to have 2 error messages when attempting push/pull to remote repository. Example: Create new project on Desktop using Xcode, File/New Project (tick 'create Git repository on my Mac'). Change 'ContentView' text to “Hello world!2”. Integrate/Commit, stage all, amend, commit. Create new remote repository (I have checked GitHub and a new repository has been added). Change 'ContentView' text to “Hello world!3” Integrate/Commit, stage all, amend, commit. - all looks fine so far Integrate/push to origin/main: Error message: “The local repository is out of date, make sure all changes have been pulled from the remote repository and try again”. There is now 1 up and 1 down arrow next to the branch. Integrate/pull Error message: "An unknown error has occurred. No merge base found". I have tried this several times with same response, using iMac with Xcode 15.3, also tried with Xcode 15.2.
Posted Last updated
.
Post not yet marked as solved
10 Replies
17k Views
When archiving & exporting App with Xcode 13. The Frameworks of the created app will have their Info.plist modified. CFBundleShortVersionString is being changed to have the same value as the application version. Steps to reproduce: Create iOS App project with v1.0.0 Add dynamic framework dependencies. ex: Framework A v3.0.0, Framework B v12.0.0. Archive Project. Distribute app AppStore Connect Export Finish the rest of the process with default values. Investigate generated IPA file Investigate .app file inside IPA Investigate frameworks inside .app file. CFBundleShortVersionString of all the frameworks is 1.0.0
Posted Last updated
.
Post not yet marked as solved
0 Replies
33 Views
In a feat of unmitigated disk cleaning, I removed who-knows-what, likely from ~/Library/Developer. Now I can't build apps that rely on watchOS (or likely tvOS/visionOS from the look of things). Run a try to build, Xcode tells me I should download watchOS, immediately shows me that it has, then does nothing. My Platforms window looks like this. If I tap Get next to watchOS 10.2 it looks like it succeeds immediately, but doesn't work (notice that 10.2 is already in the list). If I try to delete 10.2 from this list, it gives me an error that it can't find it on disk to delete it. I'm guessing there's a mismatch between some preference file and reality. Totally my fault I'm certain. Best way to recover?
Posted Last updated
.
Post not yet marked as solved
0 Replies
27 Views
I am using XCode on my Mac Book Pro M1 and trying to run the iOS app being developed on my iPad (5th generation, 12.9 inch) The devices are connected through USB-C cable. I have enabled developer mode on my iPad, trusted the M1 device, the developer, and the app. However the following appears on the iPad when trying to launch the app: Unable to Verify App An internet connection is required to verify trust of developer "Apple Development: ...". This app will not be available until verified This seems to be an issue with M1 specifically, as other people seem to have this problem, and the application successfully runs on other iOS devices
Posted Last updated
.
Post not yet marked as solved
2 Replies
86 Views
So like the title says, when I start up Xcode the preview won;t work till I run a debug session using the simulator. Sometimes the debug session is unable to start the simulator, which I can start manually then run a debug session. Once all the above is done, preview works. Any idea what is causing this behavior?
Posted
by SergioDCQ.
Last updated
.
Post not yet marked as solved
1 Replies
90 Views
Hi everyone, I'm encountering an issue with my iOS device not connecting to Xcode after updating to iOS 17.4. Even after trying various troubleshooting steps, including downloading Xcode 15.4 Beta, the problem persists. Troubleshooting Steps Taken: Restarted my Mac. Untrusted and re-trusted the iOS device. Restarted the iOS device. Ran the command defaults write com.apple.dt.Xcode DVTEnableCoreDevice enabled in Terminal and restarted Xcode. Additional Information: I've checked for any available updates for both Xcode and my iOS device, but none are available. There haven't been any recent changes or updates to my development environment prior to encountering this issue. My iOS device version is 17.4, and my MacOS version is Sonoma 14.4.1. Error Messages: There are no specific error messages displayed. The devices simply do not recognize each other when attempting to connect via Xcode. I would greatly appreciate any assistance or suggestions on how to resolve this issue. Thank you in advance for your help!
Posted
by bilalkhan.
Last updated
.
Post marked as solved
3 Replies
1.1k Views
Xcode: Version 15.0 beta 2 (15A5161b) iPhone: iOS 17.0 (21A5268h) Run from Xcode to Simulator or my iPhone, build successfully, install failed with the same error: My widget extension target info.plist file looks like the image below, and it worked find with all the previous Xcode version. After adding the key NSExtensionPrincipalClass like this: I can install my app to simaltor and my device, however, when archive and upload to the App Store (for TestFlight testing), i got another error (the first one is related to this issue, the second i could not figure out what it is):
Posted Last updated
.
Post marked as solved
4 Replies
187 Views
On my shop and content views of my app, I have a shopping cart SF symbol that I've modified with a conditional to show the number of items in the cart if the number of items is above zero. However, whenever I change tabs and back again, that icon disappears even though there should be an item in the cart. I have a video of the error, but I have no idea how to post it. Here is some of the code, let me know if you need to see more of it: CartManager.swift import Foundation import SwiftUI @Observable class CartManager { /*private(set)*/ var products: [Product] = [] private(set) var total: Int = 0 private(set) var numberofproducts: Int = 0 func count() -> Int { numberofproducts = products.count return numberofproducts } func addToCart(product: Product) { products.append(product) total += product.price numberofproducts = products.count } func removeFromCart(product: Product) { products = products.filter { $0.id != product.id } total -= product.price numberofproducts = products.count } } ShopPage.swift import SwiftUI struct ShopPage: View { @Environment(CartManager.self) private var cartManager var columns = [GridItem(.adaptive(minimum: 135), spacing: 0)] @State private var searchText = "" let items = ["LazyHeadphoneBean", "ProperBean", "BabyBean", "RoyalBean", "SpringBean", "beanbunny", "CapBean"] var filteredItems: [Bean] { guard searchText.isEmpty else { return beans } return beans.filter { $0.imageName.localizedCaseInsensitiveContains(searchText) } } var body: some View { NavigationStack { ZStack(alignment: .top) { Color.white .ignoresSafeArea(edges: .all) VStack { AppBar() .environment(cartManager) ScrollView() { LazyVGrid(columns: columns, spacing: 20) { ForEach(productList, id: \.id) { product in NavigationLink { beanDetail(product: product) .environment(cartManager) } label: { ProductCardView(product: product) .environment(cartManager) } } } } } .navigationBarDrawer(displayMode: .always)) } } .environment(cartManager) } var searchResults: [String] { if searchText.isEmpty { return items } else { return items.filter { $0.contains(searchText)} } } } #Preview { ShopPage() .environment(CartManager()) } struct AppBar: View { @Environment(CartManager.self) private var cartManager var body: some View { NavigationStack { VStack (alignment: .leading){ HStack { Spacer() NavigationLink(destination: CartView() .environment(cartManager) ) { CartButton(numberOfProducts: cartManager.products.count) } } Text("Shop for Beans") .font(.largeTitle .bold()) } } .padding() .environment(CartManager()) } } CartButton.swift import SwiftUI struct CartButton: View { var numberOfProducts: Int var body: some View { ZStack(alignment: .topTrailing) { Image(systemName: "cart.fill") .foregroundStyle(.black) .padding(5) if numberOfProducts > 0 { Text("\(numberOfProducts)") .font(.caption2).bold() .foregroundStyle(.white) .frame(width: 15, height: 15) .background(Color(hue: 1.0, saturation: 0.89, brightness: 0.835)) .clipShape(RoundedRectangle(cornerRadius: 50)) } } } } #Preview { CartButton(/*numberOfProducts: 1*/numberOfProducts: 1) }
Posted
by KittyCat.
Last updated
.
Post not yet marked as solved
18 Replies
2.1k Views
Since I started using XCode Cloud, my builds regularly failed due to networking issues, which is really just embarrassing. How can a company like Apple, which praises itself with a high-quality standard, ***** this up so badly? However, since two months ago literally every single build started failing for "connection reset by peer" My ci_post_clone.sh runs this code and surprisingly enough that step succeeds most of the time. #!/usr/bin/env bash set -e brew install cocoapods curl -s "https://get.sdkman.io" | bash source "$HOME/.sdkman/bin/sdkman-init.sh" sdk install java 20.0.1-tem # cd into actual project root cd ../../../ ./gradlew app:ios:podinstall However in the archive task the errors start rolling in 2023-08-30T22:27:24.108163427Z Could not resolve com.google.devtools.ksp:symbol-processing-api:1.9.0-1.0.11. 2023-08-30T22:27:24.108168428Z > Could not get resource 'https://repo.maven.apache.org/maven2/com/google/devtools/ksp/symbol-processing-api/1.9.0-1.0.11/symbol-processing-api-1.9.0-1.0.11.pom'. 2023-08-30T22:27:24.108173676Z > Could not GET 'https://repo.maven.apache.org/maven2/com/google/devtools/ksp/symbol-processing-api/1.9.0-1.0.11/symbol-processing-api-1.9.0-1.0.11.pom'. 2023-08-30T22:27:24.108181057Z > Got socket exception during request. It might be caused by SSL misconfiguration 2023-08-30T22:27:24.108186894Z > Connection reset by peer 2023-08-30T22:27:24.108206745Z Could not resolve com.google.devtools.ksp:symbol-processing-api:1.9.0-1.0.11. 2023-08-30T22:27:24.108213605Z > 2023-08-30T22:27:24.108219500Z Could not get resource 'https://dl.google.com/dl/android/maven2/com/google/devtools/ksp/symbol-processing-api/1.9.0-1.0.11/symbol-processing-api-1.9.0-1.0.11.pom'. 2023-08-30T22:27:24.108234940Z > 2023-08-30T22:27:24.108239423Z Could not GET 'https://dl.google.com/dl/android/maven2/com/google/devtools/ksp/symbol-processing-api/1.9.0-1.0.11/symbol-processing-api-1.9.0-1.0.11.pom'. 2023-08-30T22:27:24.108662595Z Got socket exception during request. It might be caused by SSL misconfiguration 2023-08-30T22:27:24.108669328Z 2023-08-30T22:27:24.108716268Z 2023-08-30T22:27:24.108725059Z > 2023-08-30T22:27:24.108732903Z Connection reset by peer 2023-08-30T22:27:24.108740596Z 2023-08-30T22:27:24.108748688Z > 2023-08-30T22:27:24.108759002Z Could not resolve com.google.devtools.ksp:symbol-processing-api:1.9.0-1.0.11. 2023-08-30T22:27:24.108820147Z > 2023-08-30T22:27:24.108829571Z Could not get resource 'https://maven.pkg.jetbrains.space/public/p/compose/dev/com/google/devtools/ksp/symbol-processing-api/1.9.0-1.0.11/symbol-processing-api-1.9.0-1.0.11.pom'. 2023-08-30T22:27:24.108837310Z > 2023-08-30T22:27:24.108844471Z Could not GET 'https://maven.pkg.jetbrains.space/public/p/compose/dev/com/google/devtools/ksp/symbol-processing-api/1.9.0-1.0.11/symbol-processing-api-1.9.0-1.0.11.pom'. 2023-08-30T22:27:24.108860417Z 2023-08-30T22:27:24.108866956Z > Got socket exception during request. It might be caused by SSL misconfiguration So because it is highly unlikely or actually statistically impossible that repo.maven.apache.org, dl.google.com and maven.pkg.jetbrains.space all always decide to crash simultaneously whenever I run an XCode build for the past 3 months, this has to be an issue on their part. Did they suddenly stop allowing internet connections in the archive step? Apple Support was just useless and aksed for irrelevant and impossible information like: my browser my ipa file (of a failing build?!) Does anyone have any idea what causes this or has contacts to someone at apple which can fix this?
Posted
by Schlaubi.
Last updated
.
Post not yet marked as solved
1 Replies
174 Views
Simulators will not install. Run destinations all empty. Can't even run on device. XCode 15.4 beta Sonoma 14.4.1 Intel Mac 16" MBP Attached screenshot of error. iOS 17.5 beta 2 (21F5058d) "Not compatible with XCode 15.4 beta" No run destinations appear. Not even 17.4 device that is plugged in. This all worked yesterday after initial XCode upgrade to 15.4 beta. Now all destinations are missing, even though they appear as installed in the 'Platforms' window. (yes I have rebooted and restarted XCode).
Posted
by a11y.
Last updated
.
Post not yet marked as solved
7 Replies
397 Views
I've reached a point where I can no longer make any progress diagnosing the issues that have popped up with Apple Watch development support. To hopefully help draw attention and focus to the severity of this problem, I'm gathering all related threads into this single thread. Summary of problems There are several, possibly related, issues at play: Xcode is not discovering Apple Watches. This means it's not possible to deploy apps to Apple Watches that aren't already provisioned with Xcode. I've confirmed this behavior with a watch running watchOS 10.0. The logging profile for watchOS has expired. It's no longer possible to pull logs via Console from Apple Watches. AppIntent-based complications on watchOS 10.5 no longer load, staying stuck in a "placeholder" state. This can be reproduced with the Backyard Birds demo app. It's no longer possible to debug widget extensions on Apple Watch hardware. Feedback submitted FB13758427: No longer able to connect to Apple Watch from Xcode I was attempting to test another regression related to AppIntents no longer working on watchOS 10.5. To confirm the behavior had regressed since earlier versions of watchOS, I set up one of my older Apple Watches that is still running watchOS 10.0. After wiping the watch and repairing it with one of my test devices (iPhone 11 Pro, iOS 17.4.1), I’m unable to get the Apple Watch to appear in Xcode’s Devices & Simulators manager. The phone is connected via USB cable, and the phone appears as a Connected phone, but the watch does not appear. My Apple Watch Ultra that I use as my daily driver does appear as a remote device (the globe icon is next to it), but the Apple Watch 10.0 does not appear. Details about the older watch: Version: 10.0 21R5341c Model: A2478 Not being able to test on other Apple Watches is severely limiting my ability to isolate and confirm the regression in AppIntent support that can be reproduced in the Backyard Birds demo app. Note that the 10.0 watch does actually appear in the Console app, but with a warning sign next to it. The 10.0 watch also appears twice. Clicking the warning sign does not reveal any information about why the warning is appearing, but after ~5 seconds I do get the following error in Console.app: “The user has not responded to the pairing request on 'Headless’ Respond to the Trust prompt on the device.” There is no trust prompt on the device. FB13756074: WatchOS logging profile is no longer valid https://developer.apple.com/bug-reporting/profiles-and-logs/?platform=watchos is no longer valid. See attached error that occurs when attempting to install the profile onto my Apple Watch Ultra. It seems that without this I’m unable to get any logs off of my Apple Watch, which is making testing/development quite difficult. FB13758450: AppIntent-based widgets no longer render on watchOS 10.5 AppIntent-based complications no longer get beyond a placeholder state on watchOS. This can be reproduced with the Backyard Birds demo app, which uses AppIntent-based widget configurations for the watchOS complications. AppIntent-based complications did appear to work in previous versions of watchOS 10, but I’m unable to confirm this with a 10.0 Watch I have due to FB13758427. To reproduce deploy the attached unmodified Backyard Birds app to a watch running watchOS 10.5. add a Backyard Birds complication to a watch face. Expected behavior: the widget shows live data Actual behavior: the complication never leaves a placeholder state. See the attached screenshot for the state the widget is stuck in. FB13758490: PacketLogger no longer logs packets PacketLogger used to log BTLE packets as they were received and transmitted on a macOS machine. Since updating to 14.5 Beta (23F5064f) however, PacketLogger no longer logs packets on macOS at all. Upon starting a new session, the interface remains empty. PacketLogger is still able to log packets from a connected iOS device. Related threads Apple Watch cannot reconnect WatchOS Sysdiagnose Profile is no longer XCode 15 can't run on iOS 17 devices. Previous preparation error: An error occurred while communicating with a remote process.. The connection was invalidated.
Posted Last updated
.
Post not yet marked as solved
16 Replies
2.7k Views
Since Xcode 15.3 it has become impossible to build our project more twice in a row without encountering a batch of "internal inconsistency error: never received target ended message for target ID …". This issues appeared a few months ago (15.0 i think, but i'm not sure), but xcode 15.3 makes it almost unusable. We're a team of 3 iOS devs, and we're all having the problem. Our project involves a lot of SPM packages, a few cocoa pods, a few iOS Frameworks, and a bit of swiftgen. Nothing particularly special for a large project, and no custom build steps that does anything fancy. It is now to the point where we're looking for alternative to xcode, because we can't decently kill xcode and restart every time we have to build our code...
Posted Last updated
.
Post not yet marked as solved
0 Replies
62 Views
The std::sort function, which was not problematic until version 15.2, causes a crash, perhaps because of a modified [The performance of std::sort and std::ranges::sort was improved by up to 50% for arithmetic types (120908845)] entry in xcode 15.3. For your information, std::vector contained instances of the class I had written, and I was comparing them through a custom Comp function. However, items that should not be null are recognized as null and crash as a null reference. Please check it and return it.
Posted
by PIRUA.
Last updated
.
Post marked as solved
14 Replies
6.5k Views
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?
Posted Last updated
.