Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

macOS: `xtool dev` fails with "No valid Swift SDK bundles found" on Xcode 16.2 / Swift 6.0 (no version check)

Abierto Apto para principiantes
#386 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
63/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
github, swift
Área
devtools

Línea de trabajo

Lee el comentario en Sources/PackLib/BuildSettings.swift y las instrucciones de instalación de macOS en Installation-macOS.md para confirmar el requisito del SDK de SwiftPM. Reproduce el problema con Swift 6.0 ejecutando el comando swift build --swift-sdk arm64-apple-ios del issue y luego comprueba cómo xtool dev gestiona el fallo de compilación. El trabajo estará terminado cuando los usuarios de macOS reciban un error claro sobre la versión mínima o cuando la versión mínima documentada quede explícita.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Summary

On macOS, xtool dev builds with swift build --swift-sdk arm64-apple-ios and relies on SwiftPM's implicit Darwin SDKs, which (per the comment in Sources/PackLib/BuildSettings.swift) exist as of Swift 6.1. With Xcode 16.2 (Swift 6.0.3) the build fails with an error that doesn't point at the cause, and xtool sdk install skips on macOS, so there's no obvious way forward. There's no Swift/Xcode version check, and Installation-macOS.md only shows Swift 6.1 in example output rather than stating it as a minimum.

This bites anyone on macOS 15.3 or earlier, since Xcode 16.3 needs macOS 15.4.

Environment

  • xtool 1.23.0 (Homebrew)
  • macOS 15.3.1, Apple Silicon (M4)
  • Xcode 16.2, Apple Swift 6.0.3 (swiftlang-6.0.3.1.10)

Steps

  1. xtool setup (works fine).
  2. In an xtool project: xtool dev run --usb.
    • First run, with no ~/Library/org.swift.swiftpm/swift-sdks directory yet:
      error: The folder "swift-sdks" doesn't exist.
    • Once that directory exists (e.g. after running swift sdk list):
      error: No valid Swift SDK bundles found at ~/Library/org.swift.swiftpm/swift-sdks.
  3. xtool sdk install /path/to/Xcode.app prints Skipping SDK install; the iOS SDK ships with Xcode on macOS, so it doesn't help.

Minimal repro without xtool

mkdir -p repro/Sources/Repro && cd repro
cat > Package.swift <<'EOF'
// swift-tools-version: 6.0
import PackageDescription
let package = Package(name: "Repro", platforms: [.iOS(.v17)], targets: [.target(name: "Repro")])
EOF
echo 'public let x = 1' > Sources/Repro/Repro.swift
env -u SDKROOT "$(xcrun -f swift)" build --swift-sdk arm64-apple-ios
# error: No valid Swift SDK bundles found at ~/Library/org.swift.swiftpm/swift-sdks.

So the failure is SwiftPM 6.0's behaviour; xtool just doesn't catch it. I couldn't confirm the Swift 6.1 side on this machine (Xcode 16.3 won't install on macOS 15.3.1), so that part rests on the code comment.

Suggestion

Either or both of:

  • On macOS, check the toolchain's Swift version (or that --swift-sdk arm64-apple-ios resolves) before building, and fail with something like: xtool on macOS needs Swift 6.1+ (Xcode 16.3+); found Swift 6.0.3.
  • State the minimum Xcode/Swift version in Installation-macOS.md.

Workaround, for anyone stuck on Xcode 16.2

This got an app onto a device:

xtool dev generate-xcode-project
xcodebuild -workspace xtool/<App>.xcworkspace -scheme <App>-App \
  -sdk iphoneos -destination 'generic/platform=iOS' -derivedDataPath ./dd \
  CODE_SIGNING_ALLOWED=NO CODE_SIGNING_REQUIRED=NO build
xtool install --usb dd/Build/Products/Debug-iphoneos/<App>-App.app

xtool install signs and installs the unsigned .app fine. One thing not to try: xtool sdk build + swift sdk install of the result. That bundle is built for a Linux host and fails on macOS with a cyclic dependency in module 'DarwinFoundation' error.

Lenguaje dominante
Swift
Estrellas
5.5k
Forks
163
Merge medio
19 h 33 min
PR fusionados (30 d)
25

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de xtool-org/xtool

Todos los issues de xtool-org/xtool

Issues similares

Más issues de Swift

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.