Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ios): fix Xcode defaulting to 'Release' #1957

Merged

Conversation

tido64
Copy link
Contributor

@tido64 tido64 commented Jun 8, 2023

Summary:

getBuildConfigurationFromXcScheme currently assumes where the .xcodeproj lives (it could be anywhere). The proper fix is to get the path from .xcworkspace, but that's a much more intrusive change. The least we can do for now is to fall back to Debug.

Test Plan:

git clone https://github.com/microsoft/react-native-test-app.git
cd react-native-test-app
npm run set-react-version 0.72
yarn
cd example
pod install --project-directory=ios
yarn ios

Take note of whether -configuration is correctly set when xcodebuild is run. This is what it looks like without this fix:

info Building (using "xcodebuild -workspace Example.xcworkspace -configuration  -scheme Example -destination id=0")

`getBuildConfigurationFromXcScheme` currently assumes where the
`.xcodeproj` lives (it could be anywhere). The proper fix is to get the
path from `.xcworkspace`, but that's a much more intrusive change. The
least we can do for now is to fall back to `Debug`.
@tido64
Copy link
Contributor Author

tido64 commented Jun 8, 2023

@adamTrz, @thymikee: Is this something we can backport to 10.x and 11.x?

cc @kelset

@kelset
Copy link
Member

kelset commented Jun 8, 2023

yeah most likely we need to backport to both so that we can then have in RN 72 and 71.

@thymikee thymikee merged commit 517faeb into react-native-community:main Jun 12, 2023
thymikee pushed a commit that referenced this pull request Jun 12, 2023
`getBuildConfigurationFromXcScheme` currently assumes where the
`.xcodeproj` lives (it could be anywhere). The proper fix is to get the
path from `.xcworkspace`, but that's a much more intrusive change. The
least we can do for now is to fall back to `Debug`.
thymikee pushed a commit that referenced this pull request Jun 12, 2023
`getBuildConfigurationFromXcScheme` currently assumes where the
`.xcodeproj` lives (it could be anywhere). The proper fix is to get the
path from `.xcworkspace`, but that's a much more intrusive change. The
least we can do for now is to fall back to `Debug`.
@thymikee
Copy link
Member

Released v12.0.0-alpha.4, v11.3.2 and v10.2.4 with this fix. Btw, the getBuildConfigurationFromXcScheme fn accepts sourceDir, which is configurable from the project.ios config in react-native.config.js, not quite assumed :D

@tido64 tido64 deleted the tido/fix-no-configuration branch June 12, 2023 12:09
@tido64
Copy link
Contributor Author

tido64 commented Jun 12, 2023

Released v12.0.0-alpha.4, v11.3.2 and v10.2.4 with this fix.

Thank you ❤️

Btw, the getBuildConfigurationFromXcScheme fn accepts sourceDir, which is configurable from the project.ios config in react-native.config.js, not quite assumed :D

sourceDir is where Podfile and the generated .xcworkspace live, but .xcodeproj can live anywhere. Otherwise that's what I would've suggested as workaround 😄

@thymikee
Copy link
Member

Let me know if you have ideas on how to improve it (e.g. extra configuration) 👍🏼

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants