Created
January 22, 2021 03:53
-
-
Save igroomgrim/095202c2455d0de10e93430968fb2827 to your computer and use it in GitHub Desktop.
Build Omise iOS SDK .xcframework
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This workaround let we can build `OmiseSDK.xcframework` and just copy into your project | |
- **Environments** | |
- Xcode 12.3 (12C33) | |
- Swift 5.3.1 | |
------------ | |
- **Steps** | |
1. Download Omise SDK ([master](https://github.com/omise/omise-ios/archive/master.zip)) and extract into your PC | |
2. Open `Terminal` app and go to `omise-ios-sdk` folder | |
3. use `xcodebuild` archive SDK for simulator | |
``` | |
xcodebuild archive \ | |
-scheme OmiseSDK \ | |
-archivePath ~/YourOutputLocation/OmiseSDK-iphonesimulator.xcarchive \ | |
-sdk iphonesimulator \ | |
SKIP_INSTALL=NO \ | |
BITCODE_GENERATION_MODE=bitcode \ | |
OTHER_CFLAGS="-fembed-bitcode" \ | |
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ | |
ONLY_ACTIVE_ARCH=NO | |
``` | |
4. use xcodebuild archive SDK for devices | |
``` | |
xcodebuild archive \ | |
-scheme OmiseSDK \ | |
-archivePath ~/YourOutputLocation/OmiseSDK-iphoneos.xcarchive \ | |
-sdk iphoneos \ | |
SKIP_INSTALL=NO \ | |
BITCODE_GENERATION_MODE=bitcode \ | |
OTHER_CFLAGS="-fembed-bitcode" \ | |
BUILD_LIBRARY_FOR_DISTRIBUTION=YES \ | |
ONLY_ACTIVE_ARCH=NO | |
``` | |
5. combine them both in `xcframework` | |
``` | |
xcodebuild -create-xcframework \ | |
-framework ~/YourOutputLocation/OmiseSDK-iphonesimulator.xcarchive/Products/Library/Frameworks/OmiseSDK.framework \ | |
-framework ~/YourOutputLocation/OmiseSDK-iphoneos.xcarchive/Products/Library/Frameworks/OmiseSDK.framework \ | |
-output ~/YourOutputLocation/OmiseSDK.xcframework | |
``` | |
6. drag and drop `OmiseSDK.xcframework` into your application project and select `Copy items if needed` | |
7. in app targets `Frameworks, Libraries, and Embeded content` choose `Embed & Sign` | |
🙇 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment