Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

code signing xcode projects automatically in development #3317

Merged
merged 7 commits into from
Mar 22, 2021

Conversation

EvanBacon
Copy link
Contributor

Why

Right now, if you build a new iOS app onto a physical iOS device (not simulator), the CLI will throw an error regarding code signing. The only way to resolve this error is to open Xcode and configure code signing manually, at this point most users will continue to use Xcode for their app development. This PR introduces a solution to this problem which creates a seamless experience for most users so they never need to open Xcode.

When using the new iOS build command expo run:ios (still in alpha), we'll automatically configure code signing directly from the CLI. This feature is unique to expo-cli and afaik never been done before in the React ecosystem so it should be a pretty nice new feature for users developing native apps locally, outside of the Expo client app.

How

  • If the app already has code signing setup (subsequent runs) then continue to build the app and do nothing new.
  • If the user has no code signing accounts set up (probably their first time doing iOS dev on the computer), then instruct them how to do so with this new tutorial https://github.com/expo/fyi/blob/master/setup-xcode-signing.md
  • If there are more than one code signing accounts on the computer, then prompt the user on which one we should sign the app with.
    • This preference is saved in the project so we don't need to prompt them every time.
  • Pass the selected code signing account to the xcode build account manually.

Test Plan

  • npx create-react-native-app -t blank -- create a new blank project, the project should not have an iOS project with code signing set up.
  • With a physical iOS device connect to your computer, run expo run:ios -d and select the physical device.
  • If you have more than one developer account in xcode, then you should be prompted to select which account to use.
  • After selecting a code signing account, the pbxproj should be modified and xcode build should start running
  • The app should build directly onto your device with no reason to open xcode.
  • Run expo run:ios -d again and you should not be prompted to choose code signing as expo cli will use the preconfigured code signing account. If you open xcode, you should notice that the account you selected is also represented in the Xcode UI.

Unit Tests

  • I've also unit tested some of the more simple functionality like regexes.
@EvanBacon EvanBacon merged commit 4caaa8d into master Mar 22, 2021
@EvanBacon EvanBacon deleted the @evanbacon/cli/auto-sign-xcode-project branch March 22, 2021 22:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
1 participant