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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

Xcode Canvas preview connected to iPhone error
"Can not preview in this file" Xcode 16.0 iPhone 14 Pro , iOS 18.0 When I choose to start Preview on my iPhone, the canvas screen keeps showing loading circle animation. The iPhone enters the Xcode Previews App but only displays the default screen (Xcode icon& 'Preview from Xcode') I uploaded the some of diagnostics files previews_diagnostics_summary.txt remote_injection.json
2
0
81
1d
Automating import of distribution certificates for iOS builds
We build a number of iOS apps using different distribution certificates on a "headless" build machine in a data center. It is a burden to have to accept a newly imported certificate because codesign causes a dialog to pop up requesting to authorize the private key We have tried a number of suggestions in various posts, including deleting the certificate and re-importing with security import using the -T flag to allow codesign. After doing this, and even though the ACL shows a very similar picture to the post authorized state, keychain still requires a dialog to be "Allowed". What can be done, from the command line, to avoid this popup?
0
0
83
1d
How to refresh local Swift Package after adding files in Xcode 16?
Since upgrading to Xcode 16, I've noticed that when I add new files to my local Swift packages, the "Update Package" option is no longer available when I right-click on my local package. In previous versions of Xcode, I used this feature to make Xcode recognize newly added files without any issues. Now, with Xcode 16, the only way I've found to get Xcode to recognize new files is to remove and re-add the entire package, which is obviously not ideal. I've tried cleaning the build folder and rebuilding the project, but it doesn't seem to help. Is there a new workflow or method in Xcode 16 to refresh or update local Swift packages without needing to remove and re-add them every time? Any suggestions or workarounds would be greatly appreciated! What I’ve tried so far: Cleaning and rebuilding the project Looking for any options under "File > Packages" menu Environment: Xcode 16 Local Swift Package Thanks in advance!
2
1
123
1w
Swift xcframeworks built with Xcode 16 not works in Xcode 15 projects
Hello, when I use xcode 16 build swift xcframeworks and provide it for my customer, however they can not use it their xcode 15 projects. Undefined symbol: _swift_FORCE_LOAD$_swift_Builtin_float Undefined symbol: _+ _swift_FORCE_LOAD$_swift_errno Undefined symbol: _+ _swift_FORCE_LOAD$_swift_math Undefined symbol: _+ _swift_FORCE_LOAD$_swift_signal Undefined symbol: _+ _swift_FORCE_LOAD$_swift_stdio Undefined symbol: _+ _swift_FORCE_LOAD$_swift_time Undefined symbol: _+ _swift_FORCE_LOAD$_swiftsys_time Undefined symbol: _+ _swift_FORCE_LOAD$_swiftunistd What should I do? And macOS Sequoia does not support Xcode 15.4. I can not build my frameworks with Xcode 15.4 now.
0
2
61
1d
Xcode 16 warning about missing symbols of static framework
I work on an SDK, and one of the ways we distribute it is as a pre-compiled static XCFramework. As far as I know, it’s the nature of a static framework to not contain symbols since the framework will be embedded in the final app binary, and the symbols should then be generated. However, when testing the "Validate" function of the Xcode 16 deployment process, our users are receiving a warning that says the framework does not contain symbols. Is my assumption about static frameworks and symbols incorrect? Could this be a bug in Xcode 16? Should we modify something in our framework to inform Xcode that symbols are not needed?
18
5
2.7k
Aug ’24
MacOSX Sonoma 14.7 + XCode 16.0 + iOS 17.6.1:
I am trying to install an app from a XCode project onto a iOS 17.6.1 device. The Macbook is a MacOSX Sonoma 14.7, Apple M2 Pro. I'm running XCode 16.0. I receive a series of alerts before receiving the final message. I tried to delete everything in this folder: rm ~/Library/Caches/com.apple.dt.Xcode/Downloads/* I reviewed the XCode components currently installed: I downloaded more runtime simulators from this link. I then followed the instructions provided in this link. For example: xcrun simctl runtime add "~/Downloads/iOS_17.4_Simulator_Runtime.dmg" xcrun simctl runtime add "~/Downloads/iOS_17.5_Simulator_Runtime.dmg" I'm still getting a message beside the device I want to install my app: The Developer Disk Image Could Not Be Staged On The Host I need help. I don't know what else to do. I don't see any matching simulators available for 17.6.1 and 17.7. Does anyone have any ideas?
5
0
219
6d
AppIntents don't show up in Shortcuts app when in SPM package
Hi there, I successfully created an AppIntent for our app, and when I had it in the same target as our main app it showed up fine in the shortcuts app. Then I realized that many of the new System Control widgets introduced in iOS 18 (e.g. lockscreen, control center) live in the widget extension target, but they also need to reference that same AppIntent. So to fix this, I thought I'd migrate out the code into it's own SPM package that both the WidgetExtension and the Main App processes can reference. However, after doing that and rebuilding, the intent no longer shows up in the Shortcuts app. Furthermore, my AppShortcutsProvider class now has this error when trying to define the list of appShortcuts: App Intent <name> should be in the same target as AppShortcutsProvider Is this intended, and if so, how do we reference the same AppIntent across multiple targets?
12
1
890
Jul ’24
Xcode - Product > Archive files
Hello. I'm working on an app which works on multiple platforms (iOS, macOS, watchOS, tvOS). It builds and runs fine on the simulator and a real device but when trying to create a Product > Archive on macOS, it fails. Here's the error message I get: Build target RailBoardMac Project RailBoard | Configuration Debug | Destination Any Mac | SDK macOS 15.1 Link RailBoardMac (x86_64) 0.3 seconds Could not parse or use implicit file '/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/SwiftUlCore.framework/ Versions/A/SwiftUlCore.tbd': cannot link directly with 'SwiftUlCore' because product being built is not an allowed client of it less Undefined symbol: _main × Linker command failed with exit code 1 (use -v to see invocation) Build failed 20/09/2024, I know this used to work. I must have changed something somewhere and it no longer does. I'd be grateful for any assistance.
4
0
117
1w
Compatibility Issue with WebKit.WKWebView.evaluateJavaScript(_:completionHandler:) in Xcode 16
I've encountered an issue after upgrading to Xcode 16. I have an overridden func of WebKit.WKWebView.evaluateJavaScript(_:completionHandler:), which no longer compiles in the new Xcode. I noticed that in Xcode 16, the completionHandler now has @MainActor and @Sendable annotations, which causes a compilation error. public override func evaluateJavaScript(_ javaScriptString: String, completionHandler: (@MainActor @Sendable (Any?, (any Error)?) -> Void)? = nil) When I add these annotations to my overridden method, it compiles fine in Xcode 16. However, this breaks compilation in older versions of Xcode. The documentation for this API doesn't explicitly mention any changes, but the behavior is clearly different between versions. https://developer.apple.com/documentation/webkit/wkwebview/1415017-evaluatejavascript Xcode 15: Xcode 16: What would be the best way to handle this situation? Should I use a compilation condition to differentiate between the versions? If so, what would be the correct condition to check? Was there a Swift compiler update in Xcode 16 that could be affecting this? Or is it better to drop support for versions of Xcode earlier than 16? Or I should not override that? Thanks in advance for any insights!
4
1
241
1w
WidgetKit keep crashing and widgets not displaying
So I have a MacOS application that was working just fine before Xcode 16. The Widgets are not working anymore. The main application and the widgets share a file in a common App Group. The widget app now get a permission error when accessing the file. Also, the Widget Kit simulator keeps crashing. I also try to start a new project in Xcode, add a target with a Widget extension with an App Intent and run it, and it also crashes. Sometimes, it doesn't crash but just display the error: "Failed to load widget. The operation couldn't be completed. (WidgetKit_Simulator.WidgetDocument.Error error 2.). Edited to attach WidgetKit error log widgetKitError.txt
2
0
111
3d
xcode 16 ios 18.0 simulator download failed
I installed xcode 16 and both Predictive Code Completion Model and iOS 18.0 Simulator Failed Download. I can live without the code completion, but I can not get any Simulator to install. I clicked of the info button and it shows the following: Download failed. Domain: DVTDownloadableErrorDomain Code: 41 User Info: { DVTErrorCreationDateKey = "2024-09-30 15:57:24 +0000"; } Download failed. Domain: DVTDownloadableErrorDomain Code: 41 Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({ RequestedBuild = 22A3351; }) Domain: DVTDownloadsUtilitiesErrorDomain Code: -1 Download failed as the server said authentication failed. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime) Domain: com.apple.MobileAssetError.Download Code: 41 User Info: { checkServer = 1; } System Information macOS Version 15.0 (Build 24A335) Xcode 16.0 (23051) (Build 16A242d) Timestamp: 2024-09-30T10:57:24-05:00
3
0
147
2d
Install command line tools 15 in xcode 16 on Mac OS Sequoia 15.0
I recently upgraded my Mac to Sequoia 15.0 (24A335) so I had to upgrade Xcode & command line tools to 16. I need command line tools 15 also on the mac due to some of the legacy projects depending on it. I want to install command line tools 15 and choose it in the Settings-->Location, but Xcode doesn't display "Command line tools 15" although i download & install from https://developer.apple.com/download/all/
2
0
198
3d
Returned from Unity games causes my app to slow and it works normal after siri or locking unlocking phone
Dear Developers, Am facing this issue on my production app. Tried everything. Removed almost everything and tested the app. Even then this issue happens. The unity games, am talking about are the slow and sluggish types, which feel like 30 fps and after returning from them, my app sounds slow and feels a little bit sluggish. As soon as i lock/unlock the device , it becomes perfectly fine. Even i was debugging with xcode, i had the issue, then i rebuild the app in xcode and opening it on device, the same issue. As soon as i locked the device or opened siri with lockbutton or moved to a native app, and came back, app is completely fine. Craziest issue, i have ever seen. Though killing the app and opening it again on iphone also works. Only anxiety is that maybe my users when returning from other slow 3rd party games which are my competitors might slow down the experience. I have tried almost everything in my app, removed all functions and just ran sounds. Retried with different ways of playing sounds. Nothing works. Dont know it is a frame rate issue, because i replaced all my animations causing framerate not to cross 60fps even then didnt work. Device on which am testing is Iphone 14 pro max.
0
0
95
2d