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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Headlinea-regular
I am developing an iPhone and watch app with xcode. I bought a new Mac and when I tried to build it with xcode, I got the message "/Users/watanabekensuke/TennisData/TennisDataMax/TennisDataMax Watch App/headlinea-regular.ttf lstat(/Users/watanabekensuke/TennisData/TennisDataMax/TennisDataMax Watch App/headlinea-regular.ttf): No such file or directory (2)" and I couldn't build it. Can someone help me?
0
0
5
1h
Xcode Static Analysis Not Warning About Localization Issue - User Facing Strings when Format String is Used
If I do this: NSString *name = @"Jim"; NSMenuItem *menuItem = [[NSMenuItem alloc]init]; // Analyze does show localization warning when format string is used. menuItem.title = [NSString stringWithFormat:@"Hello %@",name]; I expect to get the following warning: User-facing text should use localized string macro But I don't. However if I do this: menuItem.title = @"What"; I do get the warning about localization as expected and as desired when I run Analyze. Is this considered a bug? Thanks!
0
0
22
16h
How can you communicate that a .xcframework is a dependency OF the swift package inside Swift package definition?
I am sort of trying to do the opposite of what others are doing. I have a target called CopyFramework that creates a CopyFramework.framework within my main xcproj file. I set up this target because a specific framework (we can call it Tools.xcframework) is distributed as a binary. That framework file lives within the code. Tools.xcframework is structured like so Tools.xcframework (Coding/testBuild/DynamicToolFrameworks/Tools.xcframework) info.plist ios-arm64/ Tools.xcframework/ Tools (executable file) Tools.bundle Headers/ Info.plist Modules/ Tools.swiftmodule/ arm64-apple-ios.abi.json arm64-apple-ios.private.swiftinterface arm64-apple-ios.swiftdoc arm64-apple-ios.swiftinterface module.modulemap module.private.modulemap PrivateHeaders/ ios-arm64_x86_64-simulator/ When the CopyFramework target is run xcode does a few steps which copy the correct version of this framework to derived data. Process Tools.xcframework (iOS) Coding/testBuild/DynamicToolFrameworks/Tools.xcframework /Library/Developer/Xcode/DerivedData/testBuild-sha/Build/Products/Debug-iphoneos/Tools.framework ios cd /Users/calebkierum/Coding/testBuild builtin-process-xcframework --xcframework Coding/testBuild/DynamicToolFrameworks/Tools.xcframework --platform ios --target-path Library/Developer/Xcode/DerivedData/testBuild-sha/Build/Products/Debug-iphoneos Meaning essentially that the Tools.xcframework for the proper platform is taken from Tools.xcframework/ios-arm64 and copied to Library/Developer/Xcode/DerivedData/testBuild-sha/Build/Products/Debug-iphoneos/Tools.xcframework I am writing a Swift Package that needs to be able to reference the correct Tools.xcframework. I have set it up like so: let package = Package( name: "CoreObjC", platforms: [.iOS(.v17), .macCatalyst(.v17)], products: [ .library(name: "CoreObjC", targets: ["CoreObjC"]), ], dependencies: [ // Does something to here ??? //.package(path: "../testBuild") ], targets: [ .target( name: "CoreObjC", dependencies: [ // Here I would like to be referencing the CopyFramework.framework target within my buildTest.xcproj file .product(name: "CopyFramework", package: /*??? its not in a swift package its a part of an xcproj file*/) ], path: "CoreObjC", publicHeadersPath: "Headers", linkerSettings: [ .linkedFramework("Tools", .when(platforms: [.iOS])), .linkedLibrary("c++") ] ), ], cxxLanguageStandard: CXXLanguageStandard.gnucxx14 ) Now obviously this does not work. I do not know how to communicate to the Package.swift file that the binary dependency is a framework target within my xcproj file. If I do run the target CopyFramework followed by building CoreObjC it works though (so long as you comment out the bits trying to reference CopyFramework). Running the CopyFramework target processes the Tools.xcframework and copies the proper xcframework sub folder to Derived data and the Swift Package build system seems to be able to see it. Is there a way I can get rid of this manual step? Make it so that when I build the CoreObjC target (swift package) that either CopyFramework is run or some other process is run to get the proper xcframework out of Coding/testBuild/DynamicToolFrameworks/Tools.xcframework and into DerivedData? Is it even theoretically possible to have a Swift Package reference a target in a normal xcproj file?
0
0
19
16h
Icon Composer questions...
This is the Icon Composer from Xcode 26.0 Beta 1 (not the really old one Xcode6? 😆 that I find when I search here) Is there a way to show the really cool 3D that they showed off during demos? Maybe all we get is which level is on top. Upon export it only seems to be able to do 2x? - is there some way to get it to take 1x? Every time I change it - it jumps back to 2x and iOS wants 1x... maybe a feedback. Also Xcode seems to want 3 icons - but there are 6 iOS ones exported. How do I get the other 3 in there? It does seem pretty easy to import PNG's from Sketch and order them and move pieces around. I guess you can save individual lighting for each icon mode.
5
0
178
21h
How do I stop a Playground in Xcode 26 from constantly executing as I type
I am experimenting with Foundation Models using the new #Playground macro. It is pretty useful. One thing I am finding though, is that the playground constantly executing is distracting, when I restructure my code and know that the intermediate results are broken and I don’t care about them. I would like to disable the Playground, make some bigger code changes, and then enable Plaground again. How do I enable and disable the Playground from constantly running?
0
0
22
1d
Is a modulemap file required when importing a static library objective-c framework? If not when is a modulemap required?
I am a bit confused. My understanding previously was that a modulemap was required in order to have a bridging header be generated. Now it has come to my attention that a modulemap is both a build input and something you can put in the Modules folder of the built product if you so choose. I have tried reading the clang modulemap documentation, but am really struggling to connect most of what it says to the problem at hand. In a project I am working on, the generation of the modulemap file is quite problematic. The framework imports C++ libraries and itself writes Objective-C++ wrappers for them. Currently, the modulemap file is both set as the Module Map File in "Build Settings" and presumably used when the Swift project later imports it. In this project the modulemap is a list of the objective-c++ header files then export * I am trying to understand what I would lose if I do one or both of two things: What happens if I dont set this module map file in the build settings for the objective-c++ framework? What happens if I dont have a modulemap involved whatsoever in this objective-c++ framework and then it is imported into Swift? And does any of this change if its compiled as a static vs dynamic library? What if I embed it vs not embed it? Because the build in the real project is so complicated its hard to isolate what is going on. So I built a smaller sample app. There is CFramework which has an objective-c++ class. There is SwiftProject which imports that framework and is purely Swift. It imports the module and uses it. I did not write a modulemap file, and the Swift project builds just fine. In the timeline it: Prepares packages Computes target dependency graph Builds static cache for iPhoneSimulator18.2sdk As near as I can tell even though the objective-c++ framework is not built with a modulemap in its build settings and there is not a modulemap included in the framework everything works. So then the modulemap file is useless? Perhaps it speeds things up but what step would theoretically be skippable?
0
0
24
1d
Could not find library with name ”/usr/lib/swift/libswiftWebKit.dylib“
Canvas Previews (targeting macOS) in both Xcode 16.4 & Xcode 26 fail to load, when the project imports a Swift package that imports and uses WebKit. I'm on macOS 15.5. Tried also to bring minimum targets of both the project and the package to 15.0. I see that there are some work-arounds for iOS simulator but nothing for the Mac. Anyone facing the same problem?
5
0
74
1d
Can't download Predictive Code Completion Model
The Foundation Models Framework stopped working after Xcode failed to download the "Predictive Code Completion Model". What happened was on macOS Tahoe 26.0: Downloaded and installed Xcode 26 Beta (17A5241e) Worked with Foundation Models framework. Everything worked fine. ✅ Opened Xcode 16.4 This triggers the downloading of Predictive Code Completion Model which then fails. Go back into Xcode 26 Beta, Foundation Models framework no longer works. ❌ Error: "Failed to find asset: com.apple.gm.safety_deny.input.code_intelligence.base.generic - no asset" What I've tried or checked: Reinstalling Xcode 26 Beta Uninstalling both Xcodes and only installing Xcode 26 Beta Checked available space on drive (over 300 GB free) Restarted Mac Restarted Xcode 26 Changed wifi networks Turned on VPN Deleted the Library > Developer > Xcode folder and reinstalled Xcode 26 Feedback Report FB18208139: Can't download Predictive Code Completion Model - Xcode 26 Screenshots
16
18
978
1d
Authentication in UI tests
Hello! I am writing UI tests for an app with OAuth authentication and want to avoid the login screen. I want each developer to store the password and username locally on their machines. The bash script will get the token. I need to access that token from my test target somehow. The idea was to write them to a temporary file that git ignores and access this file from the bundle. But I can't add the file from the build script to the target and make it accessible from the code.
0
0
20
1d
IconComposer alternative app icons not working
I migrated all our alternative app icons to IconComposer icon files in my Xcode 26 project, but calling setAlternativeIconName fails with an error. Also, supportsAlternativeIcons returns false. This seems like a regression from Xcode 16. Do I need to add the CFBundleAlternateIcons? It's not needed as of Xcode 13 though.
0
0
17
2d
Auto-Link Behavior Problem
Hi, I encountered an issue in my code where I directly used #import <CoreHaptics/CoreHaptics.h> without adding it to the "Link Binary With Libraries" section under Build Phases. My deployment target is iOS 12, and the code was running fine before; however, after upgrading Xcode, the app crashes immediately on an iOS 12 device with the following error message: DYLD, Library not loaded: /System/Library/Frameworks/CoreHaptics.framework/CoreHaptics | xx | Reason: image not found. Did Xcode modify the default auto-linking configuration? When did this behavior change in which version of Xcode? Do I need to specify CoreHaptics.framework as Optional in "Link Binary With Libraries"? Thanks for reply soon!
1
0
20
2d
CommandLineTools SDK error: conflicting types for 'MPG_PAYLOAD
building gcc14-libgcc14 using Macports + Apple clang returns following error In file included from /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/mach/message.h:78, from /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/mach/arm/thread_status.h:40, from /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/mach/machine/thread_status.h:35, from /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/mach-o/loader.h:52, from /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/mach-o/dyld.h:30, from /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_macports_release_tarballs_ports_lang_gcc14/libgcc14/work/gcc-14.2.0/libgcc/config/darwin-crt-tm.c:29: /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/mach/port.h:510:1: error: conflicting types for 'MPG_PAYLOAD'; have 'uint64_t(uint8_t, uint32_t, uint32_t)' {aka 'long long unsigned int(unsigned char, unsigned int, unsigned int)'} 510 | MPG_PAYLOAD(uint8_t flag, uint32_t a, uint32_t b) | ^~~~~~~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/mach/port.h:498:1: note: previous definition of 'MPG_PAYLOAD' with type 'uint64_t(uint8_t, uint32_t)' {aka 'long long unsigned int(unsigned char, unsigned int)'} 498 | MPG_PAYLOAD(uint8_t flag, uint32_t a) | ^~~~~~~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/mach/port.h:523:1: error: conflicting types for 'MPG_PAYLOAD'; have 'uint64_t(uint8_t, uint32_t, uint16_t, uint16_t)' {aka 'long long unsigned int(unsigned char, unsigned int, short unsigned int, short unsigned int)'} 523 | MPG_PAYLOAD(uint8_t flag, uint32_t a, uint16_t b, uint16_t c) | ^~~~~~~~~~~ /Library/Developer/CommandLineTools/SDKs/MacOSX26.sdk/usr/include/mach/port.h:498:1: note: previous definition of 'MPG_PAYLOAD' with type 'uint64_t(uint8_t, uint32_t)' {aka 'long long unsigned int(unsigned char, unsigned int)'} 498 | MPG_PAYLOAD(uint8_t flag, uint32_t a) libgcxx compiles fine if forcing compile using clang20/clang19 there is no error.
1
0
20
2d
Module not found when using inheritance
PLATFORM AND VERSION Development environment: Xcode 16.4 (16F6), macOS 15.5 (24F74) Run-time configuration: iOS 18.3.1 DESCRIPTION OF PROBLEM I cannot build my app due to a module not found error when I'm importing Sample-Swift.h header to an ObjectiveC file. I need to use Swift code to ObjectiveC file with Swift code using an external XCFramework. It seems to be related to a mix with ObjectiveC and Swift code when Swift code uses class inheritance from FZWorkoutKit class. With a full Swift project, no issue. STEPS TO REPRODUCE Project https://fizzup.s3.amazonaws.com/files/public/Sample-WK.zip Open the provided project and try to build it. The issue occurs. In MyObject.m file, if you comment the first import (Sample-Swift.h), no issue occurs but I cannot use my Swift code (MyFile class). Uncomment the line commented in step 1. Go to MyFile.swift and change class inheritance from GoModeController (from FZWorkoutKit framework) to UIView (from UIKit). No issue occurs.
0
0
28
2d
Xcode 26 Link Error
Using xcode 26 with linker flag -ld_classic,get an error : 0 0x1042b9778 __assert_rtn + 160 1 0x1042bc560 ld::tool::SymbolTableAtom<x86_64>::classicOrdinalForProxy(ld::Atom const*) (.cold.3) + 0 2 0x1041f3da8 ld::tool::SymbolTableAtom<x86_64>::classicOrdinalForProxy(ld::Atom const*) + 172 3 0x1041f4c1c ld::tool::SymbolTableAtom::addImport(ld::Atom const*, ld::tool::StringPoolAtom*) + 140 4 0x1041f6500 ld::tool::SymbolTableAtom::encode() + 396 5 0x1041e83a8 ___ZN2ld4tool10OutputFile20buildLINKEDITContentERNS_8InternalE_block_invoke.413 + 36 6 0x182a95b2c _dispatch_call_block_and_release + 32 7 0x182aaf85c _dispatch_client_callout + 16 8 0x182acc478 _dispatch_channel_invoke.cold.5 + 92 9 0x182aa7fa4 _dispatch_root_queue_drain + 736 10 0x182aa85d4 _dispatch_worker_thread2 + 156 11 0x182c49e28 _pthread_wqthread + 232 A linker snapshot was created at: /tmp/app-2025-06-13-215652.ld-snapshot ld: Assertion failed: (it != _dylibToOrdinal.end()), function dylibToOrdinal, file OutputFile.cpp, line 5196. clang++: error: linker command failed with exit code 1 (use -v to see invocation)
8
2
165
2d