StartApp-SDK / StartAppSDK

Cocoapods repository for StartApp SDK
Other
7 stars 5 forks source link

Add support for Apple Silicon (M1) #3

Open xoridius opened 2 years ago

xoridius commented 2 years ago

Shipped framework breaks iOS Simulator builds on Apple Silicon (M1 macs).

XCFrameworks are required to include the arm64 slice for iOS devices and the macOS simulator for Macs running on Apple silicon.

Migration process:

1) Recompile libraries as XCFrameworks with arm64-simulator slice. 2) Remove deprecated EXCLUDED_ARCHS[1] and VALID_ARCHS[2] build configuration overrides from podspecs (remove all uses of spec.pod_target_xcconfig and spec.user_target_xcconfig).

Simplified example of building framework target as XCFramework:

# archive framework for device targets
xcodebuild archive -project 'Project.xcodeproj' -scheme 'FrameworkDemo' -configuration Release -destination 'generic/platform=iOS' -archivePath 'archive/FrameworkDemo-iphoneos.xcarchive' SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES

# archive framework for simulator targets (code signing not required)
xcodebuild archive -project 'Project.xcodeproj' -scheme 'FrameworkDemo' -configuration Release -destination 'generic/platform=iOS Simulator' -archivePath 'archive/FrameworkDemo-iphonesimulator.xcarchive' SKIP_INSTALL=NO BUILD_LIBRARIES_FOR_DISTRIBUTION=YES CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO CODE_SIGN_ENTITLEMENTS="" CODE_SIGNING_ALLOWED="NO"

# build XCFramework
xcodebuild -create-xcframework \
-framework archive/FrameworkDemo-iphoneos.xcarchive/Products/Library/Frameworks/FrameworkDemo.framework \
-framework archive/FrameworkDemo-iphonesimulator.xcarchive/Products/Library/Frameworks/FrameworkDemo.framework \
-output archive/FrameworkDemo.xcframework

References:

cuongtv51 commented 2 years ago

I need this update too.

PavloKurliandskyi commented 2 years ago

Fixed in 4.8.0