Skip to content

Commit

Permalink
*Remove Unused Architectures instructions added.
Browse files Browse the repository at this point in the history
  • Loading branch information
hugohernandez authored Mar 11, 2019
1 parent 64da985 commit 0bd399a
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,3 +145,28 @@ func failToken(error: NSError) {
print("\(error.code) - \(error.localizedDescription)")
}
```

## Remove Unused Architectures (for production only)

The universal framework will run on both simulators and devices. But there is a problem, Apple doesn’t allow to upload the application with unused architectures to the App Store.

Please make sure that you have "Remove Unused Architectures Script" added in your project while releasing your app to App Store.

- Select the Project -> Choose Target -> Project Name -> Select Build Phases -> Press "+" -> New Run Script Phase -> Name the script as "Remove Unused Architectures Script".

```javascript
FRAMEWORK="Openpay"
FRAMEWORK_EXECUTABLE_PATH="${BUILT_PRODUCTS_DIR}/${FRAMEWORKS_FOLDER_PATH}/$FRAMEWORK.framework/$FRAMEWORK"
EXTRACTED_ARCHS=()
for ARCH in $ARCHS
do
lipo -extract "$ARCH" "$FRAMEWORK_EXECUTABLE_PATH" -o "$FRAMEWORK_EXECUTABLE_PATH-$ARCH"
EXTRACTED_ARCHS+=("$FRAMEWORK_EXECUTABLE_PATH-$ARCH")
done
lipo -o "$FRAMEWORK_EXECUTABLE_PATH-merged" -create "${EXTRACTED_ARCHS[@]}"
rm "${EXTRACTED_ARCHS[@]}"
rm "$FRAMEWORK_EXECUTABLE_PATH"
mv "$FRAMEWORK_EXECUTABLE_PATH-merged" "$FRAMEWORK_EXECUTABLE_PATH"
```

Thats all !. This run script removes the unused simulator architectures only while pushing the application to the App Store.

0 comments on commit 0bd399a

Please sign in to comment.