Developing Firefox for iOS 🦊 - my-swift-lab/firefox-ios GitHub Wiki

The Firefox for iOS project contains 1 iOS application along with 4 extensions:

  • Client.app: The main Firefox iOS client application
  • SendTo.appex: The Send Tab extension for sending tabs to other FxA-connected devices
  • ShareTo.appex: Share extension for Firefox which supports adding links to your reading list or bookmarks
  • Today.appex: Today widget with options to open tabs/links in Firefox
  • ViewLater.appex: Action extension that lets users queue up links from other applications for viewing in Firefox

Configurations and Build Variants 🛠

Firefox for iOS is broken down into 3 build variants: Fennec (used for development), Firefox Beta (TestFlight beta audience), and Firefox (App Store). The source code between these 3 variants are the same but their build configurations differ. In order to support these variants we make use of different .entitlements (found in the Client/Entitlements folder) and .xcconfig files (found in Client/Configurations). Along with the values specified in each .xcconfig file, most of the differing project settings are setup in the Project Settings so they can be applied across all of our build targets.

Schemes 🗺

To compile all of the extensions and main application, we have a few different schemes which are setup to perform different build actions.

  • Fennec: Produces a non-optimized, debuggable build used mainly for development. Only unit tests are enabled for this scheme
  • Fennec (Enterprise): Same configuration as the Fennec scheme but uses a different bundle identifier and entitlements for use on our enterprise Apple account. This is to facilitate building and deploying our releases on Buddybuild.
  • Fennec (Enterprise + UITests): Same as the above enterprise scheme but will run the UITest suite when the tests are run. This is used for our nightly integrations on Buddybuild since our UITest suite takes a significant amount of time.
  • FirefoxBeta: Produces a optimized, non-debuggable build used for deploying the application to our TestFlight audience for beta testing.
  • Firefox: Same as the above FirefoxBeta scheme but uses the main bundle identifier and entitlements for releasing to the app store.

Localization 🇫🇷

A big part of preparing a release for Firefox for iOS to the beta or app store channels is localizing the application in the many (~40) locales we support. All of our localized content lives in a separate repo located here. To import the locales into the Firefox project, we make use of Buddybuild's custom build step scripts to pull down the l10n repo and inject the locales into the .xccodeproj. For more information on which schemes are localized see the buddybuild_postclone.sh and buddybuild_prebuild.sh scripts located in the root folder of the project.

Our Branching Model 🌴

All of our development happens on the master branch. Typically features and bugs are worked on feature branches from master and tend to be prefixed by the author/bug number (ie. sleroux/Bug12345-ShortSummaryOfBug). When these features are ready, they are always landed on master first. If the patch requires uplifting to a release branch, the commit will be cherry-pick from master instead of directly from a PR. In general we try to keep master as stable as possible but as it is our main development branch issues will always occur.

When a release is code complete, a release branch is created from master and is named according to that release. For example for our 7.0 release, the branch was named v7.x. This allows us to stablize a release while continuing feature development on the next version on master.

Our Development Workflow 🌊

The Firefox for iOS team makes heavy use of Buddybuild along with the schemes we've setup for continuous integration and deployments.

  1. The development team makes use of the Fennec scheme to run debug builds and unit tests on their local machines.
  2. When commits are pushed to Github, our Buddybuild instance runs an integration using the Fennec (Enterprise) scheme. This scheme produces an enterprise artifact for in-house deployments along with running our unit test suite.
  3. On a nightly cadence, the master branch integrates using the Fennec (Enterprise + UITests) scheme which runs our full test suites. The resulting artifact is also enterprise signed so it can be deployed in-house.
  4. During our 'bake' phase of a release, Buddybuild will also run the Firefox and FirefoxBeta schemes for submissions to the App Store and TestFlight. These will only run on our release branches (v7.x, v8.x, etc)