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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Unsupported option '-mno-thumb' in Xcode 16
I'm trying to compile my project, which worked fine before upgrading to Xcode 16, and I'm getting error clang: error: unsupported option '-mno-thumb' for target 'arm64-apple-ios18.0-simulator'. It appears to a similar issue as this BoringSSL-GRPC issue. The fix from StackOverflow was to automatically strip the flag in the Podfile using CocoaPods, but I'm not using CocoaPods. I've grepped the entire project, and I can't find that flag anywhere in the project. Likewise, the full error message doesn't even include -mno-thumb. Does anyone know how I can determine where this flag is being added, so I can remove it? I've tried this in both Xcode 16.1 and Xcode 16.2 on MacOS Sonoma and Sequoia 15.2. The full error log is CompileC /Users/ck/Library/Developer/Xcode/DerivedData/Delta-dwedcmxtirqnkdghmvobshblwrib/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DSDeltaCore.build/Objects-normal/arm64/DSEmulatorBridge.o /Users/ck/Projects/system/Delta/Cores/DSDeltaCore/DSDeltaCore/Bridge/DSEmulatorBridge.mm normal arm64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (in target 'DSDeltaCore' from project 'Pods') cd /Users/ck/Projects/system/Delta/Pods Using response file: /Users/ck/Library/Developer/Xcode/DerivedData/Delta-dwedcmxtirqnkdghmvobshblwrib/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DSDeltaCore.build/Objects-normal/arm64/af3fcb34312c57c0f52879cdce924b91-common-args.resp /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -x objective-c++ -ivfsstatcache /Users/ck/Library/Developer/Xcode/DerivedData/SDKStatCaches.noindex/iphonesimulator18.2-22C146-07b28473f605e47e75261259d3ef3b5a.sdkstatcache -fmessage-length\=0 -fdiagnostics-show-note-include-stack -fmacro-backtrace-limit\=0 -fno-color-diagnostics -fmodules-prune-interval\=86400 -fmodules-prune-after\=345600 -fbuild-session-file\=/Users/ck/Library/Developer/Xcode/DerivedData/ModuleCache.noindex/Session.modulevalidation -fmodules-validate-once-per-build-session -Wnon-modular-include-in-framework-module -Werror\=non-modular-include-in-framework-module -Wno-trigraphs -Wno-missing-field-initializers -Wno-missing-prototypes -Werror\=return-type -Wdocumentation -Wunreachable-code -Wno-implicit-atomic-properties -Werror\=deprecated-objc-isa-usage -Wno-objc-interface-ivars -Werror\=objc-root-class -Wno-arc-repeated-use-of-weak -Wimplicit-retain-self -Wno-non-virtual-dtor -Wno-overloaded-virtual -Wno-exit-time-destructors -Wduplicate-method-match -Wno-missing-braces -Wparentheses -Wswitch -Wunused-function -Wno-unused-label -Wno-unused-parameter -Wunused-variable -Wunused-value -Wempty-body -Wuninitialized -Wconditional-uninitialized -Wno-unknown-pragmas -Wno-shadow -Wno-four-char-constants -Wno-conversion -Wconstant-conversion -Wint-conversion -Wbool-conversion -Wenum-conversion -Wno-float-conversion -Wnon-literal-null-conversion -Wobjc-literal-conversion -Wshorten-64-to-32 -Wno-newline-eof -Wno-selector -Wno-strict-selector-match -Wundeclared-selector -Wdeprecated-implementations -Wno-c++11-extensions -Wno-implicit-fallthrough -fstrict-aliasing -Wprotocol -Wdeprecated-declarations -Winvalid-offsetof -Wno-sign-conversion -Winfinite-recursion -Wmove -Wcomma -Wblock-capture-autoreleasing -Wstrict-prototypes -Wrange-loop-analysis -Wno-semicolon-before-method-body -Wunguarded-availability -index-store-path /Users/ck/Library/Developer/Xcode/DerivedData/Delta-dwedcmxtirqnkdghmvobshblwrib/Index.noindex/DataStore @/Users/ck/Library/Developer/Xcode/DerivedData/Delta-dwedcmxtirqnkdghmvobshblwrib/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DSDeltaCore.build/Objects-normal/arm64/af3fcb34312c57c0f52879cdce924b91-common-args.resp -w -Xanalyzer -analyzer-disable-all-checks -include /Users/ck/Projects/system/Delta/Pods/Target\ Support\ Files/DSDeltaCore/DSDeltaCore-prefix.pch -MMD -MT dependencies -MF /Users/ck/Library/Developer/Xcode/DerivedData/Delta-dwedcmxtirqnkdghmvobshblwrib/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DSDeltaCore.build/Objects-normal/arm64/DSEmulatorBridge.d --serialize-diagnostics /Users/ck/Library/Developer/Xcode/DerivedData/Delta-dwedcmxtirqnkdghmvobshblwrib/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DSDeltaCore.build/Objects-normal/arm64/DSEmulatorBridge.dia -c /Users/ck/Projects/system/Delta/Cores/DSDeltaCore/DSDeltaCore/Bridge/DSEmulatorBridge.mm -o /Users/ck/Library/Developer/Xcode/DerivedData/Delta-dwedcmxtirqnkdghmvobshblwrib/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/DSDeltaCore.build/Objects-normal/arm64/DSEmulatorBridge.o -index-unit-output-path /Pods.build/Debug-iphonesimulator/DSDeltaCore.build/Objects-normal/arm64/DSEmulatorBridge.o clang: error: unsupported option '-mno-thumb' for target 'arm64-apple-ios18.0-simulator'
3
0
1.3k
Dec ’24
Gaps in Xcode build timeline
Reposting (after a while) from the Swift forums - the build timeline for our project has a lot of weird gaps in the beginning - almost 15 seconds in total, which is quite a big chunk of the total build time. Is there any way to determine why they exist or how I could fix them? I hope it's just something hidden and not the build system literally doing nothing... This is on Xcode 15.4.
1
0
429
Mar ’25
When connecting xcode and iPhone
When connecting xcode and iPhone, the keypad does not appear on the screen where you enter the device password to trust the computer, so the connection is not possible. How do I make the keypad appear? There is no response when I tap the text box.
0
0
105
Nov ’24
How to -disable-dynamic-actor-isolation FLAG
When I built my app with xCode16.2, the app crashed at runtime. When building, I got a warning "UIWebView' is deprecated: first deprecated in iOS 12.0 - No longer supported; please adopt WKWebView.", so I suspected the dynamic actor isolation check. When building, I tried setting the "-disable-dynamic-actor-isolation" flag, but the app still crashed. However, I think the flag is not set properly, so how should I set the "-disable-dynamic-actor-isolation" flag? I tried setting it as follows. Is this the correct way to set it? Swift Compiler - Custom Flags Other Swift Flags Debug Any Architecuture | Any SDK -disable-dynamic-actor-isolation Release Any Architecuture | Any SDK -disable-dynamic-actor-isolation
0
0
184
Dec ’24
Xcode 16.1: Swift macro killing indexing performance?
I'm working on a project with several dozen targets and a Swift macro. Due to the purpose of the macro (generating Codable boilerplate), pretty much all targets depend on it. The project is generated with XcodeGen. Since upgrading to 16.1 (I think), Xcode has basically turned into a glorified TextEdit for me: refactoring, symbol navigation and search don't work. Also, I'm getting a lot of ghost errors that keep popping up hours after I fix them, while at the same time new build errors never show up in the error navigator, so I have to check the build log to see why the build failed. I noticed that project indexing is taking a very long time. As a troubleshooting step, I tried deleting DerivedData (which afaik includes the index) to see if this fixes the problem. Xcode started indexing the project from scratch, and if the progress indicator is to be trusted, After ~40 minutes it's only about 1/3 done. For every target Xcode seems to be spending a lot of time indexing SwiftOperators, SwiftDiagnostics, SwiftParser. I'm assuming these are related to the macro. Does anyone else have this problem? Unfortunately, I can't confirm this is caused by the macro, removing it from the project and seeing if this fixes the issue seems infeasible.
0
0
394
Dec ’24
Slow bundle copy build phase from dependency
We have a dependency, Apollo iOS, that is managed by SwiftPM in an internal module Swift Package. That internal Swift Package is then linked and included in our iOS target. The iOS target has an associated WidgetKit extension app. When archiving the app, we're seeing extremely long "Copy Apollo_Apollo.bundle" build steps, on the magnitude of 15 minutes. This is only happening when copying the bundle for the Widget extension app. Builds are done with Xcode 15.2, but we've tried on 15.4 and 16.2, seeing a few minutes shaved off. How can we begin to debug this issue?
0
0
250
Dec ’24
EXC_BAD_ACCESS crash in some Swift Testing test on a macro
Hi, I'm trying to test a view model that conforms to ObservableObject with swift testing. My test looks like @Test("When a filter is selected the 'save search' button is enabled") func testWhenAFilterIsSelectedTheSaveButtonIsEnabled() { let viewModel = GxClassSearchFormViewModel( filterSelection: .init(), currentSavedSearch: nil ) // when viewModel.filterSelection.clubs.select(hasle) // then #expect(viewModel.savedSearchState == .active) #expect(viewModel.isSavedSearchButtonDisabled) } Interestingly, this test crashes on the iOS 16.2 Simulator. I'm using Version 16.2 (16C5032a) It crashes at the macro level like: And I don't understand what's wrong really. Maybe a concurrency issue? not sure. Xcode stops the execution and the debug navigator shows and incredibly long stack trace. I add images from the top and bottom of it as it's too long to add it all Has anyone experience a similar issue? It has happened to me in other tests too, sometimes when using #required
1
0
621
Dec ’24
Derived Data - XCode
/Users/jadenbro1/Library/Developer/Xcode/DerivedData/FreshSocial-gdolmhnopfbaoggkkbuawiubjget/Build/Intermediates.noindex/FreshSocial.build/Debug-iphoneos/FreshSocial.build/DerivedSources/FreshSocial_vers.c module map file '/Users/jadenbro1/Library/Developer/Xcode/DerivedData/FreshSocial-gdolmhnopfbaoggkkbuawiubjget/Build/Products/Debug-iphoneos/react-native-text-recognition/react_native_text_recognition.modulemap' not found /Users/jadenbro1/Library/Developer/Xcode/DerivedData/FreshSocial-gdolmhnopfbaoggkkbuawiubjget/Build/Intermediates.noindex/FreshSocial.build/Debug-iphoneos/FreshSocial.build/DerivedSources/FreshSocial_vers.c extern const unsigned char FreshSocialVersionString[]; extern const double FreshSocialVersionNumber; const unsigned char FreshSocialVersionString[] attribute ((used)) = "@(#)PROGRAM:FreshSocial PROJECT:FreshSocial-1" "\n"; const double FreshSocialVersionNumber attribute ((used)) = (double)1.; Can someone help me understand this? I’ve done everything, deleted derived data, cleaned the build, built a whole new project environment, everything…
1
0
231
Dec ’24
Can't seem to get Unit Test target working when I create. Multiplatform project
In Xcode Version 16.1 Create a new Project, choose Multiplatform, App For testing system, choose XCTest and UI Tests In the project, open the newly generated template Unit test file Click either of the diamonds in the left margin (either to run the example test or the entire file) Expected Result: Code compiles and then Runs the test/tests Actual Result: Code compiles, but then never completes testing (the top status bar is stuck saying "Testing..." forever.) Am I missing something?
0
0
416
Dec ’24
SafariBookmarksSyncAgent quits unexpectedly
Since recently (maybe after updating to Sonoma 14.7.1 - 23H222, but not sure, I get a crash report stating that SafariBookmarksSyncAgent quitted unexpectedly Once acquitted the report, it will reappear 2 minutes later as long as Xcode is open. Configuration: Sonoma 14.7.1 Safari Technology Preview Release 208 (Safari 18.2, WebKit 19621.1.5.1) Xcode 15.3 (15E204a) That seems to be a known problem. Question: Is it due to MacOS version ? To Xcode version ? To Safari version ? To webKit version ? Or to simulator, as I gat an AegirPoster crash (as described here: https://stackoverflow.com/questions/77083912/macbook-pro-crashes-when-using-simulator-aegirposter-process) I read that I would need to restart some devices (eg, iPhone). That seems to temporarily solve the problem Here is a part of the report: Incident Identifier: 0D2456DF-5801-41D6-8294-2BF442224913 CrashReporter Key: 4DE33529-174E-32C5-D8A8-26FE128BE16B Hardware Model: Mac14,12 Process: SafariBookmarksSyncAgent [38972] Path: /Volumes/VOLUME/*/SafariSupport.bundle/SafariBookmarksSyncAgent Identifier: com.apple.SafariBookmarksSyncAgent Version: 8614 (8614.1.25.0.17) Code Type: ARM-64 (Native) Role: Unspecified Parent Process: launchd_sim [28070] Coalition: com.apple.CoreSimulator.SimDevice.0058D576-D9FF-4169-8437-D0A24C923500 [9832] Responsible Process: SimulatorTrampoline [1116] Date/Time: 2024-11-27 15:19:42.4908 +0100 Launch Time: 2024-11-27 15:19:42.4610 +0100 OS Version: macOS 14.7.1 (23H222) Release Type: User Report Version: 104 Exception Type: EXC_BAD_ACCESS (SIGSEGV) Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000204476580 Exception Codes: 0x0000000000000001, 0x0000000204476580 VM Region Info: 0x204476580 is not in any region. Bytes after previous region: 894002561 Bytes before following region: 58984012416 REGION TYPE START - END [ VSIZE] PRT/MAX SHRMOD REGION DETAIL VM_ALLOCATE 1cefdc000-1cefe0000 [ 16K] r--/rwx SM=PRV ---> GAP OF 0xdf1020000 BYTES commpage (reserved) fc0000000-1000000000 [ 1.0G] ---/--- SM=COW reserved VM address space (unallocated) Termination Reason: SIGNAL 11 Segmentation fault: 11 Terminating Process: exc handler [38972] Triggered by Thread: 0 Thread 0 Crashed: 0 dyld_sim 0x104f9dc7c dyld4::SyscallDelegate::forEachInDirectory(char const*, bool, void (char const*, char const*) block_pointer) const + 172 1 dyld_sim 0x104f88b6c invocation function for block in dyld4::ProcessConfig::PathOverrides::processVersionedPaths(dyld4::ProcessConfig::Process const&, dyld4::SyscallDelegate&, dyld4::ProcessConfig::DyldCache const&, dyld3::Platform, dyld3::GradedArchs const&, lsl::Allocator&) + 104 2 dyld_sim 0x104f88aa0 dyld4::ProcessConfig::PathOverrides::forEachInColonList(char const*, char const*, bool&, void (char const*, bool&) block_pointer) + 224 3 dyld_sim 0x104f886b8 dyld4::ProcessConfig::PathOverrides::processVersionedPaths(dyld4::ProcessConfig::Process const&, dyld4::SyscallDelegate&, dyld4::ProcessConfig::DyldCache const&, dyld3::Platform, dyld3::GradedArchs const&, lsl::Allocator&) + 144 4 dyld_sim 0x104f882a8 dyld4::ProcessConfig::PathOverrides::PathOverrides(dyld4::ProcessConfig::Process const&, dyld4::ProcessConfig::Security const&, dyld4::ProcessConfig::Logging const&, dyld4::ProcessConfig::DyldCache const&, dyld4::SyscallDelegate&, lsl::Allocator&) + 344 5 dyld_sim 0x104f868b8 dyld4::ProcessConfig::ProcessConfig(dyld4::KernelArgs const*, dyld4::SyscallDelegate&, lsl::Allocator&) + 152 6 dyld_sim 0x104f85e30 _dyld_sim_prepare + 352 7 dyld 0x10492fa8c dyld4::prepareSim(dyld4::RuntimeState&, char const*) + 1276 8 dyld 0x10492e4f0 dyld4::prepare(dyld4::APIs&, dyld3::MachOAnalyzer const*) + 308 9 dyld 0x10492def4 start + 1868 I filed a bug report: Nov 27, 2024 at 3:41 PM – FB15976427
1
0
664
Dec ’24
Reusing string catalog translations in swift packages
Setup I have 2 swift packages and I try to use stirng catalog to manage your localizations I would like to use some specific keys in these packages and some common ones (e.g. "ok_button_tittle") Problem statement I really don't like the idea of creating separate (but the same) translations in these packages I have tried using something like String( localized: "ok_button_title", table: "Localizable", bundle: .main, comment: "Ok button title" ) This does use translations from the main bundle, however this does not automatically create the keys in string catalog Question Is there any possibility to reuse the translations from the main bundle? Maybe there is a hack to make the keys appear automatically in the correct bundle? Or is it a bug?
1
0
457
Jan ’25
CoreData in Swift Packages
I am having issues loading my model from a Swift Package with the following structure: | Package.swift | Sources | - | SamplePackage | - | - Core | - | - | - SamplePackageDataStack.swift | - | - | - DataModel.xcdatamodeld | - | - | - | - Model.xcdatamodel ( <- is this new? ) As mentioned, I am not required to list the xcdatamodeld as a resource in my Package manifest. When trying to load the model in the main app, I am getting CoreData: error:  Failed to load model named DataModel Code: In my swift Package: public class SamplePackageDataStack: NSObject {     public static let shared = SamplePackageDataStack()     private override init() {}     public lazy var persistentContainer: NSPersistentContainer = { let container = NSPersistentContainer(name: "DataModel") container.loadPersistentStores(completionHandler: { (storeDescription, error) in             if let error = error as NSError? {                 fatalError("Unresolved error \(error), \(error.userInfo)")             }         })         return container     }()     /// The managed object context associated with the main queue. (read-only)     public var context: NSManagedObjectContext {         return self.persistentContainer.viewContext     }     public func saveContext () {         if context.hasChanges {             do {                 try context.save()             } catch {                 let nserror = error as NSError                 fatalError("Unresolved error \(nserror), \(nserror.userInfo)")             }         }     } } Main App: import SamplePackage class ViewController: UIViewController { override func viewDidLoad() { &#9;&#9;&#9;&#9;&#9;super.viewDidLoad() &#9;var container = SamplePackageDataStack.shared.persistentContainer         print(container) &#9;&#9;} }
5
0
5.5k
Jul ’25
How to retrieve overall memory peak in C++
I'm trying to retrieve the overall memory peak of a process. I've looked into retrieving it through task_vm_info struct defined in task_info.h By logging the members of the struct, it seems neither resident_size_peak, internal_peak or ledger_phys_footprint_peak is matching what the peak memory value that's being detected by xcode instrument. Can anyone point me to the correct way to retrieve that peak value? Is it the summation of some of the fields in task_vm_info` or is there a more complicated algorithm involved in deriving that value?
0
0
325
Nov ’24
CMTimeMultiplyByRatio in iOS 16
let videoURL = URL(fileURLWithPath: path ?? "") let asset = AVURLAsset(url: videoURL, options: nil) let imageGenerator = AVAssetImageGenerator(asset: asset) imageGenerator.appliesPreferredTrackTransform = true let time = CMTimeMultiplyByRatio(asset.duration, multiplier: 1, divisor: 2) // THIS LINE GIVES ISSUE: "'duration' was deprecated in iOS 16.0: Use load(.duration) instead". I CANNOT FIGURE OUT THE CORRECT SYNTAX FOR CHANGING asset.duration TO REPLACE WITH load(.duration). HELP WITH THE CORRECT SYNTAX WOULD BE HELPFUL.
1
0
1.1k
Nov ’24
Metal GPU capture
I'm trying to get performance information in a Metal cpp program. I'm using Xcode 14.2. In the Counters tab, only the inscription No Data appears. What could be the problem, what am I doing wrong? The libraries Metal, MetalKit, AppKit are connected. The code is taken from the Apple website from the Learn Metal with C++ section.
1
0
470
Dec ’24
Xcode Fails to Load Products Metadata from the StoreKit Configuration File
I'm on an Intel-based Mac running macOS Sonoma 14.7.1 (23H222) and Xcode Version 16.1 (16B40). I've created a local StoreKit Configuration File that does not synchronise with App Store Connect and selected it in the Scheme. I have some products that are consumable in-app purchase and it loads fine as expected when I run the app and I am able to make transactions. It also show up in the Transaction Manager. After a little while, working on the app, re-running it several times, it stops working. The products do not load the metadata from the StoreKit configuration file. I also get this error in the console: Error enumerating unfinished transactions for first transaction listener: Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={AMSStatusCode=0, _NSURLErrorFailingURLSessionTaskErrorKey=LocalDataTask <DF5E86B0-0E4A-4982-AF42-FC58FA858C01>.<1>, NSErrorFailingURLKey=http://localhost:51027/inApps/history?guid=F01898465023&reason=initial, _kCFStreamErrorDomainKey=10, _NSURLErrorRelatedURLSessionTaskErrorKey=( "LocalDataTask <DF5E86B0-0E4A-4982-AF42-FC58FA858C01>.<1>" ), NSLocalizedDescription=A server with the specified hostname could not be found., NSErrorFailingURLStringKey=http://localhost:51027/inApps/history?guid=F01898465023&reason=initial, NSUnderlyingError=0x60000038c150 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorDomainKey=10, _kCFStreamErrorCodeKey=-72000, _NSURLErrorNWPathKey_desc=satisfied (Path is satisfied), interface: lo0, _NSURLErrorNWResolutionReportKey_desc=Resolved 0 endpoints in 0ms using unknown from query}}, _kCFStreamErrorCodeKey=-72000} Restarting the computer resolves the issue but I don't want to restart the computer every single time when it happens and it happens quite soon after a short while. How can I make sure that it doesn't happen or if it does happen then fix the issue without restarting the computer? Relaunching Xcode doesn't help and neither does deleting Project Build Data and Indexes.
0
0
498
Nov ’24
Provisioning profile "iOS Team Provisioning Profile: com.X" doesn't include the com.apple.developer.cksharing entitlement.
Hey all - Been building my app and all has been going well with successful builds through to test flight. However, I have just added CKSharing support into the app and therefore into the entitlements to allow collaboration within the app. As soon as I have added this, I can no longer build due to a signing certificate error stating my provisioning profile just not allow for CKSharing... "Provisioning profile "iOS Team Provisioning Profile: com.MyApp" doesn't include the com.apple.developer.cksharing entitlement." However, iCloud is enabled within my app profile, and all other cloudkit features have worked up until adding that specific entitlement. Any help or guidance to get passed this would be greatly appreciated.
0
0
543
Nov ’24
I would like to know how to switch the code view between Release and Debug modes.
You can see: in the first image, the default project have DEBUG macro. So in perview, release code segment is grey. But!!! In edit scheme, I change all of item to release mode! (See second image) At this point, the DEBUG code block is still highlighted. If I compile and run it, the output is actually from the Release code block. In other words, I have changed all the modes in the scheme, but the preview mode is still in DEBUG.
0
0
234
Dec ’24