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

Xcode Documentation

Pinned Posts

Posts under Xcode tag

3,062 Posts
Sort by:
Post not yet marked as solved
0 Replies
19 Views
Hello. I've been looking all over this forum and stack and done some internet searches but unfortunately have found nothing to assist in fixing an error I'm receiving on my project in Xcode. Every view shows an error identical to the one shown above, only with that specific file name displayed instead. When I go to fix the error, this is the error detail displayed: == PREVIEW UPDATE ERROR: LinkDylibError: Failed to build TabBar.swift Linking failed: linker command failed with exit code 1 (use -v to see invocation) ld: warning: search path '/Applications/Xcode.app/Contents/SharedFrameworks-iphonesimulator' not found ld: unsupported mach-o filetype (only MH_OBJECT and MH_DYLIB can be linked) in '/Users/brycemchose/Library/Developer/Xcode/DerivedData/Service_Square_App-dnblqgabcrxprhaizjtkcvouyzln/Build/Intermediates.noindex/Previews/iphonesimulator/Service Square App/Products/Debug-iphonesimulator/Service Square.app/Service Square' clang: error: linker command failed with exit code 1 (use -v to see invocation) Note that I can run the app successfully to a simulator or to my iPhone, but cannot see the preview within the Xcode canvas. I've been blindly developing the last two app updates, pushing the changes to the simulator and then tweaking the code based on the simulated version. I can keep doing this for a little while but it is significantly slower and more difficult, especially to fix small bugs and make tiny changes, so I'd really like to see if anyone has an idea for how I can get the preview back to being properly displayed. I'm brand new to this whole thing and have no idea how to fix this issue, so I'd be really grateful if someone with more experience could offer some suggestions! Thanks in advance! :)
Posted Last updated
.
Post not yet marked as solved
0 Replies
19 Views
He terminado de desarrollar una nueva versión de mi aplicación, la cual incluye notificaciones a través de FireBase Cloud Messaging. A la hora de compilar la aplicación para probar las funcionalidades. Me sale el siguiente error: El ContentView de mi aplicación es el siguiente. import SwiftUI import WebKit import Firebase import FirebaseMessaging class AppDelegate: NSObject, UIApplicationDelegate, UNUserNotificationCenterDelegate { func application (_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { FirebaseApp.configure () requestAuthorizationForPushNotification(application: application) return true } func userNotificationCenter(_ center: UNUserNotificationCenter, willPresent notification: UNNotification, witchCompletionHandler completionHandler: @escaping (UNNotificationPresentationOptions) -> Void) { completionHandler([.banner, .sound]) } func userNotificationCenter(_ center: UNUserNotificationCenter, didReceive response: UNNotificationResponse, withCompletionHandler completionHandler: @escaping () -> Void) { completionHandler() } private func requestAuthorizationForPushNotification(application: UIApplication) { UNUserNotificationCenter.current().delegate = self UNUserNotificationCenter.current().requestAuthorization(options: [.alert, .badge, .sound]) { _, _ in } application.registerForRemoteNotifications() } func application(_ application: UIApplication, didRegisterForRemoteNotificationsWithDeviceToken deviceToken: Data) { Messaging.messaging().apnsToken = deviceToken } struct ContentView: View { @State private var showWebView = false private let urlString: String = "https://b-p-s-o-badajoz-beta.flutterflow.app/" var body: some View { VStack(spacing: 40) { WebView(url: URL(string: urlString)!).frame(height: 890.0) .cornerRadius(10) .shadow(color: .black.opacity(0.3), radius: 20.0, x: 5, y: 5) } } struct WebView: UIViewRepresentable { var url: URL func makeUIView(context: Context) -> WKWebView { return WKWebView() } func updateUIView(_ uiView: WKWebView, context: Context) { let request = URLRequest(url: url) uiView.load(request) } } struct ContentView_Previews: PreviewProvider { static var previews: some View { ContentView() } } } }
Posted Last updated
.
Post not yet marked as solved
0 Replies
20 Views
Xcode version: 15.2, iOS deployment target 15.0 When experimenting with the new Xcode 15/new linker feature "Mergable Libraries" I came across an issue with subproject framework products. I have a workspace with two projects. I want to create a group framework named GroupFramework that consists of three other frameworks. FrameworkA, FrameworkB and FrameworkC. FrameworkA and FrameworkB are in the same project as the group framework I want to create. FrameworkC is a product of another project in my workspace. GroupFramework has all three frameworks linked in the "link binary with libraries" build phase. GroupFramework has "Create merged binary" set to manual because I want to control which frameworks are linked. FrameworkA, FrameworkB and FrameworkC all have "Build mergeabe library" set to YES. The application builds in both RELEASE and DEBUG. Running in DEBUG and RELEASE When running the application on a device in DEBUG or RELEASE it crashes with a linker error because FrameworkC can't be found on disk. When inspecting the app binary in RELEASE I can see that FrameworkA and FrameworkB are both in the ReexportedBinary folder, but FrameworkC is nowhere to be seen. I have tried embedding FrameworkC explicitly in the settings of the GroupFramework essentially creating an umbrella framework, and that also does not fix the issue. I have also tried embedding FrameworkC directly into the AppTarget that will consume GroupFramework. This solves the linking issue but a new issue regarding unresolved symbols then crops up. It appears as though the Reexporting and Merging of subproject frameworks is not working compared to a product that exists in the same project or at least may require a lot more manual configuration which is not currently documented anywhere. If this is the case, it could be very problematic when trying to adopt mergeable libraries in multi-project workspaces.
Posted
by Rednaz.
Last updated
.
Post not yet marked as solved
4 Replies
1.8k Views
We have a closed-source SDK distributed as a static framework. We are experiencing some difficulty in incorporating Privacy Manifests. We added the Privacy Manifest as a resource in the xcframework using the Copy Bundle Resources phase. Our expectation was that the developer could then add the xcframework to their application and select the Embed Without Signing embed option. Even though it's a static framework, Xcode removes the static archive from the framework when it is embedded in the target bundle as described here: Embedding a static framework using a Copy Files build phase now removes the static archive from the framework when it is embedded in the target bundle. The REMOVE_STATIC_EXECUTABLES_FROM_EMBEDDED_BUNDLES build setting can be set to NO to opt out of this behavior. The COPY_RESOURCES_FROM_STATIC_FRAMEWORKS build setting, previously used in the legacy build system to extract and copy the resources from a static framework to the target bundle, no longer has any effect with the new build system as the entire framework is copied instead (minus the static archive as described above) The problem is that by doing this, the Info.plists present in the platform folder (.framework) is also embedded into the host app. The Info.plist now references the binary that was removed, causing a validation error when uploading to iTunes Connect. Similarly, if we remove the Info.plist from the xcframework platforms folders, it is not possible to run the host application on the simulator. Firebase is facing the same problem as they prepare to incorporate Privacy Manifests into their frameworks. When distributing via CocoaPods and SPM, we do not have this problem since it is possible to reference an external .xcprivacy to the xcframework in the package itself. So, in summary, how do we incorporate Privacy Manifests into a static framework?
Posted Last updated
.
Post not yet marked as solved
3 Replies
98 Views
There is some new UI in Xcode for upgrading OS versions. I clicked the new Get button at the top of the screen. It went and got the new iOS 17.4. Great, but it is just sitting there. After much floundering around, I eventually found the UI that has the Install button. Clicked it. Nothing happens. I have restarted Xcode several times, went looking for an Xcode update, no joy. My development is now dead for two days. Really not happy.
Posted Last updated
.
Post marked as solved
2 Replies
3.4k Views
Hi I am building a framework. In the past, if I create a framework project [myFrameworkName.framework] file was created in the 'Products' folder. But my xcode doesn't create 'Products' folder. It also doesn't create [myFrameworkName.framework]. Can I make [myFrameworkName.framework] file? I do not speak English well So I am using a translator. thanks.
Posted
by juh2.
Last updated
.
Post not yet marked as solved
1 Replies
47 Views
I get warnings from Visual Studio saying that in order to run cross platform MAUI applications I need to reduce the xCode version to 14.3. The emulator appears but the app can't be interacted with, using the latest versions of both VS and XC. So I've decided to try downloading the earlier version of xCode, but there seem to be no active Apple sponsored links and I'm wary of trying an alternate website. All links suggest https://developer.apple.com/downloads/ but this redirects to https://developer.apple.com/account From the account page there is a download https://developer.apple.com/download/ but this only holds OS operating systems. The xCode page: https://developer.apple.com/xcode/ only has 15 available. https://developer.apple.com/xcode/resources/ which says it has a download for earlier versions of software, only points me back to the account page and we're back to square one. So someone please let me know if I'm insane or the 14 is too deprecated to download and VS is no longer compatible.
Posted
by jmnbcuni.
Last updated
.
Post not yet marked as solved
0 Replies
56 Views
Running Sonoma 14.4.1 and XCode 15.3 I'm unable to verify an app update. This app runs fine under Sonoma and the project has been verified many times before for earlier systems, but the new XCode crashes every time during the verification step. Of course this is stopping any further app updates. Is this known to anyone else? I've submitted the crash reports.
Posted Last updated
.
Post not yet marked as solved
0 Replies
36 Views
I'm seeing some weird behavior with conditional compilation when I use a build configuration other than "Debug" or "Release", and I'm wondering if I'm doing something wrong or if this is an Xcode bug. The setup Xcode version: 15.3 I have a simple SwiftUI view that takes in a model and displays an attribute of the model. struct ContentView: View { let model: Model var body: some View { VStack { Text("Name: \(model.name)") } .padding() } } In the model file, I have the struct definition, but also an extension that defines some sample data for use in SwiftUI previews: struct Model { let id: String let name: String } #if DEBUG extension Model { static let example = Model( id: "50fef362-f53d-4ded-9168-b887ff62e59d", name: "John Doe" ) } #endif And finally, I have a preview provider that uses this sample data: #Preview { ContentView(model: Model.example) } Normal behavior With the default "Debug" build configuration, this works just fine. There are no compilation errors, and the preview renders as expected. The issue Start off by changing the name of the build configuration to, e.g. "DebugDev" Now I start seeing seeing a mis-match between what happens and what Xcode tells me is happening. The code still compiles and runs, and the SwiftUI preview still works, but Xcode is displaying things as if it doesn't compile. Xcode formats the conditionally compiled code with a lower opacity color as if DEBUG isn't defined: In the view file, I now see a compilation error when referencing the conditionally-compiled code: Autocomplete doesn't work when trying to reference the conditionally compiled code Additional details/observations I have confirmed that the DEBUG active compilation condition is still defined in the build settings. All I've done is change the name of the build config I was initially thinking this might have something to do with the fact that this appears in a preview provider, since those are treated a bit differently, but the same thing happens if I reference the conditionally compiled code directly in the view class Another theory: since I was referencing conditionally compiled code from code that wasn't conditionally compiled, maybe Xcode was trying to tell me that wasn't valid. So, I tried placing the code that calls the conditionally compiled code (in this case, the view class) inside an #if DEBUG. This does get rid of the displayed compilation error, but auto-complete still doesn't work, and the whole class is displayed with the lower-opacity font. Help? I feel like I must be missing something. The only alternative I can think of is that Xcode has some logic hard-coded with the default "Debug" build config, and that would be...just silly.
Posted
by nivektric.
Last updated
.
Post not yet marked as solved
0 Replies
101 Views
I just bought a Vision Pro to build and run my app on it, but I'm encountering this error from Xcode: Developer Mode is enabled. Computer is paired. Device is paired, and it's connected to my Mac via the Developer Strap. In the "VPN & Device Management" setting it says to navigate to, there is no "Developer App certificate". Others have suggested clearing the ModuleCache in DerivedData, but that's also been fruitless. I've cleaned the build multiple times, and restarted both devices, and Xcode. I have no idea what else I can possibly do to resolve this. Does anyone have any other ideas?
Posted Last updated
.
Post not yet marked as solved
0 Replies
155 Views
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.
Posted
by edford.
Last updated
.
Post marked as Apple Recommended
686 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 marked as Apple Recommended
585 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
17 Replies
2.1k Views
I got a new MacBook and set it up as a new one, not transferring any data from the old one. But now the Apple Watch (Series 6) paired with my iPhone (14 Pro Max) ist not shown in Xcode. iPhone and Watch are using the latest RC and also Xcode is the latest RC. But in Xcode I ca only see my iPhone, not the paired Watch. See Screenshots. The first shows the new MacBook and the second the old one. I already tried a lot, but nothing helps: Unpair Watch from Phone and then pair it again Plug the iPhone to different USB ports Restart Watch, iPhone and Mac Delete the iPhone from Xcode Enable and disable Developer Mode on iPhone and Watch What else can I try to get the Watch back?
Posted
by Urkman.
Last updated
.
Post not yet marked as solved
12 Replies
6.7k Views
I downloaded Xcode 15 beta 5 and I'm trying to work on my app, but it's having a problem with the simulator. It can't find the runtime I guess. This is the first time I've ran into this. When I try to run, this is what I get: The com.apple.CoreSimulator.SimRuntime.iOS-17-0 simulator runtime is not available. runtime profile not found using "System" match policy Download the com.apple.CoreSimulator.SimRuntime.iOS-17-0 simulator runtime from the Xcode Settings. Not sure what to do here. I also installed the latest iOS 17 developer beta on my device and Xcode doesn't work with that either. I can't help but think the development team forgot something here.
Posted Last updated
.
Post not yet marked as solved
0 Replies
66 Views
I'm trying to download artifacts from some recent Xcode Cloud builds. In both Xcode and App Store Connect I'm getting errors. Xcode says: "Error Fetching Test Results: API Invalid status code: 501. App Store Connect says: "artifacts could not be found." FB13773789 - Xcode Cloud: Service returning 501 in Xcode when trying to view artifacts of successful build from minutes ago I have tried several projects to rule out project specific issues and it is happening to all of my Xcode Cloud enabled projects. Both Xcode 15.3 and 15.4 beta exhibit this behavior. Is anyone else running into this issue? I noticed it yesterday, and it continues into this morning.
Posted
by edorphy.
Last updated
.
Post marked as solved
4 Replies
100 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
71 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
11 Replies
737 Views
Our app is using SwiftData + SwiftUI. After upgrading to Xcode 15.3 Beta, RC1, RC2, we’ve experienced the same issue that the app is having 100% CPU activity even when left idle. This happens as long as the SwiftUI is using @Query to fetch SwiftData and the query does return at least 1 result (there is no issue if the query returns empty result). We’ve tried the following and therefore confirmed that this is a Xcode 15.3 beta issue: Xcode 15.3 Beta + iOS 17.2 -> 100% CPU activity when idle Xcode 15.3 Beta + iOS 17.4 beta -> 100% CPU activity when idle Xcode 15.2 Beta + iOS 17.2 -> normal This only happens during debug run. When profiling / using instrument, this doesn't happen.
Posted
by fanwgwg.
Last updated
.
Post not yet marked as solved
9 Replies
496 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
.