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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Is debugging with App Data broken?
Trying to use App Data on Xcode 16.2, and failing I'm running the app with the debugger. When I run the app, I need to do a handful of things, which affects my app's cache files, and UserDefaults. What I'd like to do is store all of these settings, then have them loaded in when the app launches, so I don't need to do same, tedious work of changing settings by hand in the UI. So, I discovered that I can provide an xcappdata directory in the Run options. This seems like exactly what I'm looking for. But I can't seem to get it to work. Like, when the app runs, it looks like none of those settings are brought in. I ran the app on a device, and pulled down the application data, and then put that in the project. And you can see in the screenshot, that the value is set. So, either I'm missing something (which is totally possible) or this feature is broken. Documentation on this is not great, so maybe I'm doing something wrong. If the feature is known to be broken, I'll give up on this. But if it should work, it would be great to get some tips here.
0
0
228
Jan ’25
App crashing on real iPhone only (working fine on simulator and Xcode preview)
Hi, I'm currently facing an issue where my React Native app crashes only on a real iPhone. On the simulator and in Xcode preview, the app runs fine. Previously, I had an issue with FlatList regarding props.getItem, which I solved by installing some missing Babel dependencies. After that, everything worked correctly in the simulator. But when I try to open the app on a real device, it shows the splash screen and crashes immediately. I've already done a full clean and reset, including: npx react-native start --reset-cache Deleted node_modules and Pods, reinstalled everything Cleaned build folder via Xcode Deleted DerivedData Restarted Metro bundler and simulator/device The issue only happens on the physical device. Here’s a portion of the crash log IDate/Time: 2025-04-14 19:11:28.6796 -0300 Launch Time: 2025-04-14 19:11:28.5292 -0300 OS Version: iPhone OS 18.3.2 (22D82) Release Type: User Baseband Version: 4.20.03 Report Version: 104 Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: SIGNAL 6 Abort trap: 6 Terminating Process: JazminChebar [1973] Triggered by Thread: 0 Last Exception Backtrace: 0 CoreFoundation 0x19a0865fc __exceptionPreprocess + 164 (NSException.m:249) 1 libobjc.A.dylib 0x197601244 objc_exception_throw + 88 (objc-exception.mm:356) 2 JazminChebar 0x1009b2c04 RCTFatal + 568 (RCTAssert.m:147) 3 JazminChebar 0x1009c81f8 __28-[RCTCxxBridge handleError:]_block_invoke + 532 (RCTCxxBridge.mm:1178) 4 libdispatch.dylib 0x1a1e19248 _dispatch_call_block_and_release + 32 (init.c:1549) 5 libdispatch.dylib 0x1a1e1afa8 _dispatch_client_callout + 20 (object.m:576) 6 libdispatch.dylib 0x1a1e29a34 _dispatch_main_queue_drain + 984 (queue.c:8093) 7 libdispatch.dylib 0x1a1e2964c _dispatch_main_queue_callback_4CF + 44 (queue.c:8253) 8 CoreFoundation 0x19a0d2bcc CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 16 (CFRunLoop.c:1793) 9 CoreFoundation 0x19a0cf1c0 __CFRunLoopRun + 1996 (CFRunLoop.c:3163) 10 CoreFoundation 0x19a121284 CFRunLoopRunSpecific + 588 (CFRunLoop.c:3434) 11 GraphicsServices 0x1e73914c0 GSEventRunModal + 164 (GSEvent.c:2196) 12 UIKitCore 0x19cc6a674 -[UIApplication _run] + 816 (UIApplication.m:3846) 13 UIKitCore 0x19c890e88 UIApplicationMain + 340 (UIApplication.m:5503) 14 JazminChebar 0x100178708 main + 80 (main.m:7) 15 dyld 0x1c037dde8 start + 2724 (dyldMain.cpp:1338)
0
0
65
Apr ’25
The location coming out of geocoder in CLPlacemark has altitude 0, differently of the input CLLocation
When I execute: geoCoder.reverseGeocodeLocation(location, completionHandler:{[weak self](placemarks, error) in print("reverse geocoding location after altitude: ",location.altitude) print("placemark location first", placemarks?.first?.location?.altitude ?? -1) The input CLLocation has correct altitude 25, instead the location in the output placemarks have altitude 0, when of course they should have the same location. Moreover it is impossible to retrofit any data in the returned placemarks as they are portrayed as a read only property.
0
0
56
Apr ’25
Breakpoint on Runtime Issue os_log_fault_default_callback
The app stops on the breakpoint when "All Runtime Issues" is added. If I disable the breakpoint, the app runs normally. Is there a new project setting to avoid this breakpoint from being set. It does not appear to be a valid error. I am running Xcode 16.2. I edited the "Type" field in the breakpoint box. This occurs with the "System Frameworks" option only.
0
2
97
Apr ’25
WatchOS Xcode 16.4 to sample live RR intervals from the PPG sensor ERROR
Hi, I am getting an error stating "Argument passed to call that takes no arguments". I want this Apple Watch App to measure and store RR Intervals from the PPG sensor on the Apple Watch for Heart Rate Variability calculations. Please help me fix this, I can't figure it out. Here is my code: heartbeatQuery = HKHeartbeatSeriesQuery(predicate: predicate, dataReceivedHandler: { (query, timeSinceLastBeat, ended, error) in // Switch to main thread for UI updates DispatchQueue.main.async { if let error = error { print("Heartbeat query error: (error.localizedDescription)") self.fetchErrorMessage = "Heartbeat query error: (error.localizedDescription)" // Consider stopping the workout session if the query fails critically // self.stopWorkoutSession() return } if ended { print("Heartbeat query indicates series ended.") } // Append valid RR intervals if timeSinceLastBeat > 0 { self.rrIntervals.append(timeSinceLastBeat) self.beatCount += 1 } } // End DispatchQueue.main.async }) // End query data handler // --- END OF PROBLEMATIC INITIALIZER --- // Execute the query if it was created successfully It recommends the fix as removing this part: '(predicate: predicate, dataReceivedHandler: { (query, timeSinceLastBeat, ended, error) in // Switch to main thread for UI updates DispatchQueue.main.async { if let error = error { print("Heartbeat query error: (error.localizedDescription)") self.fetchErrorMessage = "Heartbeat query error: (error.localizedDescription)" // Consider stopping the workout session if the query fails critically // self.stopWorkoutSession() return } if ended { print("Heartbeat query indicates series ended.") } // Append valid RR intervals if timeSinceLastBeat > 0 { self.rrIntervals.append(timeSinceLastBeat) self.beatCount += 1 } } // End DispatchQueue.main.async })' But after I remove that it says "Cannot assign value of type 'HKHeartbeatSeriesQuery.Type' to type 'HKHeartbeatSeriesQuery'" PLEASE HELP ME Thanks
0
0
97
Apr ’25
Distribution and Apple TV Question
Hi, This maybe somewhat confusing, but please bear with me. I currently have an app in the App Store that supports iOS and tvOS. But the tvOS version was a separate app during the development process. I'd like to combine the iOS and tvOS app into one project so its easier to handle and keep track of internally. Can I upload the new Apple TV version to the same place where the current one is, or would I have to delete the current Apple TV version before uploading the newly combined version? I hope I made that clear enough :-) Thank you, Dan Uff
0
0
74
Apr ’25
Custom font not support in Xcode 16.3
I'm experiencing an issue with a custom font not loading properly in Xcode 16.3. The font files are included in the bundle, listed in Info.plist, and verified for correct names using UIFont.familyNames, but they still don't appear at runtime. Has anyone else run into this with Xcode 16.3? Could this be related to recent changes in asset packaging or font catalogs?
0
0
88
Apr ’25
new rsync version not working as expected
after upgrade macos version to 15.4 the rsync start failing that cause the xcodebuild fail and not generate ipa rsync: on remote machine: --extended-attributes: unknown option rsync error: syntax or usage error (code 1) at main.c(1802) [server=3.4.1] rsync(73444): error: unexpected end of file rsync(73444): error: io_read_nonblocking rsync(73444): error: io_read_buf rsync(73444): error: io_read_int rsync(73444): warning: child 73445 exited with status 1
0
0
213
Apr ’25
watchOS-Questions about HealthKit privileges
The WatchOS developer is not allowed to obtain healthKit permission status. The result is always unauthorized (either by clicking the dot/cross in the upper left corner or by turning on all Health, on some, off all). WatchOS 开发获取 healthKit 的权限状态authorizationStatus不准。结果始终都是未授权(无论是点击左上角的点叉号还是开启全部健康项开关,开启部分,关闭所有),怎么处理?
0
0
60
Apr ’25
Unity (IL2CPP) iOS Build: "_placeGeoAnchor" Undefined Symbol for Architecture arm64
Hi all, I’m running into a persistent linker error when building my Unity 6 project (IL2CPP, iOS target) that calls a Swift method via an Objective-C++ wrapper. Despite following all known steps, I keep getting: Undefined symbols for architecture arm64: "_placeGeoAnchor", referenced from: _GeoAnchorTrigger_placeGeoAnchor in libGameAssembly.a ... ld: symbol(s) not found for architecture arm64 I’m trying to place a persistent AR anchor at real-world GPS coordinates (so that the same asset can appear at the same location for a returning user). Since I’m targeting iOS, I can’t use Google’s geospatial anchors (but I sooo wish I could--please apple I beg of you stop being so selfish lol). I've already done these things: Swift file is added to Unity-iPhone target. .mm and .h files are in Unity-iPhone target under Compile Sources. Bridging header is set to Unity-iPhone-Bridging-Header.h. Generated header name is correct (GeoTest-Swift.h). Build Active Architecture Only set to No. Function has attribute((visibility("default"))). Unity project uses IL2CPP scripting backend. Yet I'm still getting the same linker error — it appears Unity (via IL2CPP) references the function, but Xcode doesn't link it. It’s something small that’s being missed with how IL2CPP links native symbols? Or maybe I need to explicitly include something in Link Binary With Libraries? I’ve verified symbol visibility and targets repeatedly. I’ve built AR features in Unity before (for Quest), but this is my first time trying to bridge C# → Objective-C++ → Swift in this way for a geolocation-based AR anchor for an iphone. I'm going crazy, I’ve been stuck on this for 12+ hours now, so any insight or nudge would be deeply appreciated. SPECS: Macbook Pro M4 Pro--Sequoia 15.4 Unity 6000.0.45f1 IPhone 11 iOS 18.4 Xcode 15
0
0
155
Apr ’25
Is it possible to set the Derived Data location differently for different projects?
Within Xcode's settings location section is a drop down menu to switch between setting the derived data location to be default, relative or custom. However its a global setting. I work on more than one project simultaneously, and for one of them I want the location set to relative, but default for all the others. Is there any way of achieving that?
0
0
78
Apr ’25
iOS app build error with iOS 18 SDK and Xcode 16
Hi, I am able to build my iOS app successfully, developed in objective-C with iOS 17.5 SDK and Xcode 15. Due to requirement of Appstore we are trying to build with iOS 18 SDK and Xcode 16. When building getting error in LAEnvironmentState.h file: a) "Property requires field to be named" b) "Expected member name or ';' after declaration specifiers" Same app when opening with Xcode 15 gets build without any issue. Any help/suggestion would be appreciated.
0
0
144
Apr ’25
devicectl: clarify username requirement for "certain" domains
Hi there, When using devicectl to manage files: It's unclear for which domains the username should be provided It's unclear how to determine the username Listing files USAGE: devicectl device info files [<options>] --device <uuid|ecid|serial_number|udid|name|dns_name> --domain-type <domain-type> FILE OPTIONS: --username <username> The username of the user we should target. Only relevant for certain domains. --domain-type <domain-type> The file service domain. Valid values are: temporary, appDataContainer, appGroupDataContainer, systemCrashLogs. You must specify a valid domain and identifier pair. Certain domains must be accompanied by an identifier that provides additional context. For example, if the domain is an app data container, the identifier is the bundle ID of the app. For temporary directories, the identifier is a unique client-provided string which is used to get your own space, separate from those of other clients. --domain-identifier <domain-identifier> A unique string used to provide additional context to the domain. --username The username of the user we should target. Only relevant for certain domains. In the domains, the username requirements are not mentioned. Copying files USAGE: devicectl device copy to --device <uuid|ecid|serial_number|udid|name|dns_name> --source <source> [--destination <destination>] [--user <user>] --domain-type <domain-type> [--domain-identifier <domain-identifier>] [--remove-existing-content <remove-existing-content>] [--verbose] [--quiet] [--timeout <seconds>] [--json-output <path>] [--log-output <path>] DEVICE OPTIONS: -d, --device <uuid|ecid|serial_number|udid|name|dns_name> The identifier, ECID, serial number, UDID, user-provided name, or DNS name of the device. FILE OPTIONS: --source <source> The item which should be copied. --destination <destination> The location to which the item should be copied. -u, --user <user> The name of the user we should target. Only relevant for certain domains. --domain-type <domain-type> The file service domain. Valid values are: temporary, appDataContainer, appGroupDataContainer, systemCrashLogs. You must specify a valid domain and identifier pair. Certain domains must be accompanied by an identifier that provides additional context. For example, if the domain is an app data container, the identifier is the bundle ID of the app. For temporary directories, the identifier is a unique client-provided string which is used to get your own space, separate from those of other clients. --domain-identifier <domain-identifier> A unique string used to provide additional context to the -u, --user The name of the user we should target. Only relevant for certain domains. The "certain domains" are not specified. user vs username The list files command takes: --username <username> The username of the user we should target. Only relevant for certain domains The copy command takes: -u, --user <user> The name of the user we should target. Only relevant for certain domains. Is there a difference between username and user? How do we figure out the user or username? From https://developer.apple.com/forums/thread/749649 I learned that about the "mobile" value, but why, and how? It would help if these arguments could be explained in more detail.
0
0
83
Apr ’25