Open kaes1a opened 1 month ago
sorry for need some time to polish
sorry for need some time to polish
Very much looking forward to it.💪💪💪
I'm not so familiar with xcode development and try it your self
I'm not so familiar with xcode development and try it your self
thx! and i will try it.
when i import this framework into the Runner and ZeroQTunneliOS target, it's not work. and i check the framework, It should be a missing header file and declaration file. like modulemap file etc. So. the issue is 'No such module 'AnyLinkKit''
To create an XCFramework in Swift, you can use the Swift Package Manager (SPM) to build and manage your package, then follow these steps to create the XCFramework. XCFrameworks are useful for supporting multiple platforms and architectures in a single package, which is ideal for distributing libraries.
Define Your Swift Package:
Create a Package.swift
file for your library. Define targets for different platforms if needed.
// swift-tools-version:5.3
import PackageDescription
let package = Package(
name: "YourLibrary",
platforms: [.iOS(.v13), .macOS(.v10_15)],
products: [
.library(
name: "YourLibrary",
targets: ["YourLibrary"]),
],
targets: [
.target(
name: "YourLibrary",
path: "Sources"
),
]
)
Build the Frameworks:
Use xcodebuild
commands to compile the library for each required platform (e.g., iOS and macOS). Run these commands from the root directory of your Swift package:
# Build for iOS
xcodebuild archive \
-scheme YourLibrary \
-destination "generic/platform=iOS" \
-archivePath ./build/ios.xcarchive \
-sdk iphoneos \
SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
# Build for iOS Simulator
xcodebuild archive \
-scheme YourLibrary \
-destination "generic/platform=iOS Simulator" \
-archivePath ./build/ios-simulator.xcarchive \
-sdk iphonesimulator \
SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
# (Optional) Build for macOS
xcodebuild archive \
-scheme YourLibrary \
-destination "platform=macOS" \
-archivePath ./build/macos.xcarchive \
SKIP_INSTALL=NO BUILD_LIBRARY_FOR_DISTRIBUTION=YES
Create the XCFramework: After building the archives, you can create the XCFramework by combining the archives with the following command:
xcodebuild -create-xcframework \
-framework ./build/ios.xcarchive/Products/Library/Frameworks/YourLibrary.framework \
-framework ./build/ios-simulator.xcarchive/Products/Library/Frameworks/YourLibrary.framework \
-framework ./build/macos.xcarchive/Products/Library/Frameworks/YourLibrary.framework \
-output ./YourLibrary.xcframework
Distribute the XCFramework:
You can distribute the .xcframework
by archiving it into a .zip
file, or by publishing it as a binary target in Swift Package Manager.
To distribute the XCFramework via SPM, update your Package.swift
with a binary target:
let package = Package(
name: "YourLibrary",
platforms: [.iOS(.v13), .macOS(.v10_15)],
products: [
.library(name: "YourLibrary", targets: ["YourLibrary"]),
],
targets: [
.binaryTarget(
name: "YourLibrary",
path: "./YourLibrary.xcframework"
),
]
)
Now, developers can add your package to their projects as an XCFramework-based dependency. This approach ensures compatibility across different platforms and architectures.
hello when i try to compile and run for iOS, found issue 'AnyLinkKit' is missing. so i open the Runner.xcworkspace i found '../../sslcon/AnyLink-apple' those keyword
i hope to the ‘sslcon for apple(AnylinkKit)’ can be release source project or binary
thanks