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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

Not able to enroll in Apple developer program
On the iOS Developer app on my Iphone 13, when I try to submit my id front and back pictures, it fails every time with no fruitful error. All it says is Unable to send information, your information couldn't be sent due to connection error. The internet connection is working absolutely fine I can assure. It seems impossible to go past this step! Why is apple so vaguely difficult!
20
4
6.3k
Apr ’22
Import Local Swift Package in Xcode 13.3
Hello! I am struggling with the most basic things :-( I created a Swift Package with the wizard and left it basically untouched, only added a func: public struct TestPackage {     public init() {     }     public static func hello()     {         print("Hello, World!")     } } It just build fine. Now I created a second project, this time a SpriteKit iOS app. In the file list on the left, right-clicked on "Packages" -> "Add Packages ..." -> "Add Local" and selected the root directory of TestPackage (containing the Package.swift) The Package now correctly appears in the "Packages" folder. Opening a random Swift file in said SpriteKit iOS app, I expect to be able to import TestPackage But it tells me "No such module TestPackage". Searching the internet, I somewhere read that I have to add the package also to the "Frameworks, Libraries and Embedded Content" section in the project's target settings, but I can't. Hitting the "+" button there does not give me my library in the list of suggested libraries. Via "Add Other" -> "Add package dependency" -> "Add Local ..." I can again select the root directory of my library, but other than showing up twice in the left-side folder view (and not in said Frameworks, Libraries and Embedded content", I have no luck in importing it to my code. What am I doing wrong?
9
1
8.3k
Apr ’22
Allocations/Leaks Instrument Error: Required kernel recording resources are in use by another document.
The Leaks instrument is suddenly giving me the error "Required kernel recording resources are in use by another document." I see this has come up with Xcode 12 on iOS, but now it's happening when profiling a Mac application on Monterey 12.3.1 and Xcode 13.3. I get the same behaviour on a debug or release build. The Allocations instrument on its own also gives the same error. The Time Profiler intrument launches without issue. Regardless of the (useless) error, it's possible this is a signing issue, since Intruments is also constantly asking for a password when launching the process. Does anyone have any insight into what is causing this?
6
1
2.6k
Apr ’22
agvtool doesn't update extension Marketing Version
We have a bit of a complicated build process and need to build the Widget outside of our main app and repackage since we are using a cross platform framework. I tried scripting out updating my Widget's Marketing Version but agvtool won't update the MARKETING_VERSION in the project.pbxproj file. Therefore, we end up getting these emails from Apple: ITMS-90473: CFBundleShortVersionString Mismatch - The CFBundleShortVersionString value ‘1.2.2’ of extension ‘MyiOSApp.app/PlugIns/widgetExtension.appex' does not match the CFBundleShortVersionString value ‘1.2.3' of its containing iOS application ‘MyiOSApp.app'. I run this and it says it's updating in the Widget plist (but not the project.pbxproj) so when I build with xcode via command line it doesn't update and when we submit to the App Store we get the above message from Apple: /usr/bin/agvtool new-marketing-version $(/usr/libexec/PlistBuddy -c "Print :CFBundleShortVersionString" ../My.Crossplatform.App/My.Crossplatform.App.iOS/Info.plist) Setting CFBundleShortVersionString of project ios to:    1.2.3. Updating CFBundleShortVersionString in Info.plist(s)... Cannot find "ios.xcodeproj/../YES" Updated CFBundleShortVersionString in "ios.xcodeproj/../widget/Info.plist" to 1.2.3 I've had to resort to manually updating then submitting every time. What is the correct way to update the MARKETING_VERSION in the project.pbxproj file in a CI environment using bash?
6
1
5.1k
Apr ’22
UICollectionView compositional layout with orthogonal scrolling and a different size for last cell
We’re attempting to use UICollectionView compositional layout to describe a section layout, but it’s giving us some trouble. What we’d like to achieve: A total of 7 cells 3 cells stacked, each 30% height and 100% width, with orthogonal scrolling to see the next 3 When the user reaches the last cell, it would be 100% height and 100% width of the container. ASCII art and screenshots of the imperfect example are below. Our starting point was Apple’s example code, specifically OrthogonalScrollingViewController, but what we’ve found is if we expand the widths there, the height settings seem to longer be respected. The most basic version of a layout that we tried is this: func createLayout() -> UICollectionViewLayout { let layout = UICollectionViewCompositionalLayout { (sectionIndex: Int, layoutEnvironment: NSCollectionLayoutEnvironment) -> NSCollectionLayoutSection? in // Small items at roughly 30% of the container height. let smallItem = NSCollectionLayoutItem( layoutSize: NSCollectionLayoutSize( widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(0.3) ) ) // The large item should be 100% of the container width. let largeItem = NSCollectionLayoutItem( layoutSize: NSCollectionLayoutSize( widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(1.0) ) ) // We want 3 items to appear stacked with orthogonal scrolling. let smallItemGroup = NSCollectionLayoutGroup.vertical( layoutSize: NSCollectionLayoutSize( widthDimension: .fractionalWidth(1.0), heightDimension: .fractionalHeight(1.0) ), subitem: smallItem, count: 3 ) let containerGroup = NSCollectionLayoutGroup.horizontal( layoutSize: NSCollectionLayoutSize( widthDimension: .fractionalWidth(1), heightDimension: .fractionalHeight(0.5) ), subitems: [smallItemGroup, largeItem] ) let section = NSCollectionLayoutSection(group: containerGroup) section.orthogonalScrollingBehavior = .paging return section } return layout } We’ve tried many variations of nested groups and using the .vertical and .horizontal initializers, but each of them has the same result: The last cell is always the same size as all the others. // +------------------------------+ These would be off-screen // | +-------------------------+ | +-------------------------+ +-------------------------+ // | | 1 | | | 4 | | | // | +-------------------------+ | +-------------------------+ | | // | +-------------------------+ | +-------------------------+ | | // | | 2 | | | 5 | | 7 | // | +-------------------------+ | +-------------------------+ | | // | +-------------------------+ | +-------------------------+ | | // | | 3 | | | 6 | | | // | +-------------------------+ | +-------------------------+ +-------------------------+ // | | // | | // | | // | rest of the screen | // | | // | | // | | // | | // +------------------------------+ The last cell in the third screenshot, (0,6), is the one we want 100% height of the section. Is there a way to achieve this layout where the last cell is 100% of the section height?
1
0
1.7k
May ’22
CMake, vcpkg, and universal builds
Again, none of this is really my choice: our project is multi-platform (specifically, at this time, Windows and macOS). As a result, the people who started 8 hours before I did picked CMake and vcpkg to handle build system generation and 3rd party dependencies. (TBF, I can't blame them for this, since this does work on a Mac, for at least a simple build.) I want to support Apple Silicon, obviously. I can build native on my M1 MBP. (I could, theoretically, use lipo and create a universal bundle, but that would mean manually signing a handful of executables, and then the whole thing, unless I missed a way to do this much more easily?) We're using CircleCI for CI, or maybe github actions in the future. I have not been able to figure out how to use CMake and vcpkg to do a cross build. Not even universal, just "build for arm64 on Intel mac". googling and searching these fora hasn't shown a lot that seems to work (mainly, I think, for the vcpkg side). Which is weird, because one of the things people use CMake for is to build Android and iOS apps, which generally does mean cross-compiling. Does anyone know how to do that? I'm at the point where I'm looking at CocoaPods again -- but that will not work with CMake, so we'll have two completely different build systems, one of which requires a Mac with GUI to add/remove sources/targets.
13
0
5.1k
May ’22
Xcode Full Vim Support
Hi everyone! I've been using various IDEs over the years for different projects I work on, and one thing I have always been able to rely on is full or at least powerful integration with Vim keybindings. Of course I can survive going back to using my mouse and keybinds I prefer only using when off the clock, but I think as a mature and modern IDE, despite clashes with existing keybinds, there should be a better effort to give full Vim keybinds support. I know that for developers who don't buy into spending a ridiculous amount of time to possibly edit code faster, if you learn Vim right, they don't see this as an issue. But for someone who has opened Eclipse, Rstudio, Google Cloud, Jupyter lab, good ol' Vim itself, Overleaf notebook, and basically any text editor for programming, to have full access to Vim keybindings, it feels quite frustrating that not even Visual block mode is mapped properly in Xcode with Vim keybindings. Would it be possible for better support for Vim keybindings, even being able to edit text with regex using classic Vim command-line mode ":". I know it will not be possible to implement everything, but at least implementing enough for me to not notice that Vim is clearly not supported would be amazing. Thanks everyone 😘😘
6
9
3.7k
Jun ’22
Debugging Resources
General: DevForums tags: Debugging, LLDB, Graphical Debugger Xcode > Debugging documentation Diagnosing memory, thread, and crash issues early documentation Diagnosing issues using crash reports and device logs documentation Choosing a Network Debugging Tool documentation Testing a release build documentation Isolating Code Signing Problems from Build Problems DevForums post What is an exception? DevForums post Language Exception from RCTFatal DevForums post Standard Memory Debugging Tools DevForums post Using a Sysdiagnose Log to Debug a Hard-to-Reproduce Problem DevForums post Posting a Crash Report DevForums post Implementing Your Own Crash Reporter DevForums post Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com"
0
0
2.4k
Jun ’22
Run Xcode 13.x on macOS Ventura?
I installed the beta version of macOS Ventura and would like to have a stable version of Xcode (e.g. 13.4.1) running, but it says "The version of Xcode installed on this Mac is not compatible with macOS Ventura" Is there any way to make Xcode run? Has this always been the case that only the latest (beta) version of Xcode is available on new macOS major beta versions?
17
5
38k
Jun ’22
Xcode Cloud is unable to connect to the repository
Hello, I am trying out Xcode Cloud for the first time. I could connect to Github in the initial setup and had a few failed builds (package resolution error), which I resolved fairly quickly. Now whenever I am trying to build, I get the following error: Xcode Cloud is unable to connect to the repository “<respository-name>”. Reconnect the repository to resume builds. I am unable to remove the connection from settings as well because it's stuck in a loading state. Is there a way to fix this?
14
4
7.5k
Jun ’22
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.4k
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?
9
13
4.2k
Jun ’22