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

Automatic Signing Forced on iOS #28363

Open
dawidvdh opened this issue Apr 22, 2024 · 1 comment
Open

Automatic Signing Forced on iOS #28363

dawidvdh opened this issue Apr 22, 2024 · 1 comment
Labels
CLI Versioned Expo CLI -- `npx expo start`

Comments

@dawidvdh
Copy link

Summary

When setting the code sign style to manual and providing provisioning profiles in Xcode it will always be reset to automatic signing when running expo.

I have reviewed the docs and even gone as far as building a config plugin to force the xcode project to be set to manual signing with certain provisioning profiles:

import {ConfigPlugin, IOSConfig, withXcodeProject} from '@expo/config-plugins'

const withManualSigning: ConfigPlugin = config => {
  return withXcodeProject(config, async config => {
    const project = config.modResults
    const targets = IOSConfig.Target.findSignableTargets(project)

    targets.forEach(([nativeTargetId, nativeTarget]) => {
      IOSConfig.XcodeUtils.getBuildConfigurationsForListId(
        project,
        nativeTarget.buildConfigurationList
      ).forEach(config => {
        const [, item] = config
        item.buildSettings.CODE_SIGN_STYLE = 'Manual'
        item.buildSettings.DEVELOPMENT_TEAM = '""'
        item.buildSettings.PROVISIONING_PROFILE_SPECIFIER =
          '"match Development com.app.sample"'
      })

      Object.entries(IOSConfig.XcodeUtils.getProjectSection(project))
        .filter(IOSConfig.XcodeUtils.isNotComment)
        .forEach(([, item]) => {
          if (!item.attributes.TargetAttributes[nativeTargetId]) {
            item.attributes.TargetAttributes[nativeTargetId] = {}
          }
          item.attributes.TargetAttributes[nativeTargetId].ProvisioningStyle =
            'Manual'
          item.attributes.TargetAttributes[nativeTargetId].DevelopmentTeam =
            '""'
        })
    })

    return config
  })
}

export default withManualSigning

However without fail whenever I run expo run ios it will always set the signing back to Automatic, which I believe is a symptom of the setAutoCodeSigningInfoForPbxproj method that appears to be called whenever all the targets have a team.

Can this be overridden in anyway? we have recently started migrating to expo and this is a bit of a blocker for us to continue with our migration and I would love to know if there is something I am missing to avoid this.

What platform(s) does this occur on?

iOS

SDK Version

50.0.17

Environment

expo-env-info 1.2.0 environment info:
System:
OS: macOS 14.3
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.8.0 - ~/.cache/fnm_multishells/98231_1713774848055/bin/node
Yarn: 3.6.3 - ~/.cache/fnm_multishells/98231_1713774848055/bin/yarn
npm: 10.1.0 - ~/.cache/fnm_multishells/98231_1713774848055/bin/npm
Watchman: 2024.03.25.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /Users/dawid/.rbenv/shims/pod
SDKs:
iOS SDK:
Platforms: DriverKit 23.4, iOS 17.4, macOS 14.4, tvOS 17.4, visionOS 1.1, watchOS 10.4
IDEs:
Android Studio: 2023.1 AI-231.9392.1.2311.11330709
Xcode: 15.3/15E204a - /usr/bin/xcodebuild
npmPackages:
expo: ~50.0.17 => 50.0.17
react: 18.2.0 => 18.2.0
react-native: 0.73.6 => 0.73.6
Expo Workflow: bare

Minimal reproducible example

I am happy to supply a minimal reproducible example if thats required but I think the problem is relatively evident in the code and the previous explanation.

@dawidvdh dawidvdh added CLI Versioned Expo CLI -- `npx expo start` needs validation Issue needs to be validated labels Apr 22, 2024
@expo-bot expo-bot removed the needs validation Issue needs to be validated label Apr 22, 2024
@dawidvdh
Copy link
Author

The Answer here was seemingly setting the team id, even though the CLI will report Auto signing app using team(s): XXXXX it will actually still be set to manual, it would be great if this could just be configured through the app config.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLI Versioned Expo CLI -- `npx expo start`
Projects
None yet
Development

No branches or pull requests

2 participants