bytedance / Bytedance-UnionAD

MIT License
170 stars 54 forks source link

[Feature] Add support for Apple Silicon (M1) #154

Closed xoridius closed 1 year ago

xoridius commented 2 years ago

Is your feature request related to a problem? Please describe. | 提出这个建议是因为遇到了什么问题?

All shipped frameworks break iOS Simulator builds on Apple Silicon (M1 macs).

Describe the solution you'd like. | 描述你期望的解决方案。

I want to be able to run apps with Bytedance SDKs in iOS simulator on M1 macs. XCFrameworks are required to include the arm64 slice for iOS devices and the macOS simulator for Macs running on Apple silicon.

Additional context | 额外信息

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:

ddaddy commented 2 years ago

M1 has been out almost 2 years now, we need XCFramework to support it.

xoridius commented 2 years ago

Related issues: #152 #144 #63

ddaddy commented 2 years ago

Any update on this? If you don't have an Apple Silicon Mac to compile the .xcframework there are now even cloud services you can use. It just needs compiling as an .xcframework and then we can use it.

xoridius commented 2 years ago

We just dropped the SDK ¯_(ツ)_/¯

dazy1030 commented 1 year ago

This issue also affects the implementation of other frameworks. We hope this issue will be resolved soon.

vadimbelyaev commented 1 year ago

Please prioritize this issue. The development experience with the bytedance SDK on Apple Silicon Macs is unbearable.

ikesyo commented 1 year ago

For the authors: https://developer.apple.com/documentation/technotes/tn3117-resolving-build-errors-for-apple-silicon#Update-pre-compiled-libraries-from-vendors

ikesyo commented 1 year ago

Looks like xcframework including arm64 simulator is finally supported since 5.1.0.6.

zry-bd commented 1 year ago

Thank you for your feed back. We have supported xcframework including arm64 simulator since 5.1.0.0.