- Rebuilds the official WeChat iOS SDK (
libWeChatSDK.a) intoWeChatOpenSDK.xcframework. - Adds module support to make integration easier for Swift and Swift Package Manager.
- Supports
ios-arm64andios-x86_64-simulator. - Does not support
ios-arm64-simulatorbecause the upstreamlibWeChatSDK.adoes not provide that slice. - Requires iOS 13+ and Xcode 15+ (Swift 5.9 toolchain).
| WeChatOpenSDK | WeChat SDK |
|---|---|
| 2.0.5 | 2.0.5 |
Source of truth for distributed binaries is
Package.swift(binaryTargetURL + checksum).
dependencies: [
.package(url: "https://github.com/c01dsummer/WeChatOpenSDK.git", exact: "2.0.5")
]dependencies: [
.package(url: "https://github.com/c01dsummer/WeChatOpenSDK.git", branch: "main")
]- Xcode 15+ (Swift 5.9)
- Swift toolchain available in terminal (
swift) - WeChat iOS SDK package downloaded from WeChat Open Platform
- Download the latest WeChat iOS SDK from developers.weixin.qq.com.
- Unzip and move required SDK files to
Library/. - Run:
./create-xcframework.sh- The script outputs
WeChatOpenSDK.xcframework.zipand prints the checksum.
A GitHub Actions workflow is available for building on macOS runners:
- Go to Actions > Build XCFramework
- Click Run workflow
- Provide the required
versioninput (e.g.2.0.5) - If building a non-default SDK version, also provide:
sdk_url— an HTTPS.zipURL ondldir1.qq.comsdk_checksum— SHA-256 checksum of the SDK zip
- The workflow builds the xcframework, creates a GitHub release, and auto-updates
Package.swiftwith the correct URL and checksum
- Run the Build XCFramework workflow with the new version, SDK URL, and checksum
- The workflow automatically builds, creates/updates the release, and commits the updated
Package.swift
- Build locally with
create-xcframework.sh - Create a new GitHub release with the built
WeChatOpenSDK.xcframework.zip - Update the URL and checksum in
Package.swift:
swift package compute-checksum WeChatOpenSDK.xcframework.zip- Apple Silicon simulator issue (
ios-arm64-simulator): this is an upstream SDK limitation; prefer using a real iPhone device for local debug when needed. - Checksum mismatch: recompute with
swift package compute-checksum WeChatOpenSDK.xcframework.zipand updatePackage.swift. - CI download failure: verify
sdk_urluses HTTPS, points todldir1.qq.com, and ends with.zip, and ensuresdk_checksummatches the downloaded zip.
After package integration, verify that your app target can import WeChatOpenSDK and reference a WeChat API symbol such as WXApi.