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

Xcode Documentation

Posts under Xcode subtopic

Post

Replies

Boosts

Views

Activity

Does the iOS simulator append any different HTTPs headers to an iPhone?
I've got a bit of code which is making a HTTPS GET request. On an iPhone it runs as expected, however when running on the simulator there's a HTTP 400 response. I've logged the url and my http headers that I'm adding, and in both cases they are identical for the simulator and iPhone (there is no http body content). Therefore, as everything is identical, I'm wondering how it could work with hardware and not with the simulator? Does the OS append any additional HTTP headers before the request goes out (such as User-Agent for example) and might those be different between iPhone/simulator?
0
0
397
Oct ’24
The developer disk image could not be mounted on this device - Xcode 16.0 - iPhone 16 Pro Max - iOS 18.0.1
I recently purchased an iPhone 16 Pro Max. I updated my phone, Mac OS, and Xcode to the latest versions. I have an Xcode project that builds and runs normally on my old device. However, on my iPhone 16 Pro Max I receive the following error: " The developer disk image could not be mounted on this device. Error mounting image: 0xe800010f (kAMDMobileImageMounterPersonalizedBundleMissingVariantError: The bundle image is missing the requested variant for this device.) " Details: Domain: com.apple.dt.CoreDeviceError Code: 12040 Failure Reason: Error mounting image: 0xe800010f (kAMDMobileImageMounterPersonalizedBundleMissingVariantError: The bundle image is missing the requested variant for this device.) User Info: { DDIPath = "/Library/Developer/DeveloperDiskImages/iOS_DDI.dmg"; DVTErrorCreationDateKey = "2024-10-04 21:29:15 +0000"; DeviceIdentifier = "6D41E9F7-8052-4B8B-A38E-99A187E14574"; IDERunOperationFailingWorker = IDEInstallCoreDeviceWorker; NSURL = "file:///Library/Developer/DeveloperDiskImages/iOS_DDI.dmg"; Options = { MountedBundlePath = "file:///private/var/tmp/CoreDevice_DDI_Staging_502/6D41E9F7-8052-4B8B-A38E-99A187E14574/"; UseCredentials = 0; }; "com.apple.dt.DVTCoreDevice.operationName" = enablePersonalizedDDI; } -- Error mounting image: 0xe800010f (kAMDMobileImageMounterPersonalizedBundleMissingVariantError: The bundle image is missing the requested variant for this device.) Domain: com.apple.mobiledevice Code: -402652913 User Info: { FunctionName = AMDeviceRemoteMountPersonalizedBundle; LineNumber = 2145; } -- Failed to initialize image properties: 0xe800010f (kAMDMobileImageMounterPersonalizedBundleMissingVariantError: The bundle image is missing the requested variant for this device.) Domain: com.apple.mobiledevice Code: -402652913 User Info: { FunctionName = "-[PersonalizedImage mountImage:]"; LineNumber = 1816; } -- Failed to find image for variant/identity: (variant: DeveloperDiskImage | boardID: 14 | chipID: 33088 | securityDomain: 1). Domain: com.apple.mobiledevice Code: -402652913 User Info: { FunctionName = "-[PersonalizedImage initializeImageProperties:]"; LineNumber = 1063; } -- Event Metadata: com.apple.dt.IDERunOperationWorkerFinished : { "device_identifier" = "00008140-0008254A0093C01C"; "device_isCoreDevice" = 1; "device_model" = "iPhone17,2"; "device_osBuild" = "18.0.1 (22A3370)"; "device_platform" = "com.apple.platform.iphoneos"; "device_thinningType" = "iPhone17,2"; "dvt_coredevice_version" = "397.21"; "dvt_coresimulator_version" = 987; "dvt_mobiledevice_version" = "1759.2.1"; "launchSession_schemeCommand" = Run; "launchSession_state" = 1; "launchSession_targetArch" = arm64; "operation_duration_ms" = 102196; "operation_errorCode" = "-402652913"; "operation_errorDomain" = "com.apple.dt.CoreDeviceError.12040.com.apple.mobiledevice"; "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.0"; "sdk_osVersion" = "18.0"; "sdk_variant" = iphoneos; } -- System Information macOS Version 15.0.1 (Build 24A348) Xcode 16.0 (23051) (Build 16A242d) Timestamp: 2024-10-04T14:29:15-07:00 I have reinstalled Xcode, restarted my MacBook, and restarted my iPhone. Not sure how to resolve this issue; any guidance would be greatly appreciated.
1
1
7.1k
Oct ’24
IOS app fails to build on Xcode 16 RC but had no issues on Xcode 15
Xcode 16 RC refuses to recognise my iPhone 13 mini running IOS 18 as a device and won’t compile onto it. Using the exact same setup I can compile onto my iPad running IOS 17.5. Xcode used to compile onto it (Xcode 15.x and iphone on IOS 17.x). My iphone is a known device in my developer account. I have switched on ‘Developer Mode’ in the iPhone Settings and rebooted. I am using an Apple lightning cable. I’ve tried changing USB ports. The Mac recognises it in Finder. On one app my minimum deployment is IOS 17. I have created a new app where the minimum deployment is IOS 18 and tried both in combinations, below. I can plug in my iPad running iPadOS 17 and Xcode 16 RC will compile successfully onto it (app is minimum deployment IOS 17) , just not my iPhone now that I upgraded it to IOS 18. I have: installed the Iphone 13 mini simulator with IOS 18 on Xcode 16 RC and compiled successfully to that with both apps. rebooted all devices and replugged all devices in countless combinations, countless times. tried different apps with different minimum deployments, including sample code written by others. tried setting my minimum deployments to IOS 18 The main issue is that at best, Xcode 16 RC ‘sees’ my iPhone mini and tries to pair with it but doesn’t succeed. I tried following this thread: https://developer.apple.com/forums/thread/764196?answerId=804884022#804884022 and tried ‘Quick fix 1’. Which at least allowed Xcode to sometimes ‘see’ my phone, but after a few reboots, no longer does. Quick Fix 1: “Open Terminal and run (replacing the path to Xcode 16.0 if needed): sudo installer -pkg /Applications/Xcode.app/Contents/Resources/Packages/XcodeSystemResources.pkg -target /“ Apple M1 Pro - Sequoia 15.0 (24A335) Xcode Version 16.0 (16A242d) I have submitted feedback: FB15264854
2
2
4.6k
Oct ’24
Xcode 16 won't pair with iPhone, Error is: DeviceLinkListener.c:_copyMobileDeviceValue| ERROR: Attempt to copy a value from an unpaired device. Cowardly refusing to do so
Any Apple Engineers out there who wrote this error message? DeviceLinkListener.c:_copyMobileDeviceValue| ERROR: Attempt to copy a value from an unpaired device. Cowardly refusing to do so ERROR: .... Cowardly refusing to do so Any thoughts? I click on 'trust this computer' (on the iPhone) and the error is triggered. FB15285137 MacOS Sequoia iOS 18, iPhone 13 mini (previously paired happily with Xcode 15)
1
0
515
Oct ’24
Copying shared symbols hangs with iOS 18.
System Environment Sequoia 15.0, Xcode 16.0 and / or Xcode 16.1.b2. iMac 2019. I have started the project and selected run with an iPhone 15 with iOS 18.0.1 . The iPhone is connected via USB (I switched ports and changed cables) A message comes up with: "Copying shared cache symbols from iPhone15 (0% completed)". After 6 hours I stopped it. I have the same problem with an iPad Pro and IPadOS 18.0.1 i had never this problem with iOS 17 and earlier. I was able to successfully test the project with an old iPad and IOS 15.4. The copying of the symbol took about 5 mins. so it seems that there is a problem with iOS 18.
3
0
1.1k
Oct ’24
AddInstanceForFactory: No factory registered for id <CFUUID 0x6000002e76c0>
AddInstanceForFactory: No factory registered for id <CFUUID 0x6000002e76c0> F8BB1C28-BAE8-11D6-9C31-00039315CD46 AudioQueueObject.cpp:1580 BuildConverter: AudioConverterNew returned -50 from: 0 ch, 16000 Hz, .... (0x00000000) 0 bits/channel, 0 bytes/packet, 0 frames/packet, 0 bytes/frame to: 2 ch, 16000 Hz, Int16, interleaved HALSystem.cpp:2216 AudioObjectPropertiesChanged: no such object AQMEIO_HAL.cpp:2552 timeout AudioHardware-mac-imp.cpp:2706 AudioDeviceStop: no device with given ID AudioQueueObject.cpp:1580 BuildConverter: AudioConverterNew returned -50 from: 0 ch, 16000 Hz, .... (0x00000000) 0 bits/channel, 0 bytes/packet, 0 frames/packet, 0 bytes/frame to: 2 ch, 16000 Hz, Int16, interleaved AudioQueueObject.cpp:6707 ConvertInput: aq@0x109994200: AudioConverterFillComplexBuffer returned -50, packetCount 5328 Why can't I start recording? ...
3
0
872
Oct ’24
Release Build Fails to Communicate with BLE 4.2 Device After Upgrading to Xcode 16.0
Hello everyone, I recently upgraded from Xcode 15.4 to Xcode 16.0. While the build generated using Xcode 15.4 worked perfectly, I encountered an issue with the release build after the upgrade. Specifically, the release build fails to communicate with a BLE 4.2-based device. I’ve compared the ‘Project Properties’ between Xcode 15.4 and 16.0 but couldn’t identify any differences that might be causing this issue. Could anyone provide insights into what might be causing this problem? Is a specific library used in my project incompatible with Xcode 16.0, or is this an issue with Xcode 16.0 itself? No warning or exception is visible when debugging an Xcode 16.0-based release mode application. Any help or suggestions would be greatly appreciated! Thank you!
0
0
232
Oct ’24
Xcode UI test cannot tap menu button in form
Apparently UI tests are unable to tap menu buttons but can tap regular buttons inside forms. Earlier today I was able to see in the Simulator that the UI test tries to tap the button by tapping the center of the containing form row, which works for regular buttons, but not for menu buttons. In fact, when trying in the SwiftUI preview in Xcode it seems that menu buttons have to be tapped exactly on top of them, while regular buttons can be tapped anywhere in the form row. (Now I’m not able to see touches performed by the UI test anymore in the Simulator for an unknown reason, even though I have “Show single touches” enabled in the Simulator settings.) How can I open a menu button in a UI test? The UI code: struct ContentView: View { @State private var label1 = "Menu 1" @State private var label2 = "Menu 2" var body: some View { NavigationStack { Form { LabeledContent("Menu 1") { Button(label1) { label1 = "Menu 1 tapped" } .accessibilityIdentifier("menu1") } LabeledContent("Menu 2") { Menu(label2) { Button("Button") { } .accessibilityIdentifier("button") } .accessibilityIdentifier("menu2") } } } } } #Preview { ContentView() } And the test: final class problemUITests: XCTestCase { func testExample() throws { // UI tests must launch the application that they test. let app = XCUIApplication() app.launch() app.collectionViews.element(boundBy: 0).buttons["menu1"].tap() app.collectionViews.element(boundBy: 0).buttons["menu2"].tap() app.collectionViews.element(boundBy: 0).buttons["button"].tap() } }
2
0
674
Oct ’24
Cannot using real device has iOS 17.7 on Xcode 15.4 and Xcode 16.0
Dear Apple Developer Teams, we cannot find device support for iOS 17.7 on Xcode 15.4 and Xcode 16.0. We couldn't find any information about iOS 17.7 support on the Xcode release notes. We're really worried and we're thinking, do you guys lack support for iOS 17.7 on your Xcode versions? Please tell us how to use real device has iOS 17.7 on Xcode 15.4 and 16.0
1
1
475
Oct ’24
Should I worry about this error message?
I have a SwiftData Model which includes a property of type Array. @Model final class Handler { public var id: UUID public var name: String public var mailingAddress: [String] . . . public init() { self.id = UUID() self.name = "" self.mailingAddress = [] . . . } When I use this Model in code, the mailingAddress field appears to work just as I would expect, but when saving it (running in Simulator), I see the following logged message: CoreData: fault: Could not materialize Objective-C class named "Array" from declared attribute value type "Array<String>" of attribute named mailingAddress Should I be worried about this?
0
1
462
Oct ’24
SDK Folders
As today I was checking my Command line folder and there I found 5 SDK folder, which include latest and older version of SDK of MACOSX. If I delete the older Version will it create problem to my commands in my terminal
0
0
212
Oct ’24
Xcode 16 doesn't open file with warning/error (C++)
Xcode 16 breaks fundamental feature of error/warning clickthrough to a given header or .cpp file. The issues list will jump to the point of include, instead of the actual error/warning. There's not even a highlighted line since these files aren't the source of the error. Not really sure how this one got through QA since Apple uses Xcode internally. Now I'm constantly having to scour the report navigator, open the items, and then manually jump to file/line.
1
1
459
Oct ’24
Copy app files using devicectl
Hi, I'm trying to retrieve app icons from an iOS device by using devicectl. Unfortunately, the appIcon command was broken when I first tried it, it worked for the last couple of months, but with the new macOS/Xcode, it is no longer working. Reference: https://developer.apple.com/forums/thread/738793 As a result, I'm now looking for alternative ways to fetch and app icon. When retrieving a list of apps using devicectl, the app file location is returned, e.g. /private/var/containers/Bundle/Application/57ABEEB5-D488-4215-8C9B-8951BA401B33/WhatsApp.app for WhatsApp on my iPhone. The .app file contains the app icon and therefore I'm wondering if it's possible to copy this file to my Mac. xcrun devicectl device info files -h mentions file options: 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. The domain types are: temporary: for temporary directories, only to get your own space appDataContainer: container identified by app identifier appGroupDataContainer: container identified by app group identifier systemCrashLogs: crash logs The .app file is located in the /private/var/containers/Bundle/Application directory. The available domain types do not seem to include a way to access this file? Is there a way to copy .app files using devicectl? How can I effectively use the .app paths returned by the apps command?
1
0
715
Oct ’24
App not showing on simulator when "wait for executable to be launched" is selected
I am trying to launch my app manually during debug process. To achieve this, I selected "wait for executable to be launched" from Edit Scheme -> Info tab. I remember a few years ago, this process would install the fresh app on simulator/device and xcode waits it to be launched manually. Now Xcode is still waiting to be launched, but I dont see the app installed on simulator anywhere. I am stuck
1
0
368
Oct ’24
Launch Screen Image Scale Logic?
Hi! I’m trying to set up a launch screen image for my app. My goal is simple: I want my app icon to be displayed in the centre of the screen with a background colour. I do not want to use storyboards in my app. I realise that this is a very simple and common task, but I am struggling to find proper documentation on it. I am vaguely following the info.plist method from this page: https://developer.apple.com/documentation/xcode/specifying-your-apps-launch-screen/ I’m specifying my Image Name and Background Color. And everything plugs in and works except that the scale of the image is very unpredictable. I was hoping to make this work for all kinds of devices and screen sizes by simply using a transparent square image with my icon in the middle. I would have expected the image edges to be snapped to the screen borders and the image to be scaled uniformly to fit the screen. But no matter what resolution I try, 4k, 2k, 1k, the image gets scaled without any recognisable logic behind it. Does anybody know what image size is expected and if there is any way of achieving my goal?
2
1
504
Oct ’24