Xcode 16.2: Unsigned IPA uses older SDK version (17.5 instead of 18.2)

Hellp

I'm facing an issue with Xcode 16.2 when building iOS apps for different clients.

I have a white-label app, and I build:

  • A signed IPA for some clients
  • An unsigned IPA for others

For the signed app, I use:

/usr/bin/xcodebuild \
  -sdk iphoneos18.2 \
  -configuration Release-*** \
  -workspace /Users/runner/work/1/s/ios/Runner.xcworkspace \
  -scheme Runner \
  build -verbose \
  CODE_SIGN_STYLE=Manual \
  CODE_SIGN_IDENTITY=XXXXXXXX \
  PROVISIONING_PROFILE=XXXXXXXXX \
  PROVISIONING_PROFILE_SPECIFIER=XXXXXX

For the unsigned app, I use:

/usr/bin/xcodebuild \
  -sdk iphoneos18.2 \
  -configuration Release-*** \
  -workspace /Users/runner/work/1/s/ios/Runner.xcworkspace \
  -scheme Runner \
  build \
  CODE_SIGNING_ALLOWED=NO

When I inspect the resulting Runner binary:

  • The signed IPA correctly shows SDK 18.2
  • The unsigned IPA shows SDK 17.5

Why is the unsigned build using SDK 17.5 even though I explicitly specify -sdk iphoneos18.2 ?

To check the SDK version used in the compiled binary, I use the following Python script with the lief library:

import lief

binary_path = "Runner"  # Path to the extracted binary

binary = lief.parse(binary_path)

for command in binary.commands:
    if command.command.name == "BUILD_VERSION":
        for attr in dir(command):
            if not attr.startswith('_'):
                try:
                    value = getattr(command, attr)
                    print(f"  {attr}: {value}")
                except Exception as e:
                    print(f"  {attr}: <error {e}>")
        print('-' * 40)

Thanks in advance for your help!

Answered by FlorentM35 in 852392022

i have found my problem, when xcodebuild is run with signing, he rebuild the Runner binary, but without he don't, so i need to select my xcode version before xcodebuil run

Accepted Answer

i have found my problem, when xcodebuild is run with signing, he rebuild the Runner binary, but without he don't, so i need to select my xcode version before xcodebuil run

Xcode 16.2: Unsigned IPA uses older SDK version (17.5 instead of 18.2)
 
 
Q