Skip to content

Conversation

bo2themax
Copy link
Contributor

647ca95 accidentally committed a different TeamID, resulting in Xcode not reading the team id from the Xcode configuration, so:

  • Remove DEVELOPMENT_TEAM from xcodeproj

    Removing this can prevent Xcode from modifying "$(inherited)" to the derived team ID when users select the signing tab, to avoid unintended changes.

  • Update Package.resolved for ConfCore, by the way, for 8f31557

Removing this can prevent Xcode from modifying "$(inherited)" to derived team ID when users select the signing tab, to avoid unintended changes.
@bo2themax bo2themax marked this pull request as ready for review September 11, 2025 09:32
COPY_PHASE_STRIP = NO;
DEAD_CODE_STRIPPING = YES;
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
DEVELOPMENT_TEAM = 72X6ZPCY5L;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had previously set these to $(inherited) because Xcode kept trying to copy the value from the config into this file whenever you change a build setting through the UI. At least I’m pretty sure that got merged in.

Did Xcode overwrite $(inherited) or was there a conflict resolution where you took your side?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmmm, it looks like this was actually my fault! Gonna check on that more today.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had previously set these to $(inherited) because Xcode kept trying to copy the value from the config into this file whenever you change a build setting through the UI. At least I’m pretty sure that got merged in.

Did Xcode overwrite $(inherited) or was there a conflict resolution where you took your side?

Yeah, I tried using $(inherited), but once I opened the signing tab, and switched to the repo, actual id was overwritten

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😞 That's very frustrating! I’ve had this problems with other settings in xcconfig files before, too. I should probably take that time to create a sample project and open a Feedback.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😞 That's very frustrating! I’ve had this problems with other settings in xcconfig files before, too. I should probably take that time to create a sample project and open a Feedback.

I think it's been like this for a long time, almost every project I cloned has last team id embedded😅

@bo2themax bo2themax marked this pull request as draft September 11, 2025 14:56
@bo2themax
Copy link
Contributor Author

bo2themax commented Sep 11, 2025

@allenhumphreys This pr indeed does not fix the issue.

It seems to me that a pattern exists here. As long as you don’t open WWDC under PROJECT settings, no new changes will be added.

But another project using Xcode configuration to distinguish bundle id doesn't have this behaviour, which is very strange.🥲

Screen.Recording.2025-09-11.at.17.13.53.mp4

@allenhumphreys
Copy link
Collaborator

@allenhumphreys This pr indeed does not fix the issue.

It seems to me that a pattern exists here. As long as you don’t open WWDC under PROJECT settings, no new changes will be added.

But similar projects using Xcode configuration to distinguish bundle id doesn't have this behaviour, which is very strange.🥲

Yes, this particular setting (DEVELOPMENT_TEAM) seems to be treated differently.

A potential solution/workaround/defensive measure I thought of was to add a build phase script that removes these lines using sed. I don't know if writing the pbxproj file during a build will cause a major problems though.

@allenhumphreys
Copy link
Collaborator

Also wow, good job figuring out exactly the scenario in which it does it. It doesn't do it if you open target settings. Or even signing settings in the target, but as soon as you open the project level settings it overwrites it!

@allenhumphreys
Copy link
Collaborator

A working sed script/command sed -i '' '/^[[:blank:]]*DEVELOPMENT_TEAM[[:blank:]]*=[[:blank:]]*[A-Za-z0-9]*;[[:blank:]]*$/d' WWDC.xcodeproj/project.pbxproj.

Xcode is 100% doing the wrong thing though.

@allenhumphreys
Copy link
Collaborator

I tested this out with 26 and it didn't seem to mind too much. Emitting the error and failing the build is somewhat optional, but I want to be informed!

image
if ! sed '/^[[:blank:]]*DEVELOPMENT_TEAM[[:blank:]]*=[[:blank:]]*[A-Za-z0-9]*;[[:blank:]]*$/d' WWDC.xcodeproj/project.pbxproj | cmp -s - WWDC.xcodeproj/project.pbxproj; then
    echo "error: Had to remove DEVELOPER_TEAM from the pbxproj file, build again"
    sed -i '' '/^[[:blank:]]*DEVELOPMENT_TEAM[[:blank:]]*=[[:blank:]]*[A-Za-z0-9]*;[[:blank:]]*$/d' WWDC.xcodeproj/project.pbxproj
    return 1
fi

@bo2themax bo2themax marked this pull request as ready for review September 12, 2025 09:08
@bo2themax
Copy link
Contributor Author

bo2themax commented Sep 12, 2025

@allenhumphreys

  • Moved all the scripts in the scripts folder and updated README
  • Added the script to pre-commit hooks
  • Added a step in bootstrap to set this up

Adding the script in the build phase, I think, can't avoid developers committing this change, but git hooks will warn them.

Screen.Recording.2025-09-12.at.11.05.06.mp4

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.

2 participants