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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Adding Fonts in Xcode 16.1 Causes XIB Files to Malfunction
I encountered a problem when adding a new custom font in Xcode 16.1. After including the font and opening my XIB files, the interface preview became blank and the application seemed to experience a heavy load. To troubleshoot, I removed all custom fonts, and everything returned to normal functionality. However, even after reinstalling Xcode, the issue persisted when adding the font again. The XIB preview loaded correctly: The XIB preview turned blank and became unresponsive:
0
0
497
Dec ’24
XCode 16.2 - error: unable to open dependencies file
Hello, I am encountering "unable to open dependencies file" error in XCode that started after updating to Xcode version 16.2 and macOS version 15.2. The error message I receive is as follows: error: unable to open dependencies file (/Users/user/Library/Developer/Xcode/DerivedData/MyProject-cwpcmnebzjpgkzcuoauxlaeiqrsg/Build/Intermediates.noindex/MyProject.build/Debug-iphoneos/MyProject.build/Objects-normal/arm64/MyProject-master.d) (in target 'MyProject' from project 'MyProject') This problem didn’t occur with XCode 16.1; the project was building successfully before the update. Now, even reverting to XCode 16.1 doesn’t resolve the issue anymore. Here’s what I’ve tried so far without success: Switched the compilation mode to “Whole Module” Cleaned the build folder Cleared Derived Data Thank you in advance for any suggestions!
0
4
833
Dec ’24
Looking to Make a Unity Plugin for VisionOS
I'm using Unity to create a VisionOS project. Using Polyspatial. I want to be able to use WeatherKit. I can not seem to create a VisionOS plugin in Unity. I've found all sorts of resources for building one for iOS. I made small changes to convert to VisionOS, but no matter what I do, I get 'Undefined Symbol' errors when I try to build the XCode project. Most recently I used this github for reference https://github.com/Robert-96/unity-swift/tree/main Am i trying to do something that just isn't possible for VisionOS?
0
0
250
Sep ’24
Updating Swift Packages via command line (Xcode 16)
We have a tool in our CI which periodically updates our iOS project's Swift Package Manager dependencies. The script that does a few things, but generally speaking it first removes the existing package.resolved at ./ProjectName.xcodeproj/project.xcworkspace/xcshareddata/swiftpm/Package.resolved and then runs: xcodebuild -resolvePackageDependencies -disablePackageRepositoryCache This regenerated the package.resolved file to reflect the latest, updated versions of the dependencies. It is the equivalent of doing Xcode > File > Packages> Update to Latest Package Versions. This has been working perfectly for a long time, but has stopped working since we moved from Xcode 15.4 to Xcode 16. I have also tested this with Xcode 16.1 and 16.2 - with no luck. I have tried running this command locally, and can confirm it is not an issue with the environment of our CI. I have also tried swift package update. Both of these commands appear to work - no errors are thrown, and the logs say "resolved source packages". However, they are not updating the packages. They are making no changes to the package.resolved file. However, using Xcode > File > Packages> Update to Latest Package Versions in Xcode 16 works as expected - the packages are updated and the .resolved file is updated. Is there now a different way to update Swift packages via the command line, or is this likely an Xcode 16 bug? Update: This feels broken, so I have submitted a Feedback Report (FB16108036) but perhaps someone can suggest a workaround for the time being!
0
3
842
Dec ’24
error: unknown type name 'CFAttributedStringRef'
OS ERROR] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h:104:27: error: cannot combine with previous 'type-name' declaration specifier [OHOS ERROR] CFAttributedStringRef string ) CT_AVAILABLE(macos(10.5), ios(3.2), watchos(2.0), tvos(9.0)); [OHOS ERROR] ^ [OHOS ERROR] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h:132:27: error: unknown type name 'string'; did you mean 'std::string'? [OHOS ERROR] CFAttributedStringRef string, [OHOS ERROR] ^ [OHOS ERROR] ../../prebuilts/clang/ohos/darwin-arm64/llvm/bin/../include/c++/v1/iosfwd:249:65: note: 'std::string' declared here [OHOS ERROR] typedef basic_string<char, char_traits, allocator > string; [OHOS ERROR] ^ [OHOS ERROR] In file included from ../../ide/tools/previewer/util/unix/ClipboardObjc.mm:18: [OHOS ERROR] In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:13: [OHOS ERROR] In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/AppKit.h:15: [OHOS ERROR] In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSAccessibilityColor.h:9: [OHOS ERROR] In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSColor.h:46: [OHOS ERROR] In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSApplication.h:10: [OHOS ERROR] In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSResponder.h:10: [OHOS ERROR] In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSEvent.h:10: [OHOS ERROR] In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/ApplicationServices.framework/Headers/ApplicationServices.h:39: [OHOS ERROR] In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CoreText.h:26: [OHOS ERROR] In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTFramesetter.h:21: [OHOS ERROR] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/CoreText.framework/Headers/CTTypesetter.h:132:5: error: unknown type name 'CFAttributedStringRef'; did you mean 'NSAttributedStringKey'? [OHOS ERROR] CFAttributedStringRef string, [OHOS ERROR] ^ [OHOS ERROR] /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.0.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSAttributedString.h:22:20: note: 'NSAttributedStringKey' declared here [OHOS ERROR] typedef NSString * NSAttributedStringKey NS_TYPED_EXTENSIBLE_ENUM; [OHOS ERROR] ^ [OHOS ERROR] In file included from ../../ide/tools/previewer/util/unix/ClipboardObjc.mm:18:
0
1
366
Sep ’24
"No such module" error when trying to create module
Am running Xcode 16.1 on Sequoia and am getting "No such module" error. Here are my steps: Create workspace in Xcode and name it AccessControl2 Create Project named OrangeInc and add it to AccessControl2 group. Create blank playground named AccessControl and add it to AccessControl2 group Error message in playground after I add "import OrangeInc" reads "No such module" Have tried repeating this several times; get same error message.
0
0
271
Dec ’24
After building the Watch app, Xcode prompted 'Could not install the preview host' test Watch App. app 'on Apple Watch Series 10 (46mm)
I don't know where the settings were set incorrectly. Unable to install and use applications in preview and virtual machines. I have tried many online methods but have not been able to solve it. It seems that the compiled app file cannot be found. The folder structure of Build is as follows: Build Intermediates.noindex Products Debug-iphonesimulator Debug-watchsimulator Thank you all for your assistance.
0
0
235
Sep ’24
In the crash logs organizer is it possible to see how often a crash is occurring?
I can certainly see how many devices hit it but its a but is there enough data here to know if this was a fluke vs "every time x" thing that may be more annoying? Given at this point my app is only rolled out to a few users the number of devices isn't as useful for telling me which crashes to prioritize. In this screenshot I can tell two devices hit it. But did they only hit it once? Daily?
0
0
192
Dec ’24
Advertising supported apps
Apple is pushing to use AdAttributionKit, but when I look at various ad networks, their sample code isn't using it. I'd like to find a simple example using a banner add and a third party ad network like admob. Also, I'm not clear on what post backs really do, or if I need them at all. If anyone can point me to clear documentation that is up to date, that would be great!
0
0
352
Dec ’24
WeatherKit in commandline app
I am trying to add WeatherKit support to a commandline app to fetch historical data. I've configured an app ID with the WeatherKit entitlement, but WeatherKit does not appear in the Capabilities list to add. When I try to access weather data, it fails with Code=4097 "connection to service named com.apple.weatherkit.authservice" suggesting it's not authorized. How do I add the WeatherKit entitlement to a commandline Swift app?
0
0
409
Dec ’24
How to: Add File... w/o moving nor copying that file
I have a number of utility functions/extensions in a .swift file at a central location. In Xcode 15, I used to be able to Add File... and uncheck the box that said COPY. The project would then have a REFERENCE to the file. I could make changes to the shared file and all projects that referenced that file would see the latest version. I don't see how to do that in Xcode 16. Add File... opens a dialog and the only options (in a drop-down) are Copy and Move -- neither of which I want to do. How do you make a reference in Xcode 16?
0
1
308
Sep ’24
Crash report from user unexpectedly looks like beta app
According to this page: https://developer.apple.com/documentation/xcode/interpreting-the-json-format-of-a-crash-report the storeInfo element of a JSON crash log may contain a deviceIdentifierForVendor element, but quote "This field is only present for TestFlight builds of an app". A user has just sent me a crash report which contains this key, but this isn't a testflight build. The suspicion is of course that the app is "cracked" in some way, but having interacted with the user for some time I think this is unlikely. He has had various issues with the app, affecting multiple devices; I have been wondering if there is something wrong with his Apple account. The docs also say that this "replaces the CrashReporter Key field", yet this crash report contains both. So my question for other developers: if you have any .ips crash logs, obtained from non-testflight users of your apps, please could you grep them for deviceIdentifierForVendor and let me know what you find. If any Apple people have any clues about how this could innocently end up in a crash report, please let me know. Maybe it's a documentation bug?
0
0
368
Dec ’24
Can't transfer CSV file to iPhone simulator
I'm trying to transfer a CSV file to my iPhone 16 simulator to use for testing my application, but it keeps failing. See the image below. That occurs when I try to drag the file into the simulator. I also tried to use the Share option for the file, but nothing happens with that. It doesn't transfer but it also doesn't fail. I'm assuming it's failing in the background. Anyone know what I can do?
0
0
257
Dec ’24
Unable to export App via Jenkins pipeline
Hi Team, Exporting the archive through the Jenkins pipeline (executing commands on a Mac EC2 instance as a Jenkins agent) isn't working, while exporting directly from the Mac terminal successfully generates the IPA file. What might be the cause? When we execute it on directly Mac terminal, it asks Keychain password first time & after that it automatically generates IPA file. Note : We are using below working command to open keychain access. security unlock-keychain -p "my_password" /Users/ec2-user/Library/Keychains/login.keychain-db Export command : xcodebuild -exportArchive -archivePath $PWD/build/Archive/MyApp.xcarchive -exportPath $PWD/build/IPA -exportOptionsPlist ../../Dev_exportOptions.plist -allowProvisioningUpdates Current details: Node version : node-v18.17.0-darwin-arm64 Npm version : 9.6.7 Ionic version : 5.2.6 Xcode version : 15.4 Macos : Sonoma 14.6.1
0
0
502
Sep ’24
Xcode Doesn't recognises the git worktree version of the swift package
I'm building an iOS app using Xcode, and I frequently modify code within a package. To do this, I drag and drop a locally cloned version of the package into my project as a local package. However, when working across multiple branches of my app, I need different versions of the package as well. To achieve this, I use Git worktrees to create branch-specific copies of the package. Unfortunately, when I drag and drop these worktree copies into Xcode, the IDE doesn't seem to recognize them. Could you kindly guide me on resolving this?
0
0
243
Dec ’24