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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Created

Setting Installation Directory correctly is a mystery
Hello I'm wrapping my head around on how to properly set up xcode project to produce a static library ending up in file locations /usr/local/lib/libXXX.a and /usr/local/include/XXX/xxx.h so it can be used Unix style in other projects. If I put under Deployment Deployment Location: YES Installation Build Products Location: / Installation Directory: /usr/local/lib Skip Install: NO I get errors like warning: Stale file '/usr/local/usr/local/include/xxx.h' is located outside of the allowed root paths. and things like error: Cycle inside a single target; building could produce unreliable results. Installation Build Products Location: /usr/local/lib Installation Directory: / I get warning: Stale file '/usr/local/include/xxx.h' is located outside of the allowed root paths. but the library file is not put into /usr/local/lib (note /usr/local/lib and /usr/local/include are owned by my user and writeable) I could write an old style Makefile and have xcode call the makefile but there must be an easier way to do this. This is for a cross platform development so having it packaged into a Framework would not solve it neither.
1
0
45
2w
Xcode 26.1.1 React Native build fails: “Could not delete ios/build” & “Operation not permitted”
I’m building a React Native 0.72.10 iOS app and hitting build errors. Environment: macOS: Apple M4, Sequoia 15.7.2 Xcode: 26.1.1 React Native: 0.72.10 Errors: Could not delete /Users/.../ios/build because it was not created by the build system Unable to write file '/Users/.../ios/build/Pods.build/Debug-iphonesimulator/...': Operation not permitted (Multiple Pods / React Native framework headers affected) What I’ve tried: bash rm -rf ios/build rm -rf ~/Library/Developer/Xcode/DerivedData xattr -w com.apple.xcode.CreatedByBuildSystem true ios/build pod deintegrate && pod install sudo chown -R $(whoami) ios/build Observations: ios/build is recreated automatically. Some files have com.apple.xcode.CreatedByBuildSystem: true. 3.Xcode have Full disk access authorisation. Why does Xcode fail to delete / write to ios/build even though it’s recreated automatically by the build system? Is this caused by Xcode itself, macOS permissions? Any recommended fix or workaround for these “Operation not permitted” errors?
1
0
121
2w
LLVM Linker Crash on ARM64 with bfloat16 Symbols (Xcode 17.0.0)
LLVM Linker Crash on ARM64 with bfloat16 Symbols (Xcode 17.0.0) We're encountering a critical linker crash in Xcode 17.0.0 (clang-1700.4.4.1) on macOS 15.1.0 (Darwin 25.1.0) with Apple Silicon M3 Max when linking a pybind11 C++ extension against the MLX framework (v0.30.1). The linker consistently crashes with LLVM ERROR: No way to correctly truncate anything but float to bfloat during the linking phase, even though our code uses only integer types (int64, uint32) for BPE tokenization and never directly references bfloat16 types. Error Details: [100%] Linking CXX shared module _metal_trainer.cpython-312-darwin.so LLVM ERROR: No way to correctly truncate anything but float to bfloat clang++: error: unable to execute command: Abort trap: 6 clang++: error: linker command failed due to signal (use -v to see invocation) Reproduction: Install MLX framework: pip install mlx (any version with bfloat16 support) Create a minimal pybind11 extension that links against MLX: Compiler: AppleClang 17.0.0.17000404 Target: arm64-apple-darwin25.1.0 Flags: -std=c++17 -O2 -march=native Link against: libmlx.dylib (contains bfloat16 symbols) Run: cmake .. && make Linker crashes during final linking phase Root Cause: The LLVM ARM64 backend in Xcode 17.0.0 has a code generation bug when processing bfloat16 truncation operations during link-time. The crash occurs when the linker processes bfloat16 symbols from libmlx.dylib, regardless of whether the application code uses them. The error originates from LLVM's type legalization pass attempting to truncate bfloat16 values, but the ARM64 backend lacks a valid code path for this operation. Workarounds Attempted (all failed): Disabling LTO: INTERPROCEDURAL_OPTIMIZATION FALSE Linker flags: -Wl,-no_compact_unwind, -fno-lto Runtime symbol resolution: -undefined dynamic_lookup Compiler optimizations: Changed from -O3 to -O2 Impact: This blocks any C++ extension development that links against libraries containing bfloat16 symbols on Xcode 17.0.0. The issue does not occur on Xcode 16.x. Linker Crash Dump Location: /var/folders/gn/7_g6wy1j66b8z3lkywyrbsx00000gn/T/linker-crash-* Expected Behavior: Linker should successfully link the extension, or at minimum, gracefully handle bfloat16 symbols without crashing. Temporary Solution: Downgrade to Xcode 16.x or use Python-only implementations until this is fixed in a future Xcode release.
1
0
85
3w
Xcode won't run my app; it runs fine from Finder.
I'm developing in Objective C with Xcode on a Mac exclusively to run on Mac and all of a sudden when I try to run I get the message: "a build only device cannot be used to run this target". If I go to the destination folder, the newly built app is there and runs from Finder, I just can't get it to run from within Xcode, which is inconvenient for testing. What setting am I missing or has changed? Up to now I could build and run with no problem.
1
0
76
3w
Am I supposed to be able to do iOS development with 16GB of RAM?
I have a small, simple iOS project that doesn't use a lot of memory or libraries or anything. If I open my iOS project in XCode and run it on the iPhone 17 simulator, my memory consumption (as seen in Activity Monitor) goes into the yellow zone. Granted, I have some other apps open (Safari, Mail, Messages, the usual stuff that people run) but nothing especially demanding. Without XCode and the Simulator running, my memory consumption is only around 25% on the Activity Monitor graph. Is this expected behavior with Tahoe and iOS 26? I was able to work on my project without running out of RAM on this same computer for the past 4 years no problem. Now it seems I have a problem.
0
0
140
3w
Local Swift Package does not update in my project
in my xcode project, i created a new package by going through File > New > Package, just like they said in https://developer.apple.com/documentation/xcode/organizing-your-code-with-local-packages I have a package, but the problem is, whenever I made any changes in the package's source code, it never showed in the main project. I can import the package just fine, but the package does not show anything. no added apis, functions, nothing. Im using Xcode 26.0.1
0
0
35
3w
Can new Xcode build unsupported deployment target IPA?
In the official explanation, "deployment targets" refers to "the OS range supported by this version of Xcode for uploading apps to App Store Connect." On the Xcode Support page (https://developer.apple.com/support/xcode/), I can find the deployment targets supported by each Xcode version. My question is: can I use a newer version of Xcode to build an IPA with an older deployment target that isn’t listed? For example, can I use Xcode 26 to build an iOS 12 IPA (just build, not debug)? In my opinion, since the new SDKs still contain many old macros restricted to earlier iOS versions, it should be possible, but I’m not sure if that’s correct. Thanks.
1
0
74
3w
When xcode is tried again, it always fails to install the app
When xcode is installed on a mobile phone, the first run always fails. The second run usually works normally.The certificate signatures have been checked and all are normal。This problem will also occur if you stop the running xcode and then run it again。please help me. Mac mini:Apple M2 Pro mas os 15.2 (24C101) Xcode: Version 16.2 (16C5032a) The first failed print is as follows: 无法安装“xxx” Domain: IXUserPresentableErrorDomain Code: 14 Recovery Suggestion: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.uRA3Gt/extracted/Payload/xxx.app : 0xe8008001 (An unknown error has occurred.) User Info: { DVTErrorCreationDateKey = "2025-11-20 02:50:17 +0000"; IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker; } Failed to install the app on the device. Domain: com.apple.dt.CoreDeviceError Code: 3002 User Info: { NSURL = "file:///Users/shenchunxing/Library/Developer/Xcode/DerivedData/VideoGo-dwhfrhswidapcydbmfuamplrtvso/Build/Products/Debug-iphoneos/xxx.app"; } 无法安装“xxx” Domain: IXUserPresentableErrorDomain Code: 14 Failure Reason: 无法安装此App,因为无法验证其完整性。 Recovery Suggestion: Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.uRA3Gt/extracted/Payload/xxx.app : 0xe8008001 (An unknown error has occurred.) Failed to verify code signature of /var/installd/Library/Caches/com.apple.mobile.installd.staging/temp.uRA3Gt/extracted/Payload/xxx.app : 0xe8008001 (An unknown error has occurred.) Domain: MIInstallerErrorDomain Code: 13 User Info: { FunctionName = "+[MICodeSigningVerifier _validateSignatureAndCopyInfoForURL:withOptions:error:]"; LegacyErrorString = ApplicationVerificationFailed; LibMISErrorNumber = "-402620415"; SourceFileLine = 79; } Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_identifier" = "00008120-0009758221C2201E"; "device_isCoreDevice" = 1; "device_model" = "iPhone15,4"; "device_osBuild" = "18.2 (22C152)"; "device_platform" = "com.apple.platform.iphoneos"; "device_thinningType" = "iPhone15,4"; "dvt_coredevice_version" = "397.28"; "dvt_coresimulator_version" = "993.7"; "dvt_mobiledevice_version" = "1759.60.7"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 13228; "operation_errorCode" = 14; "operation_errorDomain" = IXUserPresentableErrorDomain; "operation_errorWorker" = IDEInstallCoreDeviceWorker; "operation_name" = IDERunOperationWorkerGroup; "param_debugger_attachToExtensions" = 0; "param_debugger_attachToXPC" = 1; "param_debugger_type" = 3; "param_destination_isProxy" = 0; "param_destination_platform" = "com.apple.platform.iphoneos"; "param_diag_113575882_enable" = 0; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_checker_tpc_enable" = 1; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_guardMalloc_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "param_diag_mtc_enable" = 1; "param_diag_queueDebugging_enable" = 1; "param_diag_runtimeProfile_generate" = 0; "param_diag_sanitizer_asan_enable" = 0; "param_diag_sanitizer_tsan_enable" = 0; "param_diag_sanitizer_tsan_stopOnIssue" = 0; "param_diag_sanitizer_ubsan_enable" = 0; "param_diag_sanitizer_ubsan_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 2; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 99; "param_launcher_substyle" = 0; "param_runnable_appExtensionHostRunMode" = 0; "param_runnable_productType" = "com.apple.product-type.application"; "param_structuredConsoleMode" = 1; "param_testing_launchedForTesting" = 0; "param_testing_suppressSimulatorApp" = 0; "param_testing_usingCLI" = 0; "sdk_canonicalName" = "iphoneos18.2"; "sdk_osVersion" = "18.2"; "sdk_variant" = iphoneos; }
1
0
102
3w
Xcode Cloud, Bitbucket
Hello, While setting up Xcode Cloud using Bitbucket, I encountered an issue with Source Control and providing access to the repository. The problem most likely stems from the fact that Bitbucket has updated its policy, and the use of app passwords is no longer available (at least for new ones). However, in Xcode → Settings → Source Control, the login flow still requires an app password, which makes it impossible to authenticate using the new API tokens. Attempting to authenticate via SSH also does not resolve the issue. After connecting to GitHub, I also tried to connect through the web version, but I'm getting the same message: "Bitbucket Cloud installation was incomplete." I received this same message when I first tried to connect through Xcode. This problem does not occur when connecting to GitHub. I would appreciate receiving feedback from the Apple team on this issue. System Info: Xcode: 16.2 (latest from App Store) macOS: Sequoia 15.1
1
0
133
3w
Xcode Organizer is blowing up
An error occurred preventing Xcode from downloading version information from App Store Connect for account "xxxxxxxx". An unexpected error occurred: [<__NSDictionaryM 0x600003ed4fe0> valueForUndefinedKey:]: this class is not key value coding-compliant for the <app name! 5.00.12 (iOS App). I have no idea what the hell is causing this. I have checked all of the links between screens and objects and none are missing. This is a live active version on the store.
0
0
69
3w
Standalone Watch App Woes
Hello I have developed a standalone app for watchOS - trying my best to use best practices and floowing the (limited)documentation. But here I am, unable to distribute - or even Validate - my apps archive in Xcode. As far as I can tell, bundle_id's are correct. It has an iOS wrapper (set up by New Project), Skip install has been tried in every combination. I'm at a loss. I'm sure there is some simple setting or workflow that I am missing, but I've been at it for days. Yes. Days. Has anyone recently created and successfully distributed a standalone watch app that could help me troubleshoot? I would be extremely appreciative. My kids would too. They miss their dad (just one 5 more minutes, I think I got it!)(I didn't get it) Thank you bob
1
0
51
3w
Live Activity Shows Only Black Dynamic Island UI (No Content Rendering) — Widget Extension Receives Updates but SwiftUI UI Is Empty
Hi all, very new "developer" trying to build my own app. The app works, just trying to improve it. I’m implementing a Live Activity in a widget extension (Swift/SwiftUI) for an app built with Flutter as the host app. ActivityKit is functioning correctly—activities start, update, and end normally, and the widget extension receives all state updates. However, the Live Activity UI renders as a completely black capsule (both compact and expanded Dynamic Island, as well as the Lock Screen presentation). The system shows the Live Activity container, but none of the SwiftUI content displays. Verified so far: ActivityAttributes contains at least one stored property (previously empty). ContentState fully Codable + Hashable. All Dynamic Island regions return visible test UI (Text/Image). No .containerBackground() usage. Added explicit .activityBackgroundTint() + system foreground colors. All Swift files included in widget extension target. No runtime errors, no decode failures, no SwiftUI logs. Widget previews work. Clean build, app reinstall, device reboot. Entitlements and Info.plist appear valid. Problem: The widget extension returns a completely black UI on-device, despite valid SwiftUI content in ActivityConfiguration. The Live Activity “shell” renders, so the activity is recognized, but the widget’s view hierarchy is visually empty. Question: Under what conditions would a widget extension produce a black, empty UI for a Live Activity even when ActivityKit, previews, and the SwiftUI layout are correct? Are there known cases where: Widget extension Info.plist misconfiguration, Incorrect background/tint handling, Rendering issues in Dynamic Island, Host app integrations (Flutter), Or extension isolation issues cause valid SwiftUI to fail to render in a Live Activity? Any guidance on deeper debugging steps or known system pitfalls would be appreciated.
3
0
102
3w
xcodebuild archive fail
Archive failing while executing command: xcodebuild -project Unity-VisionOS.xcodeproj -scheme Unity-VisionOS -destination generic/platform=xros archive -archivePath Unity-VisionOS.xcarchive -quiet > logs/visionos_archive.log Next error happens: 2025-11-18 15:33:12.161 ibtoold[56062:4395005] [MT] IBPlatformTool: *** Failed to launch tool with description <IBVisionPlatformToolDescription: 0x600003278380> System content for IBCocoaTouchFramework-seventeenAndLater <IBScaleFactorDeviceTypeDescription: 0x600003278400> scaleFactor=2x, renderMode.identifier=(null): Failed to find or create execution context for description '<IBVisionPlatformToolDescription: 0x600003278380> System content for IBCocoaTouchFramework-seventeenAndLater <IBScaleFactorDeviceTypeDescription: 0x600003278400> scaleFactor=2x, renderMode.identifier=(null)'. Device type: IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x) Sim runtime: visionOS 2.1 (2.1 - 22N580) - com.apple.CoreSimulator.SimRuntime.xrOS-2-1 Device: (null) ** Please also include the output of `xcrun simctl diagnose` and `xcode-select -p`.: Failed to find a suitable device for the type IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x) with runtime visionOS 2.1 (2.1 - 22N580) - com.apple.CoreSimulator.SimRuntime.xrOS-2-1 (Failure reason: Failed to create new simulator device in set SimDeviceSet : /Users/user/Library/Developer/Xcode/UserData/IB Support/Simulator Devices that matches IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x) for runtime visionOS 2.1 (2.1 - 22N580) - com.apple.CoreSimulator.SimRuntime.xrOS-2-1 (Incompatible device). Available devices: ( "IBSimDeviceTypeiPad3x (D1B76A51-0DB5-439F-B65D-891AB20C2B26, iOS 18.1, Shutdown)", "IBSimDeviceTypeiPad2x (CA17569D-D3EA-4B11-A20D-3571D4A5E58A, iOS 18.1, Shutdown)", "IBSimDeviceTypeiPad2x (E3EE1BC6-2F2F-48D3-A378-A819824F7082, iOS 18.1, Shutdown)" )): Incompatible device /* com.apple.ibtool.document.warnings */ /Users/xcode_dir_path/xcode/LaunchScreen-iPhone.storyboard:global: warning: Compiling Interface Builder products for visionOS will not be supported in a future version of Xcode. [9] /* com.apple.ibtool.errors */ /Users/xcode_dir_path/LaunchScreen-iPhone.storyboard: error: Failed to find or create execution context for description '<IBVisionPlatformToolDescription: 0x600003278380> System content for IBCocoaTouchFramework-seventeenAndLater <IBScaleFactorDeviceTypeDescription: 0x600003278400> scaleFactor=2x, renderMode.identifier=(null)'. Device type: IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x) Sim runtime: visionOS 2.1 (2.1 - 22N580) - com.apple.CoreSimulator.SimRuntime.xrOS-2-1 Device: (null) ** Please also include the output of `xcrun simctl diagnose` and `xcode-select -p`. Underlying Errors: Description: Failed to find a suitable device for the type IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x) with runtime visionOS 2.1 (2.1 - 22N580) - com.apple.CoreSimulator.SimRuntime.xrOS-2-1 Failure Reason: Failed to create new simulator device in set SimDeviceSet : /Users/user/Library/Developer/Xcode/UserData/IB Support/Simulator Devices that matches IBSimDeviceTypeiPad2x (com.apple.dt.Xcode.IBSimDeviceType.iPad-2x) for runtime visionOS 2.1 (2.1 - 22N580) - com.apple.CoreSimulator.SimRuntime.xrOS-2-1 (Incompatible device). Available devices: ( "IBSimDeviceTypeiPad3x (D1B76A51-0DB5-439F-B65D-891AB20C2B26, iOS 18.1, Shutdown)", "IBSimDeviceTypeiPad2x (CA17569D-D3EA-4B11-A20D-3571D4A5E58A, iOS 18.1, Shutdown)", "IBSimDeviceTypeiPad2x (E3EE1BC6-2F2F-48D3-A378-A819824F7082, iOS 18.1, Shutdown)" ) Underlying Errors: Description: Incompatible device It appears when command was executed from TeamCity. And when it launches manually from console, it works fine. I tried reinstalling SDK, switching different Xcode versions, removing cache, clearing IB folder, nothing helps. xcrun simctl list command prints next: == Device Types == iPhone 17 Pro (com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro) iPhone 17 Pro Max (com.apple.CoreSimulator.SimDeviceType.iPhone-17-Pro-Max) iPhone Air (com.apple.CoreSimulator.SimDeviceType.iPhone-Air) iPhone 17 (com.apple.CoreSimulator.SimDeviceType.iPhone-17) iPhone 16 Pro (com.apple.CoreSimulator.SimDeviceType.iPhone-16-Pro) iPhone 16 Pro Max (com.apple.CoreSimulator.SimDeviceType.iPhone-16-Pro-Max) iPhone 16e (com.apple.CoreSimulator.SimDeviceType.iPhone-16e) iPhone 16 (com.apple.CoreSimulator.SimDeviceType.iPhone-16) iPhone 16 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-16-Plus) iPhone 15 Pro (com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro) iPhone 15 Pro Max (com.apple.CoreSimulator.SimDeviceType.iPhone-15-Pro-Max) iPhone 15 (com.apple.CoreSimulator.SimDeviceType.iPhone-15) iPhone 15 Plus (com.apple.CoreSimulator.SimDeviceType.iPhone-15-Plus) iPhone 14 Pro (com.apple.CoreSimulator.SimDeviceType.iPhone-14-Pro) ... Apple Vision Pro (com.apple.CoreSimulator.SimDeviceType.Apple-Vision-Pro-4K) Apple Vision Pro (com.apple.CoreSimulator.SimDeviceType.Apple-Vision-Pro) iPod touch (7th generation) (com.apple.CoreSimulator.SimDeviceType.iPod-touch--7th-generation-) == Runtimes == iOS 18.1 (18.1 - 22B81) - com.apple.CoreSimulator.SimRuntime.iOS-18-1 iOS 18.6 (18.6 - 22G86) - com.apple.CoreSimulator.SimRuntime.iOS-18-6 visionOS 2.1 (2.1 - 22N580) - com.apple.CoreSimulator.SimRuntime.xrOS-2-1 == Devices == -- iOS 18.1 -- iPhone 16 Pro (78683AE0-6238-4EF1-BD47-192FC0DC2559) (Shutdown) iPhone 16 Pro Max (98BFE915-787D-4673-991A-5D3EC448CC51) (Shutdown) iPhone 16 (D3E6FED8-9E65-4141-A31C-FC7EA3492111) (Shutdown) ... iPad mini (A17 Pro) (10F1862E-E27B-42C5-9B02-1FA71D2F4707) (Shutdown) iPad (10th generation) (E6E0D31F-91E4-4D3E-898D-516D79DDD58E) (Shutdown) -- visionOS 2.1 -- Apple Vision Pro (E4D22A75-A38E-4135-9152-EF4D64BEC3F2) (Shutdown)
0
0
79
3w
Failed to generate code coverage report on iPhone
Failed to generate code coverage report when doing Swift Testing on iPhone device, but it's ok in UI testing or running on "My Mac(Designed for iPad)". I have enable code coverage in test plan. My app can't run on simulator due to frameworks limitations. Platform: Mac mini M2 w/ macOS15.7, iPhoneXR 18.6.2 Xcode version: 26.1 & 16.0 error msg: Failed to download profiles from paths ["/private/var/mobile/Containers/Data/Application/76A1F9BC-98C8-4349-998B-0FC030DEE3EC/tmp/3A424286-872D-40AD-B4CA-65B232B57EB4"] on device 'iPhoneXR' for application with bundle ID 'xxx.xxxx.xxxx' to directory /Users//Library/Developer/Xcode/DerivedData/-bosqsqmqiqwweldrfrtgsfpnhroht/Build/ProfileData/00008020-00042C2A3E38002E: Failed to retrieve the file node for tmp/3A424286-872D-40AD-B4CA-65B232B57EB4. (Underlying Error: Failed to retrieve the file node for tmp/3A424286-872D-40AD-B4CA-65B232B57EB4)
0
0
64
3w