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

Does this work for different targets? #72

Open
evanjmg opened this issue Apr 30, 2019 · 5 comments
Open

Does this work for different targets? #72

evanjmg opened this issue Apr 30, 2019 · 5 comments

Comments

@evanjmg
Copy link

evanjmg commented Apr 30, 2019

Steps to reproduce the behavior

Seems like when I duplicate a target (different app store for a whitelabel) it still wants to go debug even though its a release on the archive.

Expected behavior

It should be release on archive - my architectures are correct in the build settings

Actual behavior

Debug instead of release

@evanjmg
Copy link
Author

evanjmg commented Apr 30, 2019

Seems I misunderstood the package.json - the mapping works fine as long as you have xcodeSchemes: { [Scheme]: [Config, Config] }

@evanjmg evanjmg closed this as completed Apr 30, 2019
@evanjmg evanjmg reopened this Apr 30, 2019
@evanjmg
Copy link
Author

evanjmg commented Apr 30, 2019

I was mistaken - seems it's only Debug / Release? Can someone explain this to me? I copied my target which was working and now the new copied target keeps doing the above

@thekevinbrown
Copy link
Owner

Happy to explain. This package does a few things (and only those things):

  • It replaces the shell script that actually kicks off the react native packager so that it can correctly tell the packager whether it's a debug or release build. The stock version says the only debug configuration is called "Debug". This might be the cause of what you're seeing.
  • It runs a script which goes through your node_modules folder and fixes up .xcodeproj files to add your schemes to them. This is important for them to realise they're in debug mode. (This is unlikely to cause what you're seeing, but could still cause it I suppose. It doesn't remove anything, it only adds.)
  • It hides your library schemes as they clutter up the menu. (I suspect this has nothing to do with what you're seeing.)

You can isolate the various things the package is doing to narrow down the cause by removing the all script from your postinstall, removing your node_modules, then npm i and run each command one at a time until you see the behaviour.

Does that help at all?

@evanjmg
Copy link
Author

evanjmg commented May 1, 2019 via email

@thekevinbrown
Copy link
Owner

The code that goes through the build steps is here:
https://github.com/thekevinbrown/react-native-schemes-manager/blob/master/src/fix-script.js

So yes, the script swapper should go through every build step of project.hash.project.objects.PBXShellScriptBuildPhase and check if there's the string react-native-xcode.sh in it. If you've got multiple targets and it's not doing this for all targets, you'd just need to figure out where the other targets are in the project once it's parsed.

Can you trace through and figure out exactly what this library is doing or isn't doing for you that you want it to do or provide a reproduction case so I can have a look?

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

No branches or pull requests

2 participants