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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

NSLocationTemporaryUsageDescriptionDictionary crashes Xcode 13
I just submitted a feedback for this (FB9662125) but in the spirit of “share and enjoy”… The cool new Generate Info.plist File feature in Xcode 13 crashes if you try to put an NSLocationTemporaryUsageDescriptionDictionary in your Info.plist file. Here’s a simple repro scenario: Create a minimal iOS app (no Core Data, no tests) Go to target settings → Info tab → Custom iOS Target Properties Click the (+) button on any row to begin inserting a new row Select Privacy - Location Temporary Usage Description Dictionary Click somewhere else or press Return to commit the selection Xcode crashes immediately More generally, it seems that Xcode crashes any time it tries to regenerate your Info.plist file if it contains an NSLocationTemporaryUsageDescriptionDictionary, even if (for example) you manually pasted that dictionary into the file earlier. In that case, merely tapping the (+) button in step 3 above is enough to crash it.
13
3
3.1k
Sep ’21
iPhone is busy: Making Apple Watch ready for development
Since I upgraded to iOS 15, watchOS 8 and Xcode 13, after I turned off and on my Mac, every first time I want to launch an app from Xcode to my iPhone appear this message (even if I'm not developing for watchOS): iPhone is busy: Making Apple Watch ready for development The Mac stays stuck on it for at least 20 minutes. The only solution I found (until now) is to switch off WiFi on my Watch. Is there a better solution?
120
16
90k
Oct ’21
Apple Developer App won't install on macOS Catalina
TL;DR Can earlier versions of the Apple Developer App be available to download from developer.apple.com? I'm trying to install the Apple Developer App on a laptop running Catalina. The App Store says it can't be installed because the Developer App requires BigSur ("version 11.1 or later"). Yet my other laptop has an earlier version of this app installed on Catalina, which still works. (It does give me the same error when I act on its request to "upgrade to the latest version," but at least the installed version works). As developers we often need to work under older versions of macOS to support our software that still runs on older versions of macOS and iOS. It would be helpful to have this tool on those older macOS installs. Just as older versions of Xcode are available for download to registered developers, can these development tools be similarly available? (I should note that these laptops also have Big Sur installed on separate startup volumes, but I find I'm still spending more time in Catalina to support our existing iOS apps.) Thanks.
1
2
1.4k
Oct ’21
Why does Xcode always recompile all files the second time after a full build but not after that?
This issue has bugged me for some time. Whenever I do a full build whether it's for debugging or profiling, Xcode always insists on recompiling all files the second time I build (regardless of whether there are changes or not), but then behaves normally after that and only recompiles changed files when I build. FWIW, I use a precompiled header. My project also contains other Xcode projects that consists of static libraries and frameworks that are built as dependencies. Those other Xcode projects are not rebuilt after the first build, just the source files included in my project. This has been an ongoing problem for years and continues with Xcode 13.1. I'm sure it's something within my Xcode project that I've been maintaining since at least Xcode 3 (I don't remember which version of Xcode I started with) because new projects don't exhibit this behavior. Again, building doesn't unnecessarily recompile all files, only the second time I build.
1
0
776
Oct ’21
Xcode 13: Active breakpoint turns to an outline when app is run.
I'm working on several apps that were developed on Xcode 12.5. Using Xcode 13.1, I set a breakpoint, which correctly appears as the blue marker in the left-hand column of the editor. When I run the apps (in a simulator), the breakpoint turns to an outline of a breakpoint marker, with a dotted blue outline and a white interior. The apps do not stop at the breakpoint. Breakpoints work as expected on an app started in Xcode 13.1. I've dug through the docs but find nothing that describes what the outline breakpoint means or how to make it work. I've done all the standard stuff: cleaned the build folder, deleted derived data. What does the outline breakpoint marker mean, and how do I get breakpoints working in Xcode 13.1 when debugging code developed originally on Xcode 12.5? Thanks in advance for any help. John
19
3
16k
Oct ’21
Command CodeSign failed with a nonzero exit code
After Upgrading to Xcode 13 my Builds are failing with Command CodeSign failed with a nonzero exit code. My app is in version 3.4.4. While trying to build version 3.4.5 for Mac we have started to get this error: Command CodeSign failed with a nonzero exit code Have tried everything people have said in this and other forums: Clean build folder; Restart Xcode Add --deep to Other Code Signing Flags Revalidate all Certificates Manual and Auto Signing The unsigned executable works fine. I am Evan able to Sign it manually and distribute locally. For Store Submission we need this step to succeed. Will appreciate help from Apple Technical Support This started happening with Xcode 13.
4
0
18k
Nov ’21
Attach process failed when trying to run intents extension via Xcode
Issue Summary Hi all, I'm working on an Intents Extension for my app, however when I try to run an intent, Xcode pops up the following error: Could not attach to pid: "965" attach failed (Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.) An image of the error: This only happens when I try debugging the Intent Extension. Running the main app target or another extension target (e.g. notifications) doesn't produce this error. Build Setup Here are the details of my build setup: Mac Mini M1 Xcode 13 Building to iPhone 11 Pro Max, iOS 15.0.2. I've also tried building to my iPad Pro 12.9 w/ iOS 15.1 and hit the same issue. Things I've tried: Make sure "Debug executable" is unchecked in the scheme I've tried changing the Launch setting to "Automatic" and "Wait for the executable to be launched" I've made sure to run sudo DevToolsSecurity -enable on my mac Rebooted iPhone devices + mac mini Uninstalled / reinstalled the app Deleted derived data Removing / reinstalling the development certs in my keychain --> this actually seemed to work initially, but then the problem came back and now it doesn't work anymore. Console Logs I've looked at the console logs while this error occurs to see if it can shed light on the issue. Here are the ones that seemed notable to me. These logs seem to show that Siri is trying to save / write to a file that it does not have access too. Seems very suspicious error 11:42:38.341470-0800 kernel System Policy: assistantd(31) deny(1) file-read-metadata /private/var/mobile/Library/com.apple.siri.inference error 11:42:38.342204-0800 assistantd failed to save contact runtime data. error=Error Domain=NSCocoaErrorDomain Code=512 "The file “com.apple.siri.inference” couldn’t be saved in the folder “Library”." UserInfo={NSFilePath=/var/mobile/Library/com.apple.siri.inference, NSUnderlyingError=0x100fb03a0 {Error Domain=NSPOSIXErrorDomain Code=5 "Input/output error"}} error 11:42:38.342403-0800 assistantd InferenceError<errorId=crSaveToRunTimeDBFailed file=/Library/Caches/com.apple.xbs/Sources/SiriInference/SiriInference-3100.49.3.1.2/SiriInference/SiriInference/ContactResolver/ContactResolver.swift function=logRunTimeData(runTimeData:config:) line=378 msg=> error 11:42:38.465702-0800 kernel 1 duplicate report for System Policy: assistantd(31) deny(1) file-read-metadata /private/var/mobile/Library/com.apple.siri.inference Looking for "debugserver" entries, like the error suggests, shows these logs: default 11:42:44.814362-0800 debugserver error: [LaunchAttach] MachTask::TaskPortForProcessID task_for_pid(965) failed: ::task_for_pid ( target_tport = 0x0203, pid = 965, &task ) => err = 0x00000005 ((os/kern) failure) default 11:42:44.814476-0800 debugserver 10 +0.011525 sec [03c6/0103]: error: ::task_for_pid ( target_tport = 0x0203, pid = 965, &task ) => err = 0x00000005 ((os/kern) failure) err = ::task_for_pid ( target_tport = 0x0203, pid = 965, &task ) => err = 0x00000005 ((os/kern) failure) (0x00000005) default 11:42:44.825704-0800 debugserver error: MachTask::StartExceptionThread (): task invalid, exception thread start failed. default 11:42:44.825918-0800 debugserver error: [LaunchAttach] END (966) MachProcess::AttachForDebug failed to start exception thread attaching to pid 965: unable to start the exception thread default 11:42:44.826025-0800 debugserver error: Attach failed default 11:42:44.828923-0800 debugserver error: Attach failed: "Not allowed to attach to process. Look in the console messages (Console.app), near the debugserver entries, when the attach failed. The subsystem that denied the attach permission will likely have logged an informative message about why it was denied.". I've also attached the full details of the error below via a text file if it helps. Any help with this issue would be great, and I'm happy to provide more information if needed. Thanks in advance! Xcode Attach Full Error Details
6
2
7.6k
Nov ’21
xcode cloud build performance
Hi, My name is Bin, software engineer at VBreathe in Sydney. We have a mobile app developed in Ionic Angular framework and managed to use xcode cloud to build and deploy the app to TestFlight. It worked well, but the speed is a bit slow, takes around 1 hour to finish the build. After checking the logs, the ci_post_clone.sh script took over 20 minutes to finish, because it installs bunch of tools and node packages, which are necessary to build the app. My question is that is there a way to cache these tools and node packages on xcode cloud, so no need to download & install them in every build? Cheers, Bin
2
0
2.7k
Nov ’21
Xcode 13 indexing is broken
I had to (sigh) upgrade to Monterey last week which forced me to upgrade to Xcode 13.1 Since then, indexing seems to have died, refactoring no longer works, I can't jump to a "definitions", etc. When I first open Xcode, I note that there's a brief message at the top saying "Initializing datastore" which lasts about 1 second and that's it. The usual message "Indexing..." does not show up. Anyone know how to fix this? I've had to switch to a virtual machine for development using an older OS and Xcode because of this. Thanks in advance for any solution. Searching does not seem to find anything useful.
5
2
3.2k
Nov ’21
Xcode 13 on Apple silicon not running app with error A build only device cannot be used to run this target.
On xcode 13, I have macos project that runs fine on intel machine. On apple silicon (M1 Plus) I get the error "A build only device cannot be used to run this target.", when I try to run from Xcode. This seems to be an ios error. All Google suggested fixes involve picking a new device which is an ios fix. Right? Bulids fine and Archive app runs fine. I get the error for both intel and Arm64 architectures. I tried building for Target deployment target device families and Deployment as: macos 12.0 sdk any suggestions?
6
0
3.2k
Nov ’21
How to create an xccovreport from an xcresult bundle.
We are having an issue when trying to view the the coveage report in our "merged result bundle" Running xccov view --report --only-targets merged.xcresult results in: 09:52:54 Error: Error Domain=XCCovErrorDomain Code=0 "Failed to load coverage archive in scheme action '(null)' in result bundle" UserInfo={NSLocalizedDescription=Failed to load coverage archive in scheme action '(null)' in result bundle, NSUnderlyingError=0x7f8ff8714f30 {Error Domain=NSCocoaErrorDomain Code=260 "The file “Metadata.plist” couldn’t be opened because there is no such file." UserInfo={NSFilePath=/tmp/action.xccovarchive/Metadata.plist, NSUnderlyingError=0x7f8ff8714930 {Error Domain=NSPOSIXErrorDomain Code=2 "No such file or directory"}}}} Checking the man page for xccov I was inspired by the idea of extracting the coverage report from the result bundle to try to understand or work around our error. The man xccov page states that If xccov is passed a result bundle directly, it will extract the report or archive implicitly, as part of the action being requested. Alternatively, the raw report/archive files can be extracted from the result bundle using xcresulttool(1) and subsequently passed to xccov. Checking man xcresulttool and trying out some stuff randomly I was not able to learn how a person might: Given an xcresult bundle use xcresulttool to create/extract an xccovreport bundle.
7
4
3k
Dec ’21
Xcode Cloud not working with local packages
Hi, I'm trying out Xcode Cloud but can't get it to build in my scenario. The use case is the following: My project has multiple swift packages that depend on each other. "App" has a local package dependency called "SPMKit". "SPMKit" has a local package dependency called "SPMKit2". The issue I run into is if "SPMKit2" has any dependencies, it doesn't resolve in Xcode Cloud. Are local dependencies like this not supported in Xcode Cloud? All the packages are in the same directory as my app. I'd like to not have to put each package in it's own git..
6
2
2.1k
Dec ’21
iOS app crashes at launch on Testflight for iOS 14 and below but not iOS 15+
We're having some strange issue with our app and/or Testflight since a few days ago: our app runs fine on simulator and devices (iOS 12, iOS 14 & iOS 15) when run from Xcode, but it crashed at launch when we archive and distribute it via Testflight for iOS 14 and below, but NOT for iOS 15 (we haven't tried to actually release to the AppStore). The app was working perfectly fine on iOS 12+ until then, on Testflight or otherwise. No crash log is ever generated by these crashes (either on Crashlytics, or Organizer, or even in the device crash logs), and what's more mysterious is that when re-archiving past versions of the code that had no issues 3 weeks ago and are live on the app store, we are now getting the crashes. We've dug into the device logs to try and get some more info, and we could find com.apple.stability.crash {"appVersion":"3.3.1","bundleID":"com.cobble.ios","exceptionCodes":"0x0000000000000000, 0x0000000000000000","incidentID":"B47DF725-343B-4D8E-A1C4-8F52EB5766C1","logwritten":1,"process":"Cobble Production","terminationReasonExceptionCode":"0x1","terminationReasonNamespace":"DYLD"} for iOS 14, and Process exited: <FBApplicationProcess: 0x10a2dd110; Cobble Producti (com.cobble.ios); pid: -1> -> <FBApplicationProcessExitContext: 0x28331a100; exitReason: (none); terminationReason: (none)> { stateAtExit = <FBProcessState: 0x283cd8cc0; pid: 4156; taskState: Not Running; visibility: Unknown>; } for iOS 12. We haven't had any luck so far figuring out what the issue(s) can be, but we've tried a lot of things from building on different computers, playing around in the build settings, updating our pods, to fully uninstalling/reinstalling Xcode and the project from Github.. It might be worth noting that we're using automatic signing from Xcode (changing that is our next test) Any help would be greatly appreciated!! We've also posted this question on StackOverflow (https://stackoverflow.com/questions/70316323/ios-app-crashes-at-launch-on-testflight-for-ios-14-and-below-but-not-ios-15)
6
1
5.8k
Dec ’21