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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

Xcode Cloud - slow test-without-building step
Hi, I'm currently researching if we are able to migrate to Xcode Cloud in our project. I encountered one issue. I run unit tests on Xcode Cloud and I see that they finish in ~150 seconds, but the whole step takes ~530s and there is no information in logs why. I even run the same command on my local computer and it doesn't take that long. Any ideas? Any way to optimize it? Also one more thing: it looks like Xcode Cloud is not running on M1 machines. Do you know guys if there are plans for Xcode Cloud to take advantage of M1/M2?
2
0
1.6k
Jun ’22
Xcode's Vim Mode - further development?
It was fantastic news to hear, last year, that Xcode was getting a Vim mode. Apple's implementation of it was a great first step, but it was missing a bunch of key features. Most importantly the dot command (and by, extension, macros) and creating marks in files, which are functions that I use/rely on on a daily basis. I thought I would finally be able to stop having to self-sign Xcode (which causes problems) in order to use XVim2 plugin, but no such luck. Will these features get added in for Xcode 14 (they don't seem to be in the beta) or are they far out on the roadmap?
11
13
5.7k
Jun ’22
Xcode "Issue Navigator" shows stale errors and warnings
For as long as I've used Xcode, the Issue navigator shows stale errors and warnings even after the build is completely building and executing. It would be nice to have a way to retain file warnings without having to set "warnings as errors", but here the problems have already been fixed. Also need a "Reveal in Report Navigator" since half the time these errors/warnings lack 90% of the info needed to actually fix them. There's already a "Reveal in Project Navigator" that is almost never needed.
4
2
2.6k
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.1k
Jul ’22
App crashes when trying to run widget extension - M1 Mac with Rosetta
I have a Xcode project with a widget extension, Xcode, simulator and terminal are running with Rosetta (I can't change this). When I build and run the main project, the widget does not get loaded on the widgets list, when running the widget scheme on Xcode the app crashes when loading the application on simulator. Same happens on device. Macs with Intel silicon run it okay. Xcode without rosetta is also okay. Xcode log window shows the following message: SendProcessControlEvent:toPid: encountered an error: Error Domain=com.apple.dt.deviceprocesscontrolservice Code=8 "Failed to show Widget 'Gabriel.Widget-Rosetta.Widget' error: Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)}." UserInfo={NSLocalizedDescription=Failed to show Widget 'Gabriel.Widget-Rosetta.Widget' error: Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)}., NSUnderlyingError=0x600001106010 {Error Domain=SBAvocadoDebuggingControllerErrorDomain Code=1 "Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)" UserInfo={NSLocalizedDescription=Failed to get descriptors for extensionBundleID (Gabriel.Widget-Rosetta.Widget)}}} Domain: DTXMessage Code: 1 User Info: {     DVTErrorCreationDateKey = "2022-07-06 14:45:31 +0000"; } -- System Information macOS Version 12.2.1 (Build 21D62) Xcode 13.2.1 (19586) (Build 13C100) Timestamp: 2022-07-06T15:45:31+01:00 Console shows the following message: libc++abi: terminating with uncaught exception of type NSException dyld4 config: DYLD_FRAMEWORK_PATH=/Users/gabriel.soria/DD/Widget-Rosetta-bhlamdqmnxdfvtapitjtbxxspnfc/Build/Products/Debug-iphonesimulator DYLD_LIBRARY_PATH=/Users/gabriel.soria/DD/Widget-Rosetta-bhlamdqmnxdfvtapitjtbxxspnfc/Build/Products/Debug-iphonesimulator DYLD_ROOT_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS.simruntime/Contents/Resources/RuntimeRoot *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_NSXPCDistantObject ___nsx_pingHost:]: unrecognized selector sent to instance 0x600003948aa0' _LSContextInitReturningError() failed with error Error Domain=NSOSStatusErrorDomain Code=-10817 "(null)" UserInfo={_LSFunction=_LSSchemaConfigureForStore, ExpectedSimulatorHash={length = 32, bytes = 0xf6701f12 bb1a56bb bba5f39f 3f7801a6 ... f9fe6ee0 ef307d24 }, _LSLine=405, WrongSimulatorHash={length = 32, bytes = 0x9da4b2b1 56f7ac19 1a99bc21 b7ec95c2 ... c4004d14 03ef83dc }} terminating with uncaught exception of type NSException CoreSimulator 783.5 - Device: iPhone SE (2nd generation) (E360DB1E-33FF-45A4-926C-A6093DFB3699) - Runtime: iOS 15.2 (19C51) - DeviceType: iPhone SE (2nd generation)
1
0
1.4k
Jul ’22
accept incoming network connections in simulator - xcode 13.4.1
Does anyone know how to rid of this message? It is happening every time I build a project using the simulator with the following versions: xCode 13.4.1 mac Monterey 12.4. I didn't see this behavior in Xcode's previous versions. The issue seems to be because it is adding a new application every time I build the project into the firewall app list. (image below) Any tips on how to fix this?
5
5
2.6k
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
4.7k
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.3k
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
797
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
23k
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
673
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.6k
Sep ’22
XCode 14 compile errors immediately disappear or do not appear at all
I'm unable to use XCode 14 to develop my app because as soon as a compiler error is shown, it is immediately withdrawn from the Issue Navigator pane. This makes it impossible to see what is wrong. The errors are also immediately withdrawn from the editor. This video shows 3 attempts to compile the project: after the first attempt no error shows, after the second attempt the error shows for a moment then is automatically removed (no mouse or keypress from me), after the third attempt same. https://youtu.be/bmK_k6oLYpQ I have tried rebooting, and deleting ~/Library/Developer/Xcode/DerivedData, to no effect.
116
69
51k
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.0k
Sep ’22
Xcode won't display README for Swift package
I converted an iOS framework project to a Swift Package. Everything went smoothly and I can find and add the package to other projects. But Xcode won't display the README for the project. It only displays, "Unable to load the Read Me." I've stripped the README down to just a header and one line of text. I've removed the couple of extra files from the project that exist at the root level. But I still just get the same message. The project is located at: https://github.com/ecrichlow/IoGInfrastructure-iOS.git
2
2
1.4k
Oct ’22