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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

NWPathMonitor : Lost connection to the debugger
I tried to monitor the device's network status with Network framework code below. let networkMonitor = NWPathMonitor(requiredInterfaceType: .cellular) networkMonitor.pathUpdateHandler = { [weak self] path in     if path.status == .satisfied {         print("Cellular Satisfied")     } else {         print("Cellular Unsatisfied")     } } When I run the app in my iPhone(iOS 15.5) and turn cellular on/off, iPhone suddenly loses connection with XCode. Lost connection to the debugger on “...'s iPhone”. Domain: IDEDebugSessionErrorDomain Code: 12 Recovery Suggestion: Restore the connection to “...'s iPhone” and run “...” again, or if “...” is still running, you can attach to it by selecting Debug > Attach to Process > .... User Info: {     DVTErrorCreationDateKey = "2022-06-23 02:16:30 +0000";     IDERunOperationFailingWorker = DBGLLDBLauncher; } Analytics Event: com.apple.dt.IDERunOperationWorkerFinished : {     "device_model" = "iPhone13,2";     "device_osBuild" = "15.5 (19F77)";     "device_platform" = "com.apple.platform.iphoneos";     "launchSession_schemeCommand" = Run;     "launchSession_state" = 2;     "launchSession_targetArch" = arm64;     "operation_duration_ms" = 5861;     "operation_errorCode" = 12;     "operation_errorDomain" = IDEDebugSessionErrorDomain;     "operation_errorWorker" = DBGLLDBLauncher;     "operation_name" = IDEiPhoneRunOperationWorkerGroup;     "param_consoleMode" = 0;     "param_debugger_attachToExtensions" = 0;     "param_debugger_attachToXPC" = 1;     "param_debugger_type" = 5;     "param_destination_isProxy" = 0;     "param_destination_platform" = "com.apple.platform.iphoneos";     "param_diag_MainThreadChecker_stopOnIssue" = 0;     "param_diag_MallocStackLogging_enableDuringAttach" = 0;     "param_diag_MallocStackLogging_enableForXPC" = 1;     "param_diag_allowLocationSimulation" = 1;     "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_runnable_swiftVersion" = "5.6";     "param_runnable_type" = 2;     "param_testing_launchedForTesting" = 0;     "param_testing_suppressSimulatorApp" = 0;     "param_testing_usingCLI" = 0;     "sdk_canonicalName" = "iphoneos15.4";     "sdk_osVersion" = "15.4";     "sdk_variant" = iphoneos; } In my opinion, it seems like an error of XCode. Plz let me know if there's any solution. Also, there's a similar issue here : https://developer.apple.com/forums/thread/681459
6
0
1.2k
Jun ’22
One embedded framework takes forever to sign when uploading
Hello, I have an iOS app with a lot of embedded frameworks. It works well when I start it from Xcode, it works well once it is on the AppStore or in TestFlight. My only problem is when uploading it using Xcode 13. At the "Processing symbols for ....framework" stage, when reaching a specific framework, it keeps going forever (I've tried letting it run for a night, and it did not move). I can upload with Xcode 12 without problems, but not with any version of Xcode 13 or 14. Since it keeps going forever, I do not have an error message that could help me in identifying the issue. The issue seems to be with a specific framework, but I cannot identify anything that this framework has that is different from the other frameworks (they've all been compiled from C code, using a Makefile and the same CFLAGS and LDFLAGS options). I couldn't find any similar issues on the forum. Do any of you guys have a suggestion on how to fix the issue?
2
0
1.2k
Jul ’22
Xcode freezes/ hangs on startup and does not load any application
I recently updated my M1 mac to Monterey 12.5.1 and since my xcode fail to load my project. Xcode opens and hangs as seen in the picture. I have to force quit to close. The installed version of xcode is Version 13.4.1 Things I have tired: Completely removing and reinstalling xcode from the dev site Restarting device Suggestion from here https://stackoverflow.com/questions/11247008/xcode-freezes-on-startup-while-loading-project Even if I fully create a new project from the start screen, it still freezes on load Nothing seems to be working. Wondering if anyone can help Thanks
7
1
5.6k
Aug ’22
PassbookUIService crash on Xcode 14 beta 6 causes StoreKit failure
I am running a very simple UI test on Xcode 14 beta 6 that sets up a StoreKit testing session and then attempts to bring up a purchase dialog. Unfortunately, PassbookUIService is crashing and thereby causing the purchase to be canceled. Here is the crash report: PassbookUIService-2022-08-30-094331.ips.txt For context, the UI test is very simple: func testExample() throws { _ = self.expectation(description: "Never fulfilled") let session = try SKTestSession(configurationFileNamed: "CatsAndLlamas.storekit") session.clearTransactions() session.resetToDefaultState() session.disableDialogs = false let app = XCUIApplication() app.launch() let tablesQuery = app.tables tablesQuery.staticTexts["Buy Product"].tap() tablesQuery.cells.containing(.staticText, identifier:"Silver Llama").staticTexts["Subscribe"].tap() waitForExpectations(timeout: 30) } On an iOS 15.5 simulator device, the UI test works as expected. However, on an iOS 16 simulator device, the UI test behaves as if the purchase request were canceled before the dialog is even displayed. This is when PassbookUIService crashes. I believe this crash is causing StoreKit (or StoreKitTest) to consider the purchase canceled. (I have screenshots of the behavior but I’ve not been able to successfully include them in this post for some reason.)
9
5
2.5k
Aug ’22
CMTimeMultiplyByRatio in iOS 16
let videoURL = URL(fileURLWithPath: path ?? "") let asset = AVURLAsset(url: videoURL, options: nil) let imageGenerator = AVAssetImageGenerator(asset: asset) imageGenerator.appliesPreferredTrackTransform = true let time = CMTimeMultiplyByRatio(asset.duration, multiplier: 1, divisor: 2) // THIS LINE GIVES ISSUE: "'duration' was deprecated in iOS 16.0: Use load(.duration) instead". I CANNOT FIGURE OUT THE CORRECT SYNTAX FOR CHANGING asset.duration TO REPLACE WITH load(.duration). HELP WITH THE CORRECT SYNTAX WOULD BE HELPFUL.
1
0
941
Sep ’22
Provisioning profile doesn't match the entitlements file's values for the com.apple.developer.team-identifier and application-identifier entitlements.
Hi all. I have encountered an issue in which I failed to build the app on Xcode. It says "Provisioning profile doesn't match the entitlements file's values for the com.apple.developer.team-identifier and application-identifier entitlements". But I have checked these two values, they are exactly the same as expected.
1
0
1.4k
Sep ’22
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
24k
Sep ’22
WatchKit app no longer has bridging header after upgrade to Xcode14?
I've upgraded to Xcode 14 and the suggested changes to the project included making the WatchKit app and the extension be a single target. Once I did that, my complications and my old extension code can't find the objective-c objects that I had included via a bridging header. I've gone looking in the watch app settings and there is no option for setting the bridging header. None that I can find, I should say. There is no Swift Compiler section at all, and I can't seem to add a user-defined setting either. Now the app won't compile. If I restore from time machine and try again, then I can't install the app because Xcode tells me that an extensionless WatchKit app has an extension, which of course it does! So how do I add the bridging header to the WatchKit app?
2
0
745
Sep ’22
Xcode does not respect '__builtin_available' availability API
I'm writing a simple Command line application on macOS with code using C++, using a API called 'std::to_chars' from charconv void foo(void) {   if (__builtin_available(macOS 10.15, *))   {     char buffer[10];     std::to_chars_result tcr = std::to_chars( buffer, buffer+5, 5 ); #pragma unused (tcr)   }else{     return;   }     } Since Xcode complains main.cpp:19:41: error build: 'to_chars<int, 0>' is unavailable: introduced in macOS 10.15 I wrapped the code with an availability check API in C++, __builtin_available(macOS 10.15, *)) But even with this availability check API, Xcode still failed to compile. Anyone knows why?
1
0
1.8k
Sep ’22
Xcode 14 "Fix All Issues" not possible?
Im using Version 14.0 (14A309) In Xcode 13 i used the keybinding Control ⌃ + Option ⌥ + Command ⌘ + F to fix all errors in scope, for example an enum with missing cases. It is not possible in Xcode 14 since the "Fix All Issues" button is disabled all the time. You can navigate to "Fix All Issues" from: Editor -> "Fix All Issues" but its not possible to tap the button.
5
3
2.2k
Sep ’22
Help with blocked developer account
Hi all I don’t even know if this is a help post or just a cry from my soul. I'll start from the very beginning. My firm is developing software for small and medium businesses. For us developers, there is nothing unusual about this. If the client's store, we transfer it beautifully and without problems to the mobile application. We have been releasing apps since 2019. And everything was fine, even excellent, until August 2022. In August, after submitting the application for review, I, as the account developer, received a notice that clause 3.2f was violated and that my account would be closed. It is clear that I immediately filed an appeal, but the Apple inspectors said that they would not change their minds. To say that I was shocked = to say nothing. Since then, I have filed 6 appeals, created other accounts (tried), so that our clients are calm that we are fulfilling our obligations. no response to appeals (no calls, no letters) Does anyone know how else to contact support? Because I have no more ideas, honestly - I'm broken. Thanks for reading, Tim
1
0
1.3k
Oct ’22
VPN causes developer cert in keychain to become untrusted
After not happening to me for a few months, this issue has started hitting me again with currently %100 reproducability. If turn on VPN on my Mac then instantly the developer certificates within the keychain become untrusted. But that's not all, if VPN is then turned off the certificates do not revert to their trusted status but remain untrusted. The consequence of this is that if VPN is turned on and then a build is perform, it fails, and the only way to fix things is to delete the cert(s) from they keychain and re-install them. As a remote worker, having this happen several or even dozens of times a day is incredibly annoying and frustrating. This issue has been occurring for literally years, sometimes it occurs very often, others while its quiet for a while, and has spanned multiple versions of Xcode and Mac OS. So whatever the cause is its endemic. It doesn't just affect myself, but all the members in my development team. I'm currently using Xcode 14.1 RC 2 and Monterey but I've seen this issue occur with many versions of Xcode and Mac. (I'm using Cisco AnyConnect Secure Mobility Client). If the VPN is somehow interfering/affecting the connectivity aspect when an attempt is made by Xcode to validate the certificate, then why does it not rectify itself after turning off VPN? This is so so so so annoying. Can somebody please comment on why this happens and if there's a way to prevent it.
5
1
2.7k
Nov ’22
Updateign provisioning taking forever
Hello, in the past couple of weeks I've been experience some problems with xcode regarding the signing & capabilities. I work in a company that makes customized apps for every of our clients and beacause of that we have about 200 targets in our project. In the past couple of weeks, I have been hanving trouble with the signing & capabilities in xcode. Some times is taking too long to load the poart where i select the team were the app will be upload and when it does it got stuck with the massege updating provisioning . There is anything that could have been done to not take too much time to the target get ready to be publiched? Thanks in advanced for any help.
2
3
1.1k
Nov ’22
How to disable Temporary Tabs in Xcode?
It's maddening. I just opened a file and now it's gone because I had the audacity to open another file. I've learned that I can double click the tab of the first file to make it a permanent tab... but, of course, I'll need to do that every time I ever open any file ever, and if I close that file and come back to it later I'm going to be constantly having to double click tabs just to make Xcode stop replacing my tabs for me. It's nuts. It's driving me insane. Please. Is there any way to just DISABLE the temporary tabs behavior? I don't find it helpful in any way and I find it to be destructive to my development workflows.
7
2
3.0k
Nov ’22
Instruments cannot find binary for disassembly
Since version 14, Instruments cannot find the binary to show disassembly of executable or library. It says: Error - Binary file for selected symbol is expected to be here: /Users/<user>/Library/Developer/Xcode/DerivedData/<project>/Build/Products/Release/<project>. The thing is that the path shown by Instruments is actually the right one, and of course the binary exists in this directory. Am I missing something somewhere ?
3
1
2.2k
Nov ’22