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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

Xcode 16 Beta 2 Simulator Issue
I had Xcode 16 Beta 1 installed and working. Installed Xcode 16 beta 2 (16A5171r) and now it is unable to download the simulator for that version. Downloading iOS 18.0 Simulator (22A5297f): Preparing to download...2024-06-25 14:21:27.456 xcodebuild[88553:5158819] DVTDownloadable: Download Failed. Downloadable: { authentication = none; category = simulator; contentType = cryptexDiskImage; dictionaryVersion = 2; downloadMethod = mobileAsset; fileSize = 8254433558; identifier = "com.apple.dmg.iPhoneSimulatorSDK18_0_b2"; isInternalContent = 0; isUserInitiated = 1; name = "iOS 18.0 Simulator (22A5297f)"; platform = "com.apple.platform.iphoneos"; simulatorVersion = { buildUpdate = 22A5297f; version = "18.0"; }; version = "18.0.0.2"; }. Download failed. Downloading iOS 18.0 Simulator (22A5297f): Error: Error Domain=DVTDownloadableErrorDomain Code=41 "Download failed." UserInfo={NSLocalizedDescription=Download failed., NSUnderlyingError=0x600001f075c0 {Error Domain=DVTDownloadsUtilitiesErrorDomain Code=-1 "Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({ RequestedBuild = 22A5297f; })" UserInfo={NSLocalizedDescription=Failed fetching catalog for assetType (com.apple.MobileAsset.iOSSimulatorRuntime), serverParameters ({ RequestedBuild = 22A5297f; }), NSUnderlyingError=0x6000031fe3a0 {Error Domain=com.apple.MobileAssetError.Download Code=18 "Download from live asset server could not get an asset matching the requested one. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime)" UserInfo={tryAgainLater=true, NSLocalizedDescription=Download from live asset server could not get an asset matching the requested one. (Catalog download for com.apple.MobileAsset.iOSSimulatorRuntime), pallasNoPMVMatchFound=true}}}}}
3
0
277
3w
How to attach to Privileged Helper as root?
We have a Privileged Helper tool that we install with SMJobBless. I would like to debug it. I've added WaitForDebugger in our helper tool launchd plist and it does wait. But I can't attach to it via Debug->Attach to Process in Xcode with error: Code: 3 Failure Reason: tried to attach to process as user 'myusername' and process is running as user 'root' I set Debug process as: root in scheme settings. But I'm not sure if it does anything since I'm not running this particular scheme at the moment of attach. I tried unsuccessfully to set "Wait for the executable to be launched" but I had to create a new scheme for it since helper is built as part of the main app so maybe I did something wrong. Am I doing something wrong or is it not possible to attach to root process?
1
0
205
3w
Not able to deploy apps to simulator using XCode 15.0 and 15.4
I am getting error after XCode build completes in the simulator. Not able to install app in any simulator. Getting a popup with title LLDB provided no error string. and on tapping more details getting below error Domain: IDEDebugSessionErrorDomain Code: 3 Failure Reason: LLDB provided no error string. User Info: { DVTErrorCreationDateKey = "2024-06-24 09:28:54 +0000"; DVTRadarComponentKey = 855031; IDERunOperationFailingWorker = DBGLLDBLauncher; RawUnderlyingErrorMessage = "LLDB provided no error string."; } -- Could not launch <AppName> Domain: IDEDebugSessionErrorDomain Code: 3 Failure Reason: LLDB provided no error string. User Info: { DVTRadarComponentKey = 855031; IDERunOperationFailingWorker = DBGLLDBLauncher; RawUnderlyingErrorMessage = "LLDB provided no error string."; } -- Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_model" = "iPhone14,6"; "device_osBuild" = "17.5 (21F79)"; "device_platform" = "com.apple.platform.iphonesimulator"; "dvt_coredevice_version" = "355.28"; "dvt_mobiledevice_version" = "1643.100.60"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 7177; "operation_errorCode" = 3; "operation_errorDomain" = IDEDebugSessionErrorDomain; "operation_errorWorker" = DBGLLDBLauncher; "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.iphonesimulator"; "param_diag_MainThreadChecker_stopOnIssue" = 0; "param_diag_MallocStackLogging_enableDuringAttach" = 0; "param_diag_MallocStackLogging_enableForXPC" = 1; "param_diag_allowLocationSimulation" = 1; "param_diag_checker_tpc_enable" = 0; "param_diag_gpu_frameCapture_enable" = 0; "param_diag_gpu_shaderValidation_enable" = 0; "param_diag_gpu_validation_enable" = 0; "param_diag_memoryGraphOnResourceException" = 0; "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_stopOnIssue" = 0; "param_diag_showNonLocalizedStrings" = 0; "param_diag_viewDebugging_enabled" = 1; "param_diag_viewDebugging_insertDylibOnLaunch" = 1; "param_install_style" = 0; "param_launcher_UID" = 2; "param_launcher_allowDeviceSensorReplayData" = 0; "param_launcher_kind" = 0; "param_launcher_style" = 0; "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" = "iphonesimulator17.5"; "sdk_osVersion" = "17.5"; "sdk_variant" = iphonesimulator; } -- System Information macOS Version 14.4.1 (Build 23E224) Xcode 15.4 (22622) (Build 15F31d) Timestamp: 2024-06-24T14:58:54+05:30
1
0
144
3w
Xcode won't symbolicate .ips crash log
I was my understanding that you're supposed to be able to open a .ips crash log in Xcode and see pretty much what you would see if the app had been running in the debugger when it crashed. But the addresses in my app don't get symbolicated. I opened the .ips in the same project and same version of Xcode that was used to create the app. The .dSym file is around, and I can use it to symbolicate using the atos tool. What am I missing?
2
0
227
3w
LaunchServices Error -10669
I'm trying to run a MacOS application (which has worked in the past on older versions of Xcode and MacOS), and I get the error message: Could not launch "MyProgramName" LaunchServices has returned error -10669. Can't find any documentation on this error code. Sonoma 14.4.1 Xcode 15.4
0
0
79
3w
Xcode 14 failed to prepare iOS 15.7 device?
An update to Xcode 14 appeared in the Mac App store today 2022-11-12. After updating Xcode from the App store app on my M1 MacBook, and plugging in an iPad, also updated today 2022-11-12 to iOS 15.7, Xcode says: "Failed to prepare the device for development". A restart of both the Mac and the iPad doesn't fix this issue. Is there a way to get Xcode 14 to debug an 15.7 iPad? Or is a different build required? There also is no 15.7 directory inside Xcode's iPhoneOS DeviceSupport directory.
43
34
22k
Sep ’22
Previews doesn't work in package target's subdirectory
I'm trying to preview a view from a swift package which is located in one of the target's directory subdirectories: . ├── Package.swift ├── README.md └── Sources 		└── SatelitUI 				└── Views 						└── MenuBar.swift When I'm previewing a view from the MenuBar.swift file I'm getting following error: NoBuildableEntriesError: active scheme does not build this file Select a scheme that builds a target which contains the current file, or add this file to a target that is built by the current scheme. Which is unexpected because the file should be a part of the SatelitUI target. The thing is it works just fine if I move it into the root target's directory (SatelitUI).
9
0
3.6k
Jun ’20
Xcode 16 Beta constantly crashing
Hey, I updated to the macOS beta 15 and downloaded Xcode 16. For a while it was working - then I tried to open a project, and Xcode crashed. From that point on I am unable to open any project with Xcode. I can't even create new apps - its crashing when trying to do that. I can't open the organiser, or anything. Does anyone know how to make full Xcode reset? I already deleted the DerivedData, deleted and downloaded the Xcode app but to no avail. The crash stack looks like that: Exception Type: EXC_CRASH (SIGABRT) Exception Codes: 0x0000000000000000, 0x0000000000000000 Termination Reason: Namespace SIGNAL, Code 6 Abort trap: 6 Terminating Process: Xcode [96603] Application Specific Information: abort() called Application Specific Signatures: ((accountCredentials)) != nil Thread 0 Crashed: 0 libsystem_kernel.dylib 0x18662d5e0 __pthread_kill + 8 1 libsystem_pthread.dylib 0x186665f70 pthread_kill + 288 2 libsystem_c.dylib 0x186572908 abort + 128 3 IDEKit 0x109fd2810 +[IDEAssertionHandler _handleAssertionWithLogString:assertionSignature:assertionReason:extraBacktrace:] + 968 4 IDEKit 0x109fd2c50 -[IDEAssertionHandler handleFailureInMethod:object:fileName:lineNumber:assertionSignature:messageFormat:arguments:] + 872 5 DVTFoundation 0x10630af24 _DVTAssertionHandler + 424 6 DVTFoundation 0x10630b0a4 _DVTAssertionFailureHandler + 196 7 DVTFoundation 0x1063242e0 +[DVTAppleIDBasedDeveloperAccount accountWithCredentials:] + 240 8 DVTFoundation 0x106323210 +[DVTDeveloperAccount accountWithUsername:alternateDSID:token:] + 388 9 DVTFoundation 0x1062acffc -[DVTDeveloperAccountManager _accountsByCreatingFromDefaults] + 772 10 DVTFoundation 0x1062ada8c __41-[DVTDeveloperAccountManager allAccounts]_block_invoke + 40 11 libdispatch.dylib 0x1864b36d8 _dispatch_client_callout + 20 12 libdispatch.dylib 0x1864c2d30 _dispatch_lane_barrier_sync_invoke_and_complete + 56 13 DVTFoundation 0x10634b7c4 DVTDispatchBarrierSync + 148 14 DVTFoundation 0x106327190 -[DVTDispatchLock performLockedBlock:] + 60 15 DVTFoundation 0x1062ad9fc -[DVTDeveloperAccountManager allAccounts] + 124 16 DVTFoundation 0x1062ad948 -[DVTDeveloperAccountManager loadAccountsWithCallback:] + 44 17 XcodeCloudKit 0x11b84669c DeveloperAccountObserver.startObserving() + 464 18 XcodeCloudKit 0x11b758f50 Session.startEffects<A>(workspace:) + 660 19 XcodeCloud 0x1138c52bc closure #1 in static ToolbarItemProvider.item(forItemIdentifier:forToolbarIn:) + 72 20 XcodeCloud 0x1138c47bd partial apply for specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1 21 XcodeCloud 0x1138c6b2d specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1 22 XcodeCloud 0x1138c47bd partial apply for specialized thunk for @escaping @callee_guaranteed @Sendable @async () -> (@out A) + 1 23 libswift_Concurrency.dylib 0x25dd69921 completeTaskWithClosure(swift::AsyncContext*, swift::SwiftError*) + 1 }
0
3
184
3w
Mergeable Library: Symbol Not Found Runtime Crash
I have an iOS app target with a framework dependency and want to merge that framework by setting MERGED_BINARY_TYPE to automatic in the app target's build settings. It all works fine until I add a (non-private) UIHostingController to the framework target. When I do this it crashes on startup with this message: dyld[15894]: Symbol not found: _OBJC_CLASS_$__TtC5Frame4MyVC. Xcode 15.1b3 Reported as bug via Feedback Assistant: FB13379276
3
1
615
Nov ’23
Compiling the JPEG-XL reference for iOS, or, "Is compiling C++ for iOS really this difficult!?"
I'm trying to add JPEG-XL encoding/decoding capabilities to my app and haven't been able to find a trustworthy pre-compiled version. The only one I've found is in https://github.com/awxkee/jxl-coder-swift. As a result I've been trying to compile my own iOS version from the reference implementation (https://github.com/libjxl/libjxl), having done virtually no compiling before. When I started out, my gut said, "Compiling for a different platform should be easy since it's not like I'm actually writing or modifying the implementation", but the more I research and try, the more doubtful I've become. So far I've figured out it means compiling all the dependencies (brotli, highway, libpng, skcms, etc.) too, but I've also gotten nowhere with them, having tried my hand at modifying cmake toolchains and CMakeList.txt files. As a novice, am I biting off more than I can chew with this? Is the seemingly simple task, "Compile this C++ library for iOS" actually something that freelancers charge huge amounts for? (If so, this makes the free compiled version mentioned above even more questionable) Any help or pointers would be greatly appreciated.
5
0
287
4w
How to use frameworks with the same name for different scheme
So I have 2 schemes: prod and staging. And both have their own Debug and Release configuration settings (one of which is the bundle ID, eg. prod-Release: com.mycomp.myApp, prod-Debug: com.myComp.myApp.debug, staging-Release: com.myComp.myApp.staging.debug, staging-Debug: com.myComp.myApp.staging.debug). Now, there is a framework that is bound to each bundle ID. The framework is not from a So I need 4 instances of the same framework for each bundle ID. I tried separating the frameworks into folders and just link them whenever I need to run the appropriate scheme. Basically like so: \{PROJECT_ROOT}\Frameworks\MyFramework\prod-Debug\MyFramework.xcframework \{PROJECT_ROOT}\Frameworks\MyFramework\prod-Release\MyFramework.xcframework \{PROJECT_ROOT}\Frameworks\MyFramework\staging-Debug\MyFramework.xcframework \{PROJECT_ROOT}\Frameworks\MyFramework\staging-Release\MyFramework.xcframework I've added a Run script to create the link before Compile Sources step like so: cd "${SRCROOT}/zDefend" if [ "${CONFIGURATION}" = "prod-Debug" ]; then rm -rf ./MyFramework.xcframework ln -s ./prod-Debug/MyFramework.xcframework MyFramework.xcframework elif [ "${CONFIGURATION}" = "prod-Release" ]; then rm -rf ./MyFramework.xcframework ln -s ./prod-Release/MyFramework.xcframework/ MyFramework.xcframework elif [ "${CONFIGURATION}" = "staging-Debug" ]; then rm -rf ./MyFramework.xcframework ln -s ./staging-Debug/MyFramework.xcframework MyFramework.xcframework elif [ "${CONFIGURATION}" = "staging-Release" ]; then rm -rf ./MyFramework.xcframework ln -s ./staging-Release/MyFramework.xcframework/ MyFramework.xcframework fi I only have 1 target, myApp. But in the Build Settings, I set it so that every configurations will create 4 different binaries with 4 different bundle ID like I've mentioned above. I've added the framework by its link and set it to "Embed and Sign". The framework itself is not from Cocoapods, Carthage or SwiftPM. We just need to compile it ourselves into 4 and bind them with their own bundle ID in the code. Then we manually added them into the project. It will throw error if the app's bundle ID is not the same with the bundle ID bound to the framework. This can be compiled just fine. But when in created 2 or more binaries in the simulator, it crashes. So this is possibly a linking issue. How do I solve this? Thank you.
0
0
189
3w
App Intent snippet view does't able to fetch color for xcassets.
We have an existing app in which we have implemented AppShortcuts. The snippet view works fine in iOS 17 while in iOS18 beta, it doesn't able to fetch color from xcassets. If we use system colours or UIColor it's working fine. Not working Color("progressColor") Working Color(uiColor: UIColor(named: "progressColor")!) Color.red Color(hex: "3881d3") // Note: We created Color extension to generate color from hex string.
0
0
163
3w
Issues with SwiftData @Relationships in Swift Testing
Is it a known issue that when attempting to test SwiftData objects with relationships in Swift Testing there are errors that do not occur when the app is running? Example: @Relationship(deleteRule: .cascade, inverse: \MBAccount.book) var accounts: [MBAccount] = [] and @Relationship var book: Microbook? Then the test: let book = Microbook(name: "Julia's Cupcakes") let account1 = MBAccount(name: "Chase Business Account") let account2 = MBAccount(name: "Cash Drawer") account1.book = book account2.book = book #expect(account1.name == "Chase Business Account") #expect(account2.type == "asset") } Produces a fatal error while running test: SwiftData/PersistentModel.swift:321: Fatal error: Unable to find relationship on MBAccount for KeyPath \MBAccount.book Any ideas?
1
0
187
4w
iOS 18 Simulator poor performance
I installed Xcode 16 beta on Sonoma 14.5 and tried to run my app on the simulator, but it's practically impossible to use. It's extremely slow and unresponsive. After doing some research, I noticed that launching any application causes the simulator to flood the system with logs. This triggers the diagnosticd process, which increases memory and CPU usage, worsening over time. The memory usage peaked at 10GB before I decided to close the simulator. Has anyone else experienced this issue? Is there any solution for this?
5
8
667
Jun ’24
Xcode rebuilds entire project when nothing has changed
Using Xcode 15.3 on a Mac M1 with MacOS 14.5. The project consists of C++, ObjC and Swift source files. CocoaPods is used for several libraries. CMake is used to generate the build files etc.. The issue is that any time I attempt to run the application (on any iOS device), it will always rebuild from scratch, which takes a considerable amount of time for this very large project. This occurs without any changes to the project; no source code changes, no resource file changes, nothing at all. Would anyone have any idea as to why this would be happening? Is there any diagnostic information I can enable in Xcode to show me exactly what changes it has detected, or what reason it may have for doing a full rebuild?
0
0
86
3w