Skip to content

Commit 06b23d4

Browse files
authored
fix: plugin for debug simulator (#164)
* fix: plugin for debug simulator Only set EXCLUDED_ARCHS for Release Build Settings Enables M1/M2’s to build in debug mode simulator, without having to open Xcode and configure the project settings manually. * chore: update changelog
1 parent 62f118f commit 06b23d4

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ Please add unreleased changes in the following style:
55
PR Title ([#123](link to my pr))
66
```
77

8+
fix: plugin for debug simulator ([#164](https://github.com/maplibre/maplibre-react-native/pull/164)
9+
810
## 10.0-alpha.0
911

1012
chore: update detox ([#207](https://github.com/maplibre/maplibre-react-native/pull/207))

plugin/src/withMapLibre.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,13 @@ export function setExcludedArchitectures(project: XcodeProject): XcodeProject {
117117
const configurations = project.pbxXCBuildConfigurationSection();
118118
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
119119
// @ts-ignore
120-
for (const {buildSettings} of Object.values(configurations || {})) {
120+
for (const {name, buildSettings} of Object.values(configurations || {})) {
121121
// Guessing that this is the best way to emulate Xcode.
122122
// Using `project.addToBuildSettings` modifies too many targets.
123-
if (typeof buildSettings?.PRODUCT_NAME !== 'undefined') {
123+
if (
124+
name === 'Release' &&
125+
typeof buildSettings?.PRODUCT_NAME !== 'undefined'
126+
) {
124127
buildSettings['"EXCLUDED_ARCHS[sdk=iphonesimulator*]"'] = '"arm64"';
125128
}
126129
}

0 commit comments

Comments
 (0)