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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

Xcode update madness
Every time XCode updates now, I am forced to download the latest version of iOS. I cannot continue to develop until I have done this. iOS is a 7+ GB download and I don't have the best internet in the world. The download often fails after a few GBs, and there is no download manager, so when that happens, I have to start the download all over again. Coding is my living and stopping me from developing stops me from working. It never used to be like this! Is everyone else experiencing this and as mad as I am with Apple? I was going to buy a new iPhone, but that purchase is on hold now!
0
1
87
2w
Xcode crash when start
I reinstall macOS system to monterey and restore from a higher version (sonoma), the xcode (version 15.4 on sonoma) can not run, so I delete it and reinstall xcode 14.2, but it always crash when start. here is the error log when I start it in Terminal: command: /Applications/Xcode.app/Contents/MacOS/Xcode error log: Error loading required libraries. If there is an ongoing installation please wait for it to complete. Otherwise reinstall. (dlopen(@rpath/libIDEApplicationLoader.dylib, 0x0001): Symbol not found: (_$s10Foundation10CocoaErrorV13userCancelledAC4CodeVvgZ) Referenced from: '/Library/Developer/PrivateFrameworks/CoreDevice.framework/Versions/A/CoreDevice' Expected in: '/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation') [1] 80496 abort /Applications/Xcode.app/Contents/MacOS/Xcode
1
0
133
2w
Code Completion in Xcode 16 beta can't be enabled again
Hey, I have been trying out the Xcode 16 beta's code completion for the last couple of days. I went do disable it through the settings, in the components section. I did this to go along with a tutorial and I didn't want it to help me out. But now that I want it back. I can't find a way to enable it again. I tried reinstalling both the beta and regular xcode, but it didn't show up again. Wanted to ask if someone knows how to get this back. Thanks!
0
0
196
2w
Compiling the JPEG-XL reference for iOS, or, "Is compiling C++ for iOS really this difficult!?"
I'm trying to add JPEG-XL encoding/decoding capabilities to my app and haven't been able to find a trustworthy pre-compiled version. The only one I've found is in https://github.com/awxkee/jxl-coder-swift. As a result I've been trying to compile my own iOS version from the reference implementation (https://github.com/libjxl/libjxl), having done virtually no compiling before. When I started out, my gut said, "Compiling for a different platform should be easy since it's not like I'm actually writing or modifying the implementation", but the more I research and try, the more doubtful I've become. So far I've figured out it means compiling all the dependencies (brotli, highway, libpng, skcms, etc.) too, but I've also gotten nowhere with them, having tried my hand at modifying cmake toolchains and CMakeList.txt files. As a novice, am I biting off more than I can chew with this? Is the seemingly simple task, "Compile this C++ library for iOS" actually something that freelancers charge huge amounts for? (If so, this makes the free compiled version mentioned above even more questionable) Any help or pointers would be greatly appreciated.
5
0
220
2w
Generate compile_commands.json from Xcode project
I need to generate a compile_commands.json for our C++ project. I need it for static code analysis tools as well as enabling clangd usage with other editors. I've tried two methods but it only works for some files with clangd. The logs of the clangd extension in VS Code indicate only that many files can't be compiled. If it works for a file, it's great, but sadly it's not consistent. I've used these two approaches to generate the compile_commands.json: using xcpretty xcrun xcodebuild -projectmyproject.xcodeproj -scheme myscheme clean build CODE_SIGNING_ALLOWED=NO | xcpretty -r json-compilation-database -o build/compile_commands.json the recommended way by sonarcloud xcrun xcodebuild -project myproject.xcodeproj -scheme myscheme \ -configuration Debug clean build CODE_SIGNING_ALLOWED=NO OTHER_CFLAGS="\$(inherited) -gen-cdb-fragment-path \$(PROJECT_DIR)/CompilationDatabase" sed -e '1s/^/[\'$'\n''/' -e '$s/,$/\'$'\n'']/' MacOS/Source/CompilationDatabase/*.json > MacOS/Source/compile_commands.json Is there something missing or are there better ways to generate the compile_commands.json without having to write a full cmake definition?
0
1
97
2w
Xcode Console: LLDB debug "po" command not working
Hi I have updated my Xcode version to 15.4 and now notice that the "po" command of the console is not working properly. It shows the below error whenever try to print any variable data (lldb) po sectionItem.collectionType error: Expression evaluation failed. Retrying without binding generic parameters error: Could not evaluate the expression without binding generic types. Do you have any idea why is it happening and the solution of it?
1
2
110
2w
Commit button disabled in Xcode
I am running Sonoma 14.5 on an Intel MacBook Pro. I had installed Xcode 15 previously and wanted to play with Swift Command Line tools. I created the project and had Xcode create a Git repo. When I make changes, they are marked as modified but when I go to the Source Control manager, my username and email show up, but the commit button is disabled. I tried creating a new test project and it has the same problem. I followed the instructions in StackOverflow and in other developer forum posts. I manually updated the git config from the terminal. I also went in and confirmed that they show up in Xcode -> Settings -> Source Control -> Git. As I mentioned before, user name and email are showing in Xcode. I can commit the changes in Terminal, but adding new changes still doesn't enable the commit button. I manually staged the files and it still didn't fix the problem. I created a new project and did not have Xcode create the git repo and then manually created the git repo from Terminal. Same problem. I tried restarting Xcode and then rebooting the computer. I even uninstalled Xcode and reinstalled it. Still has the same problem.
2
0
110
2w
How to try CoreSimulator Framework of Xcode previous versions
Related to https://developer.apple.com/forums/thread/756767 and https://feedbackassistant.apple.com/feedback/13893850 which was dismissed. Hi, I'm trying to install multiple Xcode versions with simulators on a single mac The problem is: xcrun simctl or any other simulator related process would hang several minutes after installing Xcode 16 beta additional components. If I delete /Library/PrivateFrameworks dir and reinstall additional components of Xcode 15.4, xcrun works fine without any hang. When hanging on CLI, simdiskimaged process skyrockets in CPU usage %, so that's why I assume CoreSimulator Framework is the main source of hang. Is there any way to use additional components(technically CoreSimulator Framework) of Xcode 15.4 on Xcode 16 beta? ※Plus, as I described in related thread, the hang disappears if I run Simulator.app on GUI. I already tried xattr -r -d com.apple.quarantine /Library/PrivateFrameworks or Xcode 16 beta with no use. Is there any command I can open Simulator.app headlessly on CLI?
0
0
130
2w
Mac OSX Ventura + XCode 15.2 + iOS Device v17.5.1 == XCode cannot install built app onto device...
Hi... I have a situation. I recently upgraded my iOS device from 15.1.1 to 17.5.1. I see that my version of XCode can no longer install and launch iOS apps onto the iOS device. Perhaps there are those in the Apple Community who are able to provide insight into my situation. Professionally, I support older iOS applications. The Mac OSX on the machine where I do all the work is Ventura 13.6.4. That machine is running XCode 15.2. I see that my computer does not support XCode 15.3 and XCode 15.4. Will I be required to upgrade the version of Mac OSX from Ventura to Somona for XCode to be able to install mobile apps that I've built onto this iOS device that has v17.5.1?
1
0
113
2w
Issues with SwiftData @Relationships in Swift Testing
Is it a known issue that when attempting to test SwiftData objects with relationships in Swift Testing there are errors that do not occur when the app is running? Example: @Relationship(deleteRule: .cascade, inverse: \MBAccount.book) var accounts: [MBAccount] = [] and @Relationship var book: Microbook? Then the test: let book = Microbook(name: "Julia's Cupcakes") let account1 = MBAccount(name: "Chase Business Account") let account2 = MBAccount(name: "Cash Drawer") account1.book = book account2.book = book #expect(account1.name == "Chase Business Account") #expect(account2.type == "asset") } Produces a fatal error while running test: SwiftData/PersistentModel.swift:321: Fatal error: Unable to find relationship on MBAccount for KeyPath \MBAccount.book Any ideas?
1
0
144
2w
UI Tests Runner application does not launch manually.
I need to run my tests bundle independently from Xcode. Previously, I used to deploy it and run as regular iOS application, it would execute test cases and display 'Automation running' label. I needed to execute tests some time after deploy and in different time of the day, so it is a problem for my team right now. So, UI Tests Runner app file does not launch and 'Automation Running' label is not displayed, is there any possible ways to run tests as it was or other ways to run tests not from Xcode.
0
0
129
2w
Crash in Xcode code review
Crash in Xcode code review When you enable Enable Code Review in the upper right corner of Xcode, Xcode crashes or loads infinitely. I don't think this problem existed in previous versions of Xcode, but it is very serious in the current version 15.4. It doesn't crash in all parts of Code Review, but Xcode crashes or loads infinitely in certain parts. I really hope this will be fixed in the next Xcode version. It happens so often that I'm going crazy. Seriously Especially if there are many or wide changes in the swift file, the crash occurs in that part.
1
0
135
2w
xcodebuild segmentation fault
I am getting a segmentation fault with xcodebuild: 2024-06-17 17:08:52.749 xcodebuild[26052:114044] [MT] IDEDistribution: -[IDEDistributionLogging _createLoggingBundleAtPath:]: Created bundle at path "/var/folders/m0/fb9pgvx50vngfz_tcpgyxzhw0000gn/T/macnbagent_2024-06-17_17-08-52.747.xcdistributionlogs". zsh: segmentation fault /usr/bin/xcodebuild -exportArchive -archivePath -exportOptionsPlist Version: xcodebuild -version Xcode 15.4 Build version 15F31d Is there any know segmentation fault bug with xcodebuild?
3
2
175
2w
Running application on 17.4 Simulator from Xcode 16.0 beta is crashing due to missing SwiftUICore.framework
Hi, I have a project that is pretty complex and includes mostly UIKit/Swift code with some SwiftUI added on top. I also have some SPM modules and internal Cocoapods libraries linking in. The project builds fine with the latest release version of Xcode (15) and runs on 17.4 simulator. WIth Xcode 16.0 Beta however, the project builds and runs fine on iOS 18 simulators, however there is a specific crash that happens at startup on iOS 17.4 simulators. Please see crash log below with the name of my application redacted: dyld[91294]: Library not loaded: /System/Library/Frameworks/SwiftUICore.framework/SwiftUICore Referenced from: <14C085D7-ECA8-3287-8038-5DE320ADCEBD> /Users/xxxxxx/Library/Developer/CoreSimulator/Devices/C23AA8A9-8475-4EE2-86B3-136A0EBCC362/data/Containers/Bundle/Application/95A49FCF-A7E3-4A8B-93F1-C4CDDBA74B60/xxxxxx.app/Frameworks/SwiftUI_Common.framework/SwiftUI_Common Reason: tried: '/Users/xxxxxx/Library/Developer/Xcode/DerivedData/xxxxxx-fglltpkbphqqjzgdgdadysinonmq/Build/Products/Debug-iphonesimulator/SwiftUICore.framework/SwiftUICore' (no such file), '/Users/xxxxxx/Library/Developer/Xcode/DerivedData/xxxxxx-fglltpkbphqqjzgdgdadysinonmq/Build/Products/Debug-iphonesimulator/PackageFrameworks/SwiftUICore.framework/SwiftUICore' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21E213/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore' (no such file), '/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore' (no such file, not in dyld cache), '/Library/Developer/CoreSimulator/Volumes/iOS_21E213/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.4.simruntime/Contents/Resources/RuntimeRoot/System/Library/Frameworks/SwiftUICore.framework/SwiftUICore' (no such file) It seems like for some reason Xcode is building the app thinking there would be a SwiftUICore.framework on device, but since this framework is new in iOS 18 and does not exist on iOS 17.4, the system is unable to find it and crashes. I have the min deployment target set to iOS 14.5, so I'm not sure why Xcode would make the assumption that SwiftUICore.framework will be available for linking on runtime. Interestingly, I cannot reproduce this same issue on a clean project created using Xcode 16 and targeting min deployment of iOS 15. I was wondering if anyone has any suggestions regarding specific build settings to check and see where the issue might be coming from. Thanks
0
3
162
2w
Gather Crash Logs for Tunnel Extension
Our iOS app also has a Safari Extension and a Packet Tunnel Extension. When trying to gather crash logs from the packet tunnel extension, we get an error like: ***@***[dot]com failed with error: Access Restricted. Even the account holder account was unable to access these crash logs. Is there any access level that does allow access, or are they restricted in all cases for all permission levels?
0
0
114
2w
How to configure Signin with Google in Xcode 15 for IOS
I'm working on my 1st IOS app and I'm trying to follow the instructions from: https://developers.google.com/identity/sign-in/ios/start-integrating It instructs me to edit the info.plist file but I can't find it in my project (it appears that Xcode 15 doesn't generate the file anymore?). Do I have to add the Google client IDs somewhere else in the UI? If yes, does anyone have links to a step-by-step instruction on how to do it? I'm really new to this. Thanks!
0
0
87
2w
Xcode 15.4 from the App Store will not open on MacOS 14.5
Howdy! New Apple developer here, running a MBP 2023 M2. A year ago I used Xcode to test a Flutter app I was working on, as well as a Godot app I was making. It worked fine to open, edit, and test those projects in the simulator. Today I attempted to open Xcode and it would never load past the following window: I let it sit there and spin for probably 30 minutes while I did other tasks, but it never changed. Here is what I tried after discovering the issue: Google various generic terms relating to "No selection" and "xcode". Restart the computer. No change. Update MacOS. I hadn't updated to the latest 14.5. No change afterward when opening Xcode. Update Xcode. I updated to the latest version in the App Store 15.4. No change after update. Remove Xcode (move app to Trash from Applications, remove Library/Developer, empty trash) and fresh install from App Store. No change when opening Xcode. Reinstall command line tools (since they were removed in step 3) "xcode-select --install" and then used the UI to continue install. No change. I can't really think of what else to do, as there's not a lot of information to go off of. I don't even know what that loading screen is supposed to show when it works (maybe a list of recent projects?). All options on the Xcode menu bar and the window itself are unresponsive and just show the spinning beach ball as the cursor. What else can I do to 'reset' Xcode, and/or to clear out whatever files are preventing it from loading? Thank you in advance!
3
0
512
2w
Binding to Shared User Defaults might fail in Xcode storyboards
While binding to the Shared User Defaults in .xib files is very easy I had hard times to achieve application wide preferences in projects based on storyboards. The behavior is a bit strange/unexpected and even in Xcode 15.4 it seams not to be completely solved. Issue is that IB only creates a single instance of a Shared User Default controller for the first scene, where it was requested and linking to this instance from other scenes offers no functionality. Even worse IB suggests this as first binding proposal. Here an example to deal with this issue. add slider and label to view of ViewController in IB storyboard add MenuItem to windows menu in the Application Scene When running the app this menu item remains disabled as no action is connected bind value of the created menu item to the Shared User Defaults with Model Key Path: “showTerminal“ This creates a Shared User Defaults Controller instance that we use later. Now running the app the menu item is enabled and the checkmark toggles each time add a checkbox to the view add a User Default Controller to the View Controller Scene This must be repeated for any further Window- or View- Controller scene where a binding to the user defaults is required. bind the checkbox to the newly added User Defaults Controller (but not the Shared User Defaults Controller) keeping the suggested Controller key values and set the Model Key Path to “showTerminal“ as above now bind the slider and the label to the same User Defaults controller using an identical Model key If accidentally bound to the Shared User Defaults Controller (this is what IB suggests) no functional binding will take place! Register the defaults early (before the nib is being loaded) to set default values like for example: class AppDelegate: NSObject, NSApplicationDelegate { override init() { super.init() UserDefaults.standard.register(defaults: [ "first": 0.0 , "showTerminal": false ] ) } … } [https://github.com/MissingManual/UserDefaultsBindingsInStoryboard] ATTENTION: Suggestion is, to create the first Defaults Controller as a Shared User Defaults Controller inside the Application scene. Somehow Xcode remembers settings of the Shared User Default Controller and otherwise bindings might fail. MESSAGE: Never bind to the “Shared User Default Controller“ but to individually created “User Default Controller“ for every scene, unless it is the very first time. Alternatively you can set a let variable as @objc let defaults = UserDefaults.standard for example in each ViewController and then bind to this by Bind to: ViewController Controller Key: Model Key Path: defaults.
0
0
129
2w