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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Created

Updated Deeplink is not working
Hello, We are facing deeplink related issue for our production app. In our finding, we got to know that issue is related to apple CDN caching, We have did the changes at our server level but still it is navigating to previous URL. Earlier deeplink was "https://bobcard.bobfinancial.com/dl" now it is changed to "https://linkdeep.bobcard.co.in/mapp". Please check and update this new one in apple cdn cache. For the new link it is redirecting to App store instead of App. Below are the link through which we have tested deeplink scenario: "https://app-site-association.cdn-apple.com/a/v1/bobcard.bobfinancial.com" working fine. "https://app-site-association.cdn-apple.com/a/v1/linkdeep.bobcard.co.in" it is throwing not found error.
1
0
90
Apr ’25
XCODE Preview: XOJITError: Could not create code file directory for session: Permission denied
I keep running into the following issue when trying to run preview for my application in Xcode. FailedToLaunchAppError: Failed to launch app.a /Users/me/Library/Developer/Xcode/DerivedData/a-aloudjuytoewlldqjfxshbjydjeh/Build/Products/Debug/a.app ================================== | [Remote] JITError | | ================================== | | | [Remote] XOJITError | | | | XOJITError: Could not create code file directory for session: Permission denied`
3
0
202
Apr ’25
Cannot run apps that use the callAsyncJavaScript() method on older simulators
If I use the method callAsyncJavaScript() my app will compile, but it won't run on older simulators. Specifically, in a brand new Storyboard project, I added this to `viewDidLoad(): let webView = WKWebView() webView.callAsyncJavaScript("1", in: nil, in: .page) { result in print("\(result)") } This runs fine with Xcode 16.3 targeting the iOS 18.4 simulator. It doesn't work if I target the iOS 18.3.1 simulator or the iOS 17.5 simulator. It does work on an iPhone 15 Pro running iOS 18.4 and it works on an iPhone 12 Pro running iOS 17.7.1. It goes without saying that this used to work on Xcode 16.2 and earlier, since my real project has been using that API for 3 or 4 years now. The specific error is dyld[89984]: Symbol not found: _$sSo9WKWebViewC6WebKitE19callAsyncJavaScript_9arguments2inAF17completionHandlerySS_SDySSypGSo11WKFrameInfoCSgSo14WKContentWorldCys6ResultOyyps5Error_pGcSgtF Referenced from: <82CC68A8-9426-343E-82CD-5443F53A6919> /Users/dave/Library/Developer/CoreSimulator/Devices/69CE58A3-8162-4616-B110-5857E6E2889F/data/Containers/Bundle/Application/3F27AAA0-8E96-437D-A1F4-DECD2E1A95B5/CallAsyncJavascript.app/CallAsyncJavascript.debug.dylib Expected in: <E11EC0F5-2AD1-3402-AB03-31A85EA6EB3A> /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/WebKit.framework/WebKit
4
3
258
Apr ’25
xcode
Hello, I am trying to take a computing class. I have a macbook air running big sur (I cannot update it past that). I was told for the class that Big Sur would be sufficient. It appears that I don't have xcode however and I need it on my computer. I cannot find any version to download from Apple besides the newest- which isn't compatible with Big Sur. I have found some older versions online but I don't know what to trust. I was told I could download it here but am not finding it. I think I need one of the versions in the 11s Please help!
2
0
46
Apr ’25
Cannot debug app-extension-safe frameworks in main app
The code in my app is split into frameworks that I can use both from my main app and its app extensions. In order to use the frameworks inside the app extension, I need to build them with the Xcode build setting Require Only App-Extension-Safe API set to Yes. When I do that, debugging framework code in my main app no longer works properly. I can set a breakpoint, but any attempt to print a value via p or po will give a set of errors like the following: error: module file /Users/.../Library/Developer/Xcode/DerivedData/...-daqfgouagvlkudfebrmzrurogmld/Build/Intermediates.noindex/SwiftExplicitPrecompiledModules/_errno-B8I5WSZMM09RXHYLYEWSC1BLE.pcm cannot be loaded due to a configuration mismatch with the current compilation error: Objective-C App Extension was enabled in PCH file but is currently disabled How do I fix this?
1
0
209
Apr ’25
Xcode 16.3/macOS SDK 15.4: C++ features that required minimum target of 13.3 now require 13.4
C++ code that compiled fine on Xcode 16.2 when targeting macOS 13.3 after upgrading to Xcode 16.3 gives an error that the minimum required target is macOS 13.4 with an error like: `/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/usr/include/c++/v1/__format/formatter_floating_point.h:74:30: error: 'to_chars' is unavailable: introduced in macOS 13.4 unknown 74 | to_chars_result __r = std::to_chars(__first, __last, __value, __fmt, __precision); Here’s example taken directly from (https://en.cppreference.com/w/cpp/utility/format/format): #include <format> #include <iostream> #include <string> #include <string_view> template<typename... Args> std::string dyna_print(std::string_view rt_fmt_str, Args&&... args) { return std::vformat(rt_fmt_str, std::make_format_args(args...)); } int main() { std::cout << std::format("Hello {}!\n", "world"); std::string fmt; for (int i{}; i != 3; ++i) { fmt += "{} "; // constructs the formatting string std::cout << fmt << " : "; std::cout << dyna_print(fmt, "alpha", 'Z', 3.14, "unused"); std::cout << '\n'; } } It doesn’t make any sense to suddenly require targeting 13.4 for features that worked fine on 13.3. The Apple documentation for C++ feature support explicitly discusses 13.3. https://developer.apple.com/xcode/cpp/ (search for P0067R5 on the page) I haven't tested it, but based on the standard library headers the minimum required iOS version has also been bumped - from 16.3 to 16.5. Am I doing something wrong? Is there a known work-around? Filed feedback: FB17081499
3
2
555
Apr ’25
Error with App Shortcut phrase: A single phrase can only use a single parameter
After installing the latest version of Xcode (16.3, 16E140), I get many instances of this error when building my app: Error: Multiple parameters detected in phrase. A single phrase can only use a single parameter. Here is an example of an App Shortcut that is causing this error: AppShortcut( intent: SelectModelIntent(), phrases: [ "Select \(\.$model) in \(.applicationName)", ], shortTitle: LocalizedStringResource("Select Model", comment: "Title for Shortcut"), systemImageName: "rectangle.3.group" ) If I replace the application name parameter with a hard-coded string, I get an error that says I need to have the application name parameter in each phrase. So is it not possible to have any other parameters in a phrase besides the application name? That seems unlikely to me.
4
0
212
Apr ’25
Xcode 16.3 repeatedly log causing CPU leak
Xcode 16.3 repeatedly logs a same message very frequently, as fast as a single thread can. I use Instruments and Console and find out the log is: Needs flush! by -[DNTBrotliDecoder decodeBytes:length:] in DNTDocumentationSupport. The call is on a single non-main thread. I've tried to clear caches and it seems doesn't change. Yet I don't know exact point when the logging starts since launch. Fortunately, this thread is dispatched at E cores, bringing approximately 2 watts of power load to my Mac. Environments: macOS 15.4 (24E248) Xcode 16.3 (16E140) M4 chip
7
3
397
Apr ’25
Xcode 16.3 missing the CoreSimulator DeviceTypes?
Hi folks, was there an unannounced breaking change in Xcode 16.3 regarding the device types, e.g. "iPhone 16 Pro.simdevicetype"? We consume Xcode simulators viaa CLI that uses it and the absence of it broke the complete setup. We are filing a bug report in parallel, but maybe someone is experiencing something related and may see a workaround. Thanks to everyone!
2
0
175
Apr ’25
The Source Editor Contextual Menu Is Missing Copy Submenu
I updated to Xcode Version 16.3 (16E140) on macOS Sequoia 15.3.2 (24D81). I noticed the contextual menu is missing the Copy submenu. This submenu is accessible from the Main Menu under Edit menu. You can see that the contextual menu is missing the Copy submenu, it was there prior to Xcode Version 16.3 (16E140). Why was it removed? Could this Copy submenu be restored in future updates, please?
1
0
98
Apr ’25
Xcode 16 - Timeout while connecting to remote device.
Hi, I'm using XCode 16 to connect my iPhone. Recently I'm getting an error as below while connecting to Xcode to install the app Timeout while connecting to remote device. Domain: com.apple.mobiledevice Code: -402652910 User Info: { DVTErrorCreationDateKey = "2025-04-02 15:03:29 +0000"; FunctionName = "_AMDeviceCreateWithRemoteDeviceWithError"; IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker; LineNumber = 334; } System Information macOS Version 15.3.2 (Build 24D81) Xcode 16.2 (23507) (Build 16C5032a) Is there any way we can connect iOS 18 devices through USB only?
4
0
212
Apr ’25
Xcode 16.3 / macOS 15.4: SwiftData ModelContainer 在关联 iCloud Container 后初始化时崩溃
问题描述: 环境: Xcode 版本: 16.3 *macOS 版本: 15.4 项目类型: SwiftUI App with SwiftData 问题摘要: 当在 Xcode 项目的 "Signing & Capabilities" 中为启用了 iCloud 能力的应用关联一个具体的 iCloud Container 时,即使代码中并未显式启用 CloudKit 同步(例如,未在 ModelConfiguration 中设置 cloudKitDatabase),SwiftData 的 ModelContainer 在应用启动初始化时也会立即失败并导致崩溃。如果仅启用 iCloud 能力但不选择任何 Container,应用可以正常启动。此问题在使用空的 Schema([]) 进行测试时依然稳定复现。 复现步骤 (使用最小复现项目 - MRE): 使用 Xcode 16.3 创建一个新的 SwiftUI App 项目 (例如,命名为 CloudKitCrashTest)。 在创建时不要勾选 "Host in CloudKit",或者,如果勾选了,先确保后续步骤覆盖相关设置。Storage 选择 None 或 SwiftData 均可复现。 修改 CloudKitCrashTestApp.swift 文件,添加 SwiftData 导入和基本的 ModelContainer 初始化逻辑。关键代码如下: import SwiftUI import SwiftData @main struct CloudKitCrashTestApp: App { let sharedModelContainer: ModelContainer init() { // 使用空 Schema 进行诊断 let schema = Schema([]) // *不* 指定 cloudKitDatabase let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false) do { sharedModelContainer = try ModelContainer(for: schema, configurations: [modelConfiguration]) print("ModelContainer created successfully.") } catch { // 在关联 Container 后,会在此处崩溃 fatalError("Could not create ModelContainer: \(error)") } } var body: some Scene { WindowGroup { ContentView() .modelContainer(sharedModelContainer) } } } // ... ContentView 定义 ... 进入项目的 Signing & Capabilities 标签页。 点击 + Capability 添加 iCloud。 在 iCloud 服务中,勾选 CloudKit。 此时,不要在 Containers 部分选择任何容器。 运行应用: 应用应该能够成功启动,并在控制台打印 "ModelContainer created successfully."。 停止应用。 回到 Signing & Capabilities -> iCloud -> Containers。 点击 + 添加一个新的自定义容器,或选择 Xcode 默认建议的容器。确保一个容器 ID 被明确选中。 再次运行应用: 应用现在会在启动时立即崩溃,fatalError 被触发。 预期结果: 即使在 Signing & Capabilities 中关联了 iCloud Container,应用也应该能够成功初始化 ModelContainer(尤其是当代码中未使用 cloudKitDatabase 或使用空 Schema 时),不应崩溃。 实际结果: 应用在 ModelContainer 初始化时崩溃,抛出 fatalError,错误信息为: Could not create ModelContainer: SwiftDataError(_error: SwiftData.SwiftDataError._Error.loadIssueModelContainer, _explanation: nil) 补充说明: 此问题在 iPhone 模拟器上稳定复现。 尝试清理构建文件夹 (Clean Build Folder)、删除派生数据 (Derived Data) 未能解决问题。 使用 Xcode 模板创建项目(勾选 "Host in CloudKit")并在之后手动取消选择 Container 可以运行,但一旦重新选择 Container 就会崩溃,现象一致。 这表明问题与 ModelContainer 初始化过程在检测到项目关联了具体 iCloud Container 标识符(可能涉及读取 .entitlements 文件或准备相关环境)时发生的内部错误有关,而不是由于实际的 CloudKit 同步代码或模型定义。 影响: 此 Bug 阻止了在当前的 Xcode 和 macOS 环境下开发和测试任何需要关联 iCloud Container 的 SwiftData 应用。
2
1
462
Apr ’25
Need Help Updating a Custom WireGuard SPM for Xcode 16 & Swift 6
Hey iOS Dev's, I’m currently working on a Swift Package Manager (SPM) for WireGuard, originally developed by a previous team member. It was working fine in Xcode 15.2, but after upgrading to Xcode 16 and Swift 6, I need to update the SPM to ensure compatibility with my base projects and other projects relying on it. With Apple making Xcode 16 mandatory for app submissions starting April 24, this has become an urgent issue. I’ve searched extensively but haven’t found a working solution yet. Has anyone faced similar challenges with Swift 6 migration and SPM updates? Any insights, best practices, or debugging tips would be greatly appreciated! Let’s connect and collaborate—I’d love to discuss possible solutions! 😊 #iOSDevelopment #Swift6 #Xcode16 #SPM #WireGuard #iOS #Swift #SoftwareEngineering #AppStore
0
0
112
Apr ’25
Xcode 16.3 Doesn't Remember Preview Pane Width
It seems like, by default, the preview pane tries to align to 50% of the editor pane's width. I prefer to shrink the preview pane to around ~30% of the screen so I have more space for code. This used to work fine—at least until I restarted Xcode. I never understood why the setting wouldn’t persist across sessions, but fine, that was a tradeoff I was willing to live with. However, with Xcode 16.3, it seems like Xcode forgets the manually adjusted preview pane width as soon as I switch to a different file. This has definitely impacted my productivity, as I now find myself readjusting the pane size dozens of times in a single session. Am I holding it wrong? Is anyone else experiencing this? And while we’re at it—why not make this a persistent setting so everyone can tweak the width to their liking?
10
8
430
Apr ’25
LLDB RPC Crash in Xcode Playgrounds
Hi, upgraded to Xcode Version 16.3 (16E140) today and now Playground can't execute JSON decoding. The code below is taken from Apple's own JSONDecoder example: struct GroceryProduct: Codable { var name: String var points: Int var description: String? } let json = """ { "name": "Durian", "points": 600, "description": "A fruit with a distinctive scent." } """.data(using: .utf8)! let decoder = JSONDecoder() let product = try decoder.decode(GroceryProduct.self, from: json) print(product.name) // Prints "Durian" This use to work in the previous Xcode version. Now I get this error: The LLDB RPC server has crashed. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. This file doesn't exist in the location. I've restarted Xcode and the Mac, same error. Any thoughts?
1
1
134
Apr ’25
Xcode and Supabase Package
Hi All, I'll start by saying i am complete beginner when it comes to coding/ developing. So please be easy on me, im also using AI tools to help and learn so apologies if what im saying doesnt make sense. The error im getting is /Services/SupabaseManager.swift:47:29 Cannot find 'GlobalOptions' in scope From AI tells me 'GlobalOptions' is defined a types.swift file in the supabase package public struct GlobalOptions: Sendable { /// Optional headers for initializing the client, it will be passed down to all sub-clients. public let headers: [String: String] /// A session to use for making requests, defaults to `URLSession.shared`. public let session: URLSession /// The logger to use across all Supabase sub-packages. public let logger: (any SupabaseLogger)? public init( headers: [String: String] = [:], session: URLSession = .shared, logger: (any SupabaseLogger)? = nil ) { self.headers = headers self.session = session self.logger = logger } } From what i can see i have added the supabase package successfully, following this guide - https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app Here are some screenshots of my xcode to show the added package.
3
0
167
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
94
Apr ’25
Updated Deeplink is not working
Hello, We are facing deeplink related issue for our production app. In our finding, we got to know that issue is related to apple CDN caching, We have did the changes at our server level but still it is navigating to previous URL. Earlier deeplink was "https://bobcard.bobfinancial.com/dl" now it is changed to "https://linkdeep.bobcard.co.in/mapp". Please check and update this new one in apple cdn cache. For the new link it is redirecting to App store instead of App. Below are the link through which we have tested deeplink scenario: "https://app-site-association.cdn-apple.com/a/v1/bobcard.bobfinancial.com" working fine. "https://app-site-association.cdn-apple.com/a/v1/linkdeep.bobcard.co.in" it is throwing not found error.
Replies
1
Boosts
0
Views
90
Activity
Apr ’25
Xcode 16.3 reports ARM Assembly code as explanation of a crash
crashlog.crash How do I understand this bug report ? It is ARM Assembly code with a crash of an iOS Library : libobjc.A.dylib. I do not know ARM Assembly code. This happens just after SceneDidDisconnect . If i put 'exit(0)' in SceneDidDisconnect , there is no crash. In the crash log we set that IOS trys to terminate my App but it can not.
Replies
2
Boosts
0
Views
210
Activity
Apr ’25
XCODE Preview: XOJITError: Could not create code file directory for session: Permission denied
I keep running into the following issue when trying to run preview for my application in Xcode. FailedToLaunchAppError: Failed to launch app.a /Users/me/Library/Developer/Xcode/DerivedData/a-aloudjuytoewlldqjfxshbjydjeh/Build/Products/Debug/a.app ================================== | [Remote] JITError | | ================================== | | | [Remote] XOJITError | | | | XOJITError: Could not create code file directory for session: Permission denied`
Replies
3
Boosts
0
Views
202
Activity
Apr ’25
Debug Memory Graph: Unable to build memory graph
Submitted feedback FB17075016 Xcode 16.3 release macOS 15.4 iOS 18.4 / iPadOS 18.4 release builds Memory graph fails to build when targeting physical devices running release builds referenced above. Memory graph will build against a simulator device.
Replies
6
Boosts
6
Views
585
Activity
Apr ’25
Cannot run apps that use the callAsyncJavaScript() method on older simulators
If I use the method callAsyncJavaScript() my app will compile, but it won't run on older simulators. Specifically, in a brand new Storyboard project, I added this to `viewDidLoad(): let webView = WKWebView() webView.callAsyncJavaScript("1", in: nil, in: .page) { result in print("\(result)") } This runs fine with Xcode 16.3 targeting the iOS 18.4 simulator. It doesn't work if I target the iOS 18.3.1 simulator or the iOS 17.5 simulator. It does work on an iPhone 15 Pro running iOS 18.4 and it works on an iPhone 12 Pro running iOS 17.7.1. It goes without saying that this used to work on Xcode 16.2 and earlier, since my real project has been using that API for 3 or 4 years now. The specific error is dyld[89984]: Symbol not found: _$sSo9WKWebViewC6WebKitE19callAsyncJavaScript_9arguments2inAF17completionHandlerySS_SDySSypGSo11WKFrameInfoCSgSo14WKContentWorldCys6ResultOyyps5Error_pGcSgtF Referenced from: <82CC68A8-9426-343E-82CD-5443F53A6919> /Users/dave/Library/Developer/CoreSimulator/Devices/69CE58A3-8162-4616-B110-5857E6E2889F/data/Containers/Bundle/Application/3F27AAA0-8E96-437D-A1F4-DECD2E1A95B5/CallAsyncJavascript.app/CallAsyncJavascript.debug.dylib Expected in: <E11EC0F5-2AD1-3402-AB03-31A85EA6EB3A> /Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/WebKit.framework/WebKit
Replies
4
Boosts
3
Views
258
Activity
Apr ’25
xcode
Hello, I am trying to take a computing class. I have a macbook air running big sur (I cannot update it past that). I was told for the class that Big Sur would be sufficient. It appears that I don't have xcode however and I need it on my computer. I cannot find any version to download from Apple besides the newest- which isn't compatible with Big Sur. I have found some older versions online but I don't know what to trust. I was told I could download it here but am not finding it. I think I need one of the versions in the 11s Please help!
Replies
2
Boosts
0
Views
46
Activity
Apr ’25
Cannot debug app-extension-safe frameworks in main app
The code in my app is split into frameworks that I can use both from my main app and its app extensions. In order to use the frameworks inside the app extension, I need to build them with the Xcode build setting Require Only App-Extension-Safe API set to Yes. When I do that, debugging framework code in my main app no longer works properly. I can set a breakpoint, but any attempt to print a value via p or po will give a set of errors like the following: error: module file /Users/.../Library/Developer/Xcode/DerivedData/...-daqfgouagvlkudfebrmzrurogmld/Build/Intermediates.noindex/SwiftExplicitPrecompiledModules/_errno-B8I5WSZMM09RXHYLYEWSC1BLE.pcm cannot be loaded due to a configuration mismatch with the current compilation error: Objective-C App Extension was enabled in PCH file but is currently disabled How do I fix this?
Replies
1
Boosts
0
Views
209
Activity
Apr ’25
Xcode 16.3/macOS SDK 15.4: C++ features that required minimum target of 13.3 now require 13.4
C++ code that compiled fine on Xcode 16.2 when targeting macOS 13.3 after upgrading to Xcode 16.3 gives an error that the minimum required target is macOS 13.4 with an error like: `/Applications/Xcode-16.3.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX15.4.sdk/usr/include/c++/v1/__format/formatter_floating_point.h:74:30: error: 'to_chars' is unavailable: introduced in macOS 13.4 unknown 74 | to_chars_result __r = std::to_chars(__first, __last, __value, __fmt, __precision); Here’s example taken directly from (https://en.cppreference.com/w/cpp/utility/format/format): #include <format> #include <iostream> #include <string> #include <string_view> template<typename... Args> std::string dyna_print(std::string_view rt_fmt_str, Args&&... args) { return std::vformat(rt_fmt_str, std::make_format_args(args...)); } int main() { std::cout << std::format("Hello {}!\n", "world"); std::string fmt; for (int i{}; i != 3; ++i) { fmt += "{} "; // constructs the formatting string std::cout << fmt << " : "; std::cout << dyna_print(fmt, "alpha", 'Z', 3.14, "unused"); std::cout << '\n'; } } It doesn’t make any sense to suddenly require targeting 13.4 for features that worked fine on 13.3. The Apple documentation for C++ feature support explicitly discusses 13.3. https://developer.apple.com/xcode/cpp/ (search for P0067R5 on the page) I haven't tested it, but based on the standard library headers the minimum required iOS version has also been bumped - from 16.3 to 16.5. Am I doing something wrong? Is there a known work-around? Filed feedback: FB17081499
Replies
3
Boosts
2
Views
555
Activity
Apr ’25
Error with App Shortcut phrase: A single phrase can only use a single parameter
After installing the latest version of Xcode (16.3, 16E140), I get many instances of this error when building my app: Error: Multiple parameters detected in phrase. A single phrase can only use a single parameter. Here is an example of an App Shortcut that is causing this error: AppShortcut( intent: SelectModelIntent(), phrases: [ "Select \(\.$model) in \(.applicationName)", ], shortTitle: LocalizedStringResource("Select Model", comment: "Title for Shortcut"), systemImageName: "rectangle.3.group" ) If I replace the application name parameter with a hard-coded string, I get an error that says I need to have the application name parameter in each phrase. So is it not possible to have any other parameters in a phrase besides the application name? That seems unlikely to me.
Replies
4
Boosts
0
Views
212
Activity
Apr ’25
Xcode 16.3 repeatedly log causing CPU leak
Xcode 16.3 repeatedly logs a same message very frequently, as fast as a single thread can. I use Instruments and Console and find out the log is: Needs flush! by -[DNTBrotliDecoder decodeBytes:length:] in DNTDocumentationSupport. The call is on a single non-main thread. I've tried to clear caches and it seems doesn't change. Yet I don't know exact point when the logging starts since launch. Fortunately, this thread is dispatched at E cores, bringing approximately 2 watts of power load to my Mac. Environments: macOS 15.4 (24E248) Xcode 16.3 (16E140) M4 chip
Replies
7
Boosts
3
Views
397
Activity
Apr ’25
Cannot find 'TARGET_OS_SIMULATOR' in scope
This code was compiling fine on Xcode 16.2 public var hasSecureHardware: Bool { let isSimulator = TARGET_OS_SIMULATOR == 1 return !isSimulator && isAvailable } However, now the build breaks with the message: Cannot find 'TARGET_OS_SIMULATOR' in scope
Replies
2
Boosts
1
Views
1.5k
Activity
Apr ’25
Xcode 16.3 missing the CoreSimulator DeviceTypes?
Hi folks, was there an unannounced breaking change in Xcode 16.3 regarding the device types, e.g. "iPhone 16 Pro.simdevicetype"? We consume Xcode simulators viaa CLI that uses it and the absence of it broke the complete setup. We are filing a bug report in parallel, but maybe someone is experiencing something related and may see a workaround. Thanks to everyone!
Replies
2
Boosts
0
Views
175
Activity
Apr ’25
The Source Editor Contextual Menu Is Missing Copy Submenu
I updated to Xcode Version 16.3 (16E140) on macOS Sequoia 15.3.2 (24D81). I noticed the contextual menu is missing the Copy submenu. This submenu is accessible from the Main Menu under Edit menu. You can see that the contextual menu is missing the Copy submenu, it was there prior to Xcode Version 16.3 (16E140). Why was it removed? Could this Copy submenu be restored in future updates, please?
Replies
1
Boosts
0
Views
98
Activity
Apr ’25
Xcode 16 - Timeout while connecting to remote device.
Hi, I'm using XCode 16 to connect my iPhone. Recently I'm getting an error as below while connecting to Xcode to install the app Timeout while connecting to remote device. Domain: com.apple.mobiledevice Code: -402652910 User Info: { DVTErrorCreationDateKey = "2025-04-02 15:03:29 +0000"; FunctionName = "_AMDeviceCreateWithRemoteDeviceWithError"; IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker; LineNumber = 334; } System Information macOS Version 15.3.2 (Build 24D81) Xcode 16.2 (23507) (Build 16C5032a) Is there any way we can connect iOS 18 devices through USB only?
Replies
4
Boosts
0
Views
212
Activity
Apr ’25
Xcode 16.3 / macOS 15.4: SwiftData ModelContainer 在关联 iCloud Container 后初始化时崩溃
问题描述: 环境: Xcode 版本: 16.3 *macOS 版本: 15.4 项目类型: SwiftUI App with SwiftData 问题摘要: 当在 Xcode 项目的 "Signing & Capabilities" 中为启用了 iCloud 能力的应用关联一个具体的 iCloud Container 时,即使代码中并未显式启用 CloudKit 同步(例如,未在 ModelConfiguration 中设置 cloudKitDatabase),SwiftData 的 ModelContainer 在应用启动初始化时也会立即失败并导致崩溃。如果仅启用 iCloud 能力但不选择任何 Container,应用可以正常启动。此问题在使用空的 Schema([]) 进行测试时依然稳定复现。 复现步骤 (使用最小复现项目 - MRE): 使用 Xcode 16.3 创建一个新的 SwiftUI App 项目 (例如,命名为 CloudKitCrashTest)。 在创建时不要勾选 "Host in CloudKit",或者,如果勾选了,先确保后续步骤覆盖相关设置。Storage 选择 None 或 SwiftData 均可复现。 修改 CloudKitCrashTestApp.swift 文件,添加 SwiftData 导入和基本的 ModelContainer 初始化逻辑。关键代码如下: import SwiftUI import SwiftData @main struct CloudKitCrashTestApp: App { let sharedModelContainer: ModelContainer init() { // 使用空 Schema 进行诊断 let schema = Schema([]) // *不* 指定 cloudKitDatabase let modelConfiguration = ModelConfiguration(schema: schema, isStoredInMemoryOnly: false) do { sharedModelContainer = try ModelContainer(for: schema, configurations: [modelConfiguration]) print("ModelContainer created successfully.") } catch { // 在关联 Container 后,会在此处崩溃 fatalError("Could not create ModelContainer: \(error)") } } var body: some Scene { WindowGroup { ContentView() .modelContainer(sharedModelContainer) } } } // ... ContentView 定义 ... 进入项目的 Signing & Capabilities 标签页。 点击 + Capability 添加 iCloud。 在 iCloud 服务中,勾选 CloudKit。 此时,不要在 Containers 部分选择任何容器。 运行应用: 应用应该能够成功启动,并在控制台打印 "ModelContainer created successfully."。 停止应用。 回到 Signing & Capabilities -> iCloud -> Containers。 点击 + 添加一个新的自定义容器,或选择 Xcode 默认建议的容器。确保一个容器 ID 被明确选中。 再次运行应用: 应用现在会在启动时立即崩溃,fatalError 被触发。 预期结果: 即使在 Signing & Capabilities 中关联了 iCloud Container,应用也应该能够成功初始化 ModelContainer(尤其是当代码中未使用 cloudKitDatabase 或使用空 Schema 时),不应崩溃。 实际结果: 应用在 ModelContainer 初始化时崩溃,抛出 fatalError,错误信息为: Could not create ModelContainer: SwiftDataError(_error: SwiftData.SwiftDataError._Error.loadIssueModelContainer, _explanation: nil) 补充说明: 此问题在 iPhone 模拟器上稳定复现。 尝试清理构建文件夹 (Clean Build Folder)、删除派生数据 (Derived Data) 未能解决问题。 使用 Xcode 模板创建项目(勾选 "Host in CloudKit")并在之后手动取消选择 Container 可以运行,但一旦重新选择 Container 就会崩溃,现象一致。 这表明问题与 ModelContainer 初始化过程在检测到项目关联了具体 iCloud Container 标识符(可能涉及读取 .entitlements 文件或准备相关环境)时发生的内部错误有关,而不是由于实际的 CloudKit 同步代码或模型定义。 影响: 此 Bug 阻止了在当前的 Xcode 和 macOS 环境下开发和测试任何需要关联 iCloud Container 的 SwiftData 应用。
Replies
2
Boosts
1
Views
462
Activity
Apr ’25
Need Help Updating a Custom WireGuard SPM for Xcode 16 & Swift 6
Hey iOS Dev's, I’m currently working on a Swift Package Manager (SPM) for WireGuard, originally developed by a previous team member. It was working fine in Xcode 15.2, but after upgrading to Xcode 16 and Swift 6, I need to update the SPM to ensure compatibility with my base projects and other projects relying on it. With Apple making Xcode 16 mandatory for app submissions starting April 24, this has become an urgent issue. I’ve searched extensively but haven’t found a working solution yet. Has anyone faced similar challenges with Swift 6 migration and SPM updates? Any insights, best practices, or debugging tips would be greatly appreciated! Let’s connect and collaborate—I’d love to discuss possible solutions! 😊 #iOSDevelopment #Swift6 #Xcode16 #SPM #WireGuard #iOS #Swift #SoftwareEngineering #AppStore
Replies
0
Boosts
0
Views
112
Activity
Apr ’25
Xcode 16.3 Doesn't Remember Preview Pane Width
It seems like, by default, the preview pane tries to align to 50% of the editor pane's width. I prefer to shrink the preview pane to around ~30% of the screen so I have more space for code. This used to work fine—at least until I restarted Xcode. I never understood why the setting wouldn’t persist across sessions, but fine, that was a tradeoff I was willing to live with. However, with Xcode 16.3, it seems like Xcode forgets the manually adjusted preview pane width as soon as I switch to a different file. This has definitely impacted my productivity, as I now find myself readjusting the pane size dozens of times in a single session. Am I holding it wrong? Is anyone else experiencing this? And while we’re at it—why not make this a persistent setting so everyone can tweak the width to their liking?
Replies
10
Boosts
8
Views
430
Activity
Apr ’25
LLDB RPC Crash in Xcode Playgrounds
Hi, upgraded to Xcode Version 16.3 (16E140) today and now Playground can't execute JSON decoding. The code below is taken from Apple's own JSONDecoder example: struct GroceryProduct: Codable { var name: String var points: Int var description: String? } let json = """ { "name": "Durian", "points": 600, "description": "A fruit with a distinctive scent." } """.data(using: .utf8)! let decoder = JSONDecoder() let product = try decoder.decode(GroceryProduct.self, from: json) print(product.name) // Prints "Durian" This use to work in the previous Xcode version. Now I get this error: The LLDB RPC server has crashed. The crash log is located in ~/Library/Logs/DiagnosticReports and has a prefix 'lldb-rpc-server'. This file doesn't exist in the location. I've restarted Xcode and the Mac, same error. Any thoughts?
Replies
1
Boosts
1
Views
134
Activity
Apr ’25
Xcode and Supabase Package
Hi All, I'll start by saying i am complete beginner when it comes to coding/ developing. So please be easy on me, im also using AI tools to help and learn so apologies if what im saying doesnt make sense. The error im getting is /Services/SupabaseManager.swift:47:29 Cannot find 'GlobalOptions' in scope From AI tells me 'GlobalOptions' is defined a types.swift file in the supabase package public struct GlobalOptions: Sendable { /// Optional headers for initializing the client, it will be passed down to all sub-clients. public let headers: [String: String] /// A session to use for making requests, defaults to `URLSession.shared`. public let session: URLSession /// The logger to use across all Supabase sub-packages. public let logger: (any SupabaseLogger)? public init( headers: [String: String] = [:], session: URLSession = .shared, logger: (any SupabaseLogger)? = nil ) { self.headers = headers self.session = session self.logger = logger } } From what i can see i have added the supabase package successfully, following this guide - https://developer.apple.com/documentation/xcode/adding-package-dependencies-to-your-app Here are some screenshots of my xcode to show the added package.
Replies
3
Boosts
0
Views
167
Activity
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?
Replies
0
Boosts
0
Views
94
Activity
Apr ’25