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

Xcode Documentation

Post

Replies

Boosts

Views

Activity

mac-to-mac remote debugging
There have been occasional questions about remote debugging. Unfortunately I see a couple of them which were reasonable basic questions got no answer at all. I will try this again. A couple questions had some mention of lldb server. In some cases clearly the people asking the questions already knew a bit about remote debugging. Yet I can find no documentation about it.Does XCode or other tools that will work with XCode support debugging over the internet? If so what are the reqirements re XCode version and macOS version, whether the client and server can have unmatched versions, etc.?My immediate need (without extra steps) is to debug a process running on Sierra (no XCode installed yet) from a development system running XCode 7.3.1 under El Capitan.The need for remote debugging is to be able to diagnose crashes that don't happen on my development systems. There have also been questions concerning crash logs, but crash logs are of limited use unless the crash can be opened into a debugger with full ability to examine the stack and local variables.Thanks in advance!
4
1
4.4k
Mar ’20
Previews doesn't work in package target's subdirectory
I'm trying to preview a view from a swift package which is located in one of the target's directory subdirectories: . ├── Package.swift ├── README.md └── Sources 		└── SatelitUI 				└── Views 						└── MenuBar.swift When I'm previewing a view from the MenuBar.swift file I'm getting following error: NoBuildableEntriesError: active scheme does not build this file Select a scheme that builds a target which contains the current file, or add this file to a target that is built by the current scheme. Which is unexpected because the file should be a part of the SatelitUI target. The thing is it works just fine if I move it into the root target's directory (SatelitUI).
9
0
4.1k
Jun ’20
Errors running with ASAN when targeting iOS Devices
I'm unable to run my app with ASAN enabled when targeting a physical iOS device. Simulator targets do work. With Xcode 12 and an iPad mini 4 running iOS 14 beta 1 I get the following error during app launch ==750==ERROR: AddressSanitizer failed to allocate 0xffffffffff9fc000 (-6307840) bytes at address 2db624000 (errno: 22) ==750==ReserveShadowMemoryRange failed while trying to map 0xffffffffff9fc000 bytes. Perhaps you're using ulimit -v With Xcode 11.5 and an iPad Air 2 running OS 12.4.1 the error is ==2177==Unable to find a memory range after restricting VM. ==2177==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clangcompilerrt/clang-1103.0.32.62/compiler-rt/lib/asan/asanmac.cc:92 "((0 && "cannot place shadow after restricting vm")) != (0)" (0x0, 0x0) <empty stack>==2177==AddressSanitizer CHECK failed: /BuildRoot/Library/Caches/com.apple.xbs/Sources/clangcompilerrt/clang-1103.0.32.62/compiler-rt/lib/asan/../sanitizercommon/sanitizermallocmac.inc:143 "((!asaninitisrunning)) != (0)" (0x0, 0x0) warning: could not execute support code to read Objective-C class data in the process. This may reduce the quality of type information available. AddressSanitizer report breakpoint hit. Use 'thread info -s' to get extended information about the report. (lldb) thread info -s thread #1: tid = 0x1076c2, 0x000000011531e984 libclangrt.asaniosdynamic.dylib`__asan::AsanDie() My coworker is able to use ASAN with the same App using iPad Pro 10.5, iPadOS 13.5.1, Xcode 11.5 Are there any configuration changes I need to make to be able to use ASAN on my devices?
11
1
8.2k
Jun ’20
Unable to import local XCFramework module
Our project is split up into multiple Pods with CocoaPods and I'm currently trying to convert all of our podspecs to SPM. One of our projects has XCFramework dependencies that I'm trying to include from a local source, but my project files are complaining that the modules couldn't be found when I try to import them. Is there something I'm missing here? My Package.swift file looks something like this: // swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package(     name: "MyPackage",     defaultLocalization: "en_us",     platforms: [         .iOS(.v12),         .watchOS(.v6),         .macOS(.v10_15)     ],     products: [         .library(             name: "MyPackage",             targets: [                 "MyPackage"             ]),     ],     dependencies: [     ],     targets: [         .target(             name: "MyPackage",             dependencies: [                 .byName(name: "LocalXCFramework")             ],             path: "Sources/"         ),                  .binaryTarget(             name: "LocalXCFramework",             path: "Frameworks/LocalXCFramework.xcframework"         )              ] ) In this example, if I try to import the modules from LocalXCFramework, I get an error saying it couldn't be found.
10
0
7.7k
Jun ’20
Local xcFrameworks in Swift Packages
In the talk, it was explained how to use a binaryTarget to add a .xcframework from a url, but what about a local path? Take the following Package and file structure, is this the correct way to structure and refer to the .xcFramework? | SamplePackage | - | Package.swift | - | README.swift | - | Sources | - | - | Sample | - | - | - | file.swift | - | - | SampleFramework | - | - | - | framework.xcframework | - | - | Tests | - | - | - | LinuxMain.swift | - | - | - | SampleTexts | - | - | - | - | sampleTests.swift // swift-tools-version:5.3 // The swift-tools-version declares the minimum version of Swift required to build this package. import PackageDescription let package = Package(     name: "Sample",     platforms: [         .iOS(.v13),         .macOS(.v10_12)     ],     products: [         // Products define the executables and libraries produced by a package, and make them visible to other packages.         .library(             name: "Sample",             targets: ["Sample", "SampleFramework"]),     ],     targets: [         // Targets are the basic building blocks of a package. A target can define a module or a test suite.         // Targets can depend on other targets in this package, and on products in packages which this package depends on.         .target( name: "Sample"),         .testTarget(             name: "SampleTests",             dependencies: ["Sample"]),         .binaryTarget(             name: "SampleFramework",             path: "framework.xcframework")     ] ) I am getting the following error(s): invalid custom path 'framework.xcframework' for target 'SampleFramework' target path '/framework.xcframework' is not supported; it should be relative to package root
4
0
8.3k
Jun ’20
An unknown error occurred. username does not match previous request (-1)
Hey people, I'm using (or rather trying to use) Swift Packages for my project. This is not about the countless other bumps I found along the road. (Xcode/SPM is still very beta with Xcode 12.0.1 but I'll reserve complaining about for another day). But one I did not even something vaguely useful when googling it. So I started out using file paths for my dependencies, like: .package(name: "BlaBla", path: "/Users/me/GitDev/BlaBla") for some reason that does not work when you want to chain dependencies (Another bug to fix, Apple!). So I wanted to change to versions using a git repo. I gave my repo a tag and put in: .package(url: "ssh://me@server.local/usr/home/me/GitDev/BlaBla", from: "0.0.1"), On the command line SPM has no problem resolving this:  % swift package resolve Fetching ssh://me@… Cloning ssh://me@… Resolving ssh://me@… at 0.0.1 In Xcode though, I get the line from the title: An unknown error occurred. username does not match previous request (-1) (by the way I have copied this by hand as the message could not even be copy & pasted) Any ideas how to solve this? Or even debug this any further? best Roddi
7
0
6.1k
Oct ’20
Xcode randomly modifies my scheme content
I'm struggling with maintaining source-controlled collaboration when Xcode just cannot make up its mind about how to generate the schemes. I don't edit the scheme and I get these sort of changes in git. from: <BuildableProductRunnable &#9;&#9;&#9;&#9; runnableDebuggingMode = "0"> to: <RemoteRunnable &#9;&#9;&#9;&#9; runnableDebuggingMode = "2" &#9;&#9;&#9;&#9; BundleIdentifier = "com.apple.Carousel" &#9;&#9;&#9;&#9; RemotePath = "/$(PRODUCT_NAME)"> It's pretty incomprehensible to me, but has anyone run into similar?
18
2
11k
Oct ’20
How can I resolve the xcode12.4 build error: Use of undeclared identifier '_CTYPE_A'?
I have a project that previously built for x86_64 that includes objective C, C and C++ files using Xcode 11.7. I am now trying to upgrade my project so that it will build for both arm64 and x86_64 using xcode 12.4. However, when I attempt to build, I receive many errors relating to missing "CTYPE"s as well as functions missing from the global namespace. /Applications/Xcode12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_wctype.h:53:24: Use of undeclared identifier '_CTYPE_A' /Applications/Xcode12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_wctype.h:53:33: Use of undeclared identifier '_CTYPE_D' /Applications/Xcode12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_wctype.h:71:10: Use of undeclared identifier '__istype' /Applications/Xcode12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_wctype.h:89:24: Use of undeclared identifier '_CTYPE_L' /Applications/Xcode12.4.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/include/_wctype.h:125:17: Use of undeclared identifier '__tolower'; did you mean 'towlower'? /Applications/Xcode12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cctype:103:9: No member named 'isalnum' in the global namespace; did you mean 'iswalnum'? /Applications/Xcode12.4.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1/cctype:104:9: No member named 'isalpha' in the global namespace; did you mean 'iswalpha'? There are more errors than this present but this is the gist of what I am seeing. It should be noted that as far as I can tell I am not using any of the functions or definitions in my code and that these errors seem to be from functions and definitions deep in the SDK. Is there anything I should be looking for in particular to resolve these build errors? Do I need to change a project setting?
2
1
1.4k
Jun ’21
Xcode 13.0 can't pair to Apple TV 4K (tvOS 15.0)
On Xcode 13.0, I can no longer pair with an Apple TV 4K (tvOS 15.0). Until now it has always worked but since the new update to tvOS 15.0 and Xcode 13.0 I can no longer connect. I have gone through the following steps to connect: Open remote app and devices settings on Apple TV 4K (tvOS 15.0). Open Devices and Simulators in Xcode 13.0. Select Apple TV in the list and press "Pair". Code appears on the Apple TV and I can enter it in an Xcode window. After the code input, there is a short loading sign that a connection is being established. After a few seconds, the whole thing stops without an error message and the "Pair" button is visible again. Does anyone have the same problem? I would like to optimize my apps for tvOS 15 and test them on a physical device.
24
1
22k
Jun ’21
dyld: Symbol not found: swift34swift50override_conformsToProtocol
I am getting following error from one of the pod frameworks while running the app (Build is a success). dyld: Symbol not found: __ZN5swift34swift50override_conformsToProtocolEPKNS_14TargetMetadataINS_9InProcessEEEPKNS_24TargetProtocolDescriptorIS1_EEPFPKNS_18TargetWitnessTableIS1_EES4_S8_E. Referenced from: X framework Expected in: frameworks/DeviceKit.framework/DeviceKit mac OS 10.15 Xcode 12.4 React native 0.63 cocoapods: 1.10.1
10
2
14k
Aug ’21
Login to azure devops account from xcode
How do I sign in to Azure devops accounts from xcode preferences. The account for Azure doesn't show up. The code is already hosted on Azure Devops and I was working on an already made project and the repo is already in the azure devops account. The previous account was obselete and now I need to login to my own account to push the changes. Whenever I am trying to push and commit the changes I get an error: remote: You are not authorized to access this collection. (-20)
1
1
973
Aug ’21
Xcode 13 "Missing package product" using local Swift Packages
I have a project I've been working off of for a few years now that makes use of local Swift Packages. In my workspace, I have a "Kit" project that generates a framework using several local Swift Packages as dependencies. In Xcode 12, the local Swift packages resolve correctly and compiles, but each beta of Xcode 13 gives me the error: "[ProjectName].xcodeproj Missing package product '[LocalSwiftPackage]'" Clearing the package cache, derived data, or restarting the application does not resolve the issue. Only Swift Packages that are remotely loaded from a URL are compiled correctly. Using local packages to separate module code, while still being able to edit in the same project, has been essential to my workflow and would hate to see Xcode 13 release with these breaking changes, and I have not seen this issue listed in the known issues for the Xcode 13 release notes. Has anyone else experienced this issue or found a workaround?
18
14
72k
Aug ’21
Posting a Crash Report
If you need help investigating a crash, please include a crash report in your post. To smooth things along, follow these guidelines: For information on how to get a crash report, see Acquiring crash reports and diagnostic logs. Include the whole crash report as a text attachment (click the paperclip icon and then choose Add File). This avoids clogging up the timeline while also preserving the wealth of information in the crash report. If you’re not able to post your crash report as an attachment, see Can’t Post Crash Report as Attachment below. If you want to highlight a section of the report, include it in the main body of your post. Put the snippet in a code block so that it renders nicely. To create a code block, add a delimiter line containing triple backquotes before and after the block, or just click the Code Block button. If possible, post an Apple crash report. Third-party crash reporters are often missing critical information and have general reliability problems (for an explanation as to why, see Implementing Your Own Crash Reporter). Symbolicate your crash report before posting it. For information on how to do this, see Adding identifiable symbol names to a crash report. If you need to redact the crash report, do so consistently. Imagine you’re building the WaffleVarnish app whose bundle ID is com.example.wafflevarnish but you want to keep your new waffle varnishing technology secret. Replace WaffleVarnish with WwwwwwVvvvvvv and com.example.wafflevarnish with com.eeeeeee.wwwwwwvvvvvvv. This keeps the text in the crash report aligned while making it possible to distinguish the human-readible name of the app (WaffleVarnish) from the bundle ID (com.example.wafflevarnish). Finally, for information on how to use a crash report to debug your own problems, see Diagnosing issues using crash reports and device logs. Can’t Post Crash Report as Attachment Crash reports have two common extensions: .crash and .ips. If you have an .ips file, please post that [1]. DevForums lets you attach a .crash file but not an .ips file (r. 117468172). To work around this, change the extension to .txt. If DevForums complains that your crash report “contains sensitive language”, leave it out of your initial post and attach it to a reply. That often avoids this roadblock. If you still can’t post your crash report, upload it to a file sharing service and include the URL in your post. Post the URL in the clear, per tip 14 in Quinn’s Top Ten DevForums Tips. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = "eskimo" + "1" + "@" + "apple.com" [1] Because it’s easy to go from an .ips file to a .crash file. I usually do this by choosing File > Quick Look in the Finder. For more info about these file formats, see this post. Revision History: 2024-11-21 Added a recommendation to post the .ips format if possible. 2024-05-21 Added some advice regarding the “contains sensitive language” message. 2023-10-25 Added the Can’t Post Crash Report as Attachment section. Made other minor editorial changes. 2021-08-26 First posted.
0
0
6.8k
Aug ’21
Color literal not displaying as Color Swatch?
Hi, should color literals work inside Views, I am sure this used to work? Xcode Version 13.0 (13A233) Note, myColor works, but the same literal in the fill does not. let myColor = Color(#colorLiteral(red: 0.292, green: 0.081, blue: 0.6, alpha: 255)) struct TestView: View {   var body: some View {     RoundedRectangle(cornerRadius: 25)       .fill(Color(#colorLiteral(red: 0.292, green: 0.081, blue: 0.6, alpha: 255)))       .frame(width: 100, height: 100)           } }
15
5
17k
Sep ’21
Xcode 13 app archiving is modifying framework plist
When archiving & exporting App with Xcode 13. The Frameworks of the created app will have their Info.plist modified. CFBundleShortVersionString is being changed to have the same value as the application version. Steps to reproduce: Create iOS App project with v1.0.0 Add dynamic framework dependencies. ex: Framework A v3.0.0, Framework B v12.0.0. Archive Project. Distribute app AppStore Connect Export Finish the rest of the process with default values. Investigate generated IPA file Investigate .app file inside IPA Investigate frameworks inside .app file. CFBundleShortVersionString of all the frameworks is 1.0.0
12
3
19k
Sep ’21
Xcode 13 / iOS 15 takes longer than expected to launch app
I am using Xcode 13 on a Macbook Pro (Intel/2019) with macOS Big Sur 11.6 I am building and launching the app on a connecting iPhone X running iOS 15.0, I am also running a UI test suite based on XCUITest while I do that. The app takes extremely long to launch (2+ minutes), then it sits on the splash screen for another 2-3 minutes. Meanwhile, Xcode shows the alert attached: I have 2 questions: Is this a widespread Xcode 13 / iOS 15 issue? Can someone please explain what the message in the alert means "LLDB is likely reading from device memory to resolve symbols"? Is there anything I can do to reduce or avoid this wait?
9
1
7.8k
Sep ’21
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.
14
3
3.8k
Sep ’21
Open app review crashlog .txt file in Xcode 13
Got emailed three .txt crash files. Cannot for the life of me figure out how to get Xcode to do something with them. Tried: renaming .txt to .crash Dropping onto "devices and simulators" window Dropping on to "devices and simulators > select device > View device logs" "Download debug symbols" for the archive in Xcode (says "dowloaded debug symbols" so did it) ... and many other things Xcode 13 simply refuses to respond to the drag-and-drop of the file no matter the file extension and no matter where in Xcode's various windows/tools I drop it. Has anyone done this with a crash .txt file from app review and Xcode 13?
10
1
7.9k
Oct ’21