Developing for iOS is not always easy - our aim is to make it as simple as possible for you! In this guide, we’ll walk you through how to add an iOS app to Bitrise, how to run Xcode tests, manage your code signing files and deploy the app to bitrise.io and to the App Store.
- Adding an iOS app
- Running Xcode tests
- Code signing and exporting an .ipa
- Deploying to TestFlight and the App Store
Adding an iOS app ⚓
- Click the
+sign on the top menu bar and select
- On the Create new App page, choose the account you wish to add the app to.
- Set the privacy of the app to either Private or Public and click
- Select the Git hosting service that hosts your repository, then find and select your repository that hosts the project. Read more about connecting your repository.
- When prompted to set up repository access, click
No, auto-add SSH key. Read more about SSH keys.
- Type the name of the branch that includes your project’s configuration - master, for example - then click
Wait while Bitrise is validating your project. We look for your configuration files and set up your app based on them. In the case of an iOS app, we’re looking for your Xcode Project (
.xcodeproj) or Xcode Workspace (
IMPORTANT: the validation will fail if you do not have a SHARED scheme in your project. You can still point Bitrise manually to your Xcode scheme but if it’s shared, we automatically detect it for you. Read more about schemes and the possible issues with them!
Select the .ipa export method. You can modify this later - for now, select
Once you clicked it, you should see your:
- Project or Workspace path
- Scheme name
- ipa export method
- iOS stack
- Register a webhook when prompted so that Bitrise can start a build automatically when code is pushed to your repository, or a pull request is created. This also kicks off your first build - click the message and it will take you to the build page.
Running Xcode tests ⚓
Once you created your app, the first build will run based on the automatically created primary workflow. You can check it out in the app’s Workflow Editor: click the app’s name on your Dashboard then click the
Xcode Test for iOS
Deploy to Bitrise.io
Xcode Test for iOS step runs the pre-defined Xcode tests. It has a default configuration that does not need to be modified: if the tests are written correctly, they will work. You can find the same configuration options in Xcode, too.
Deploy to Bitrise.io will deploy the following to the
Logs and Apps & Artifacts tab of the build:
- your Xcode test results
- your raw
Code signing and exporting an .ipa ⚓
To install and test the app on other physical devices, you will need to create and export an .ipa file. This requires setting up code signing. In the example, we’ll be exporting an .ipa with the
development export method: you cannot upload such an app to Testflight but you can test it, for example, on the devices of your internal testers.
You will need:
- the automatically created
- an iOS Development certificate (a .p12 certificate file)
- a Development type Provisioning Profile
- Set the code signing type of your project in Xcode to either manual or automatic (Xcode managed), and generate an .ipa locally.
Collect and upload the code signing files with the codesigndoc tool.
The tool can also upload your code signing files to Bitrise - we recommend doing so! Otherwise, upload them manually: enter the Workflow Editor and select the
Code signingtab, then upload the files in their respective fields.
- Go to your app’s Workflow Editor, and select the
deployworkflow in the
WORKFLOWdropdown menu in the top left corner.
- Check that you have the
Certificate and profile installerStep in your workflow. It must be before the
Xcode Archive & Export for iOSStep (you can have other Steps between the two, like
Xcode Test for iOS).
Select method for exportinput of the
Xcode Archive & Export for iOSStep. By default, it should be the
$BITRISE_EXPORT_METHODenvironment variable. This variable stores the export method you selected when creating the app. If you selected
developmentback then, you don’t need to change the input. Otherwise, manually set it to
- Start a build.
If you uploaded the correct code signing files, the
Certificate and profile installer Step should install your code signing files and the
Xcode Archive & Export for iOS Step should export an .ipa with the development export method. If you have the
Deploy to Bitrise.io Step in your workflow, you can find the .ipa on the
Apps & Artifacts tab of the build page.
iOS code signing is often not this simple - read more about how iOS code signing works on Bitrise!
Deploying to TestFlight and the App Store ⚓
If you set up your code signing files and created an .ipa for your internal testers, it is time to involve external testers and then to publish your iOS app to the App Store. Let’s see how!
To deploy to Testflight and to the App Store, you will need more code signing files:
- an iOS Distribution Certificate
- an App Store type Provisioning Profile
- On your local machine, set up App Store code signing for your project in Xcode, and export an App Store .ipa. If this fails locally, it will definitely fail on Bitrise, too!
- Collect and upload the code signing files with the codesigndoc tool.
- Go to the app’s Workflow Editor and create a new workflow: click the
+ Workflowbutton, enter the name of your new workflow and in the BASED ON dropdown menu, select
deploy. This way the new workflow will be a copy of the basic
Select method for exportinput of the
Xcode Archive & Export for iOSStep to
If you wish to distribute your app to external testers without uploading the app to Testflight, select
ad-hoc. In that case, skip the next steps in the guide: you only need the
Deploy to Bitrise.ioStep in your workflow.
- Add the
Deploy to iTunes Connect - Application LoaderStep to your workflow, after the
Xcode Archive & Export for iOSStep but preferably before the
Deploy to Bitrise.ioStep.
Provide your Apple credentials in the
Deploy to iTunes Connect - Application LoaderStep.
The Step will need your:
- Apple ID
- password or, if you use two-factor authentication on iTunes Connect, your application password.
Don’t worry, the password will not be visible in the logs or exposed - that’s why it is marked SENSITIVE.
And that’s it! Start a build - if everything went well, you should see your app on Testflight. From there, you can distribute it to external testers or release it to the App Store.
Before deploying your app to the App Store, you might want to release it to external testers who can test it on their devices outside the development environment.
You can deploy an app to iTunes Connect (rebranded as App Store Connect) to invite testers on Testflight or to release your app on the App Store.
Find out the basics about deploying your iOS app using Bitrise: where you can deploy, what files you need, how to configure your app for deployment.