# Xcodebuild for Package.swift dynamic framework not creating Swift module

**URL:** <https://forums.swift.org/t/xcodebuild-for-package-swift-dynamic-framework-not-creating-swift-module/42879>\
**Category:** Using Swift\
**Created:** [December 16, 2020, 12:56pm UTC](https://forums.swift.org/t/xcodebuild-for-package-swift-dynamic-framework-not-creating-swift-module/42879 "2020-12-16T12:56:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Air-Craft](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/air-craft/32/14241_2.png) [@Air-Craft](https://forums.swift.org/u/Air-Craft)\
**Post date:** [December 16, 2020, 12:56pm UTC](https://forums.swift.org/t/xcodebuild-for-package-swift-dynamic-framework-not-creating-swift-module/42879/1 "2020-12-16T12:56:31Z")

</div>

I'm trying to build my SDK without an xcodeproj.

My xcodebuild command looks like this:

```swift
xcodebuild archive \
            -scheme MySDK \
            -configuration Release \
           -destination "generic/platform=iOS" \
           -derivedDataPath .build \
           -archivePath .build/MySDK.xcarchive \
           SKIP_INSTALL=NO \
           BUILD_LIBRARY_FOR_DISTRIBUTION=YES

```

The resultant framework (in `MySDK.xcarcxhive/Products/usr/local/lib`) is missing the `Modules` folder. Meanwhile the relevant swiftmodule info seems to be in here `DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MySDK/BuildProductsPath/Release-iphonesimulator/MySDK.swiftmodule` – but the structure is different than normal (ie. when I use an xcodeproj to build the xcframework) and there is no `.modulemap` to be seen.

My Package.swift: [My Package.swift · GitHub](https://gist.github.com/Air-Craft/657bb1c2f535cd72a0aa242d74874c1e)

Can xcodebuild + Package.swift be used to create swift friendly XCFrameworks (for iOS)?? Seems odd it makes the swiftmodule stuff and then does nothing with it. Any help appreciated...Thx

---

<div class="post-metadata">

**Author:** ![Air-Craft](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/air-craft/32/14241_2.png) [@Air-Craft](https://forums.swift.org/u/Air-Craft)\
**Post date:** [December 16, 2020, 1:19pm UTC](https://forums.swift.org/t/xcodebuild-for-package-swift-dynamic-framework-not-creating-swift-module/42879/2 "2020-12-16T13:19:38Z")

</div>

ok so there's a modulemap here (how could I have missed it 🙄 ). BUT it doesn't have the `module * {export * }` line usually found. And I have a submodule in the packageswift I'm hoping to expose...hmm...

```swift
DerivedData/Build/Intermediates.noindex/ArchiveIntermediates/MySDK/IntermediateBuildFilesPath/MySDK.build/Release-iphonesimulator/MySDK.build/MySDK.modulemap

```
