A script for creating a cross-platfrom framework for xcode 8.
-
Click on the project file
-
Select your framework target into target column
-
Copy and paste the script into the 'Run Script' box and replace <Put_your_target_name_here> with $(TARGET_NAME)
-
Compile this target
Suppose that 'nonscript_framework' already exists (and it hasn't the script define previously)
-
Click on the project file
-
Create the aggregate clicking into '+' of Project and Targets column
-
In the new window select 'cross-platform' and the 'Aggregate'
-
Go to Build Phases in your aggregate
-
In "Target Dependencies" select '+' and add the base framework
-
Copy and paste the script into the 'Run Script' box and replace <Put_your_target_name_here> with your framework name, in our example 'nonscript_framework'
-
Compile this target
- English commented script here
- Spanish commented script here
- Make sure the selected 'shell' is /bin/sh in your Run Script
- If you want a Debug framework -> compile with an iphonesimulator into scheme (or any debug scheme)
- If you want a Release framework -> archive target or select any release scheme
- You could find an example here. The xcode example include how to add Objective-C and Swift files into the framework.
- Remember you could replace the <Put_your_target_name_here> alias with $(TARGET_NAME) when no using aggregates. Example:
TARGET="${TARGET_NAME}"
- You can check the architectures with:
lipo -info <framework_name>.framework/<framework_name>