2024-04-17 22:50:26 -05:00
2024-03-20 17:25:56 -05:00
2024-03-20 17:25:56 -05:00
2024-03-28 14:42:40 -05:00
2024-03-28 14:42:40 -05:00
2024-03-28 14:42:40 -05:00
2024-03-20 17:25:56 -05:00
2024-04-17 09:48:25 -04:00
2024-03-28 14:42:40 -05:00
2024-03-20 17:25:56 -05:00
2024-03-20 17:25:56 -05:00
2024-03-20 17:25:56 -05:00
2024-03-28 14:42:40 -05:00
2024-03-20 17:25:56 -05:00
2024-03-28 14:42:40 -05:00

Bitwarden Authenticator iOS

This repository serves as a template for others and establishes very basic structure and tooling setup for later customization.

Contents

Compatibility

  • Minimum iOS: 15.0
  • Target SDK: 15.0
  • Device Types Supported: iPhone
  • Screen Sizes Supported: iPhone SE to iPhone 14 Pro Max
  • Orientations Supported: Portrait, Landscape

Dependencies

Icons

  • The icons used in the app are all custom. No additional licensing is required.

App Dependencies

Development Dependencies

The following dependencies are used in the development environment only. They are not present in deployed code.

  • LicensePlist (MIT License) - A tool to generate a list of third-party software licenses displayed in app settings.
  • Mint (MIT License) - A package manager that installs and runs Swift command line tool packages.
  • SnapshotTesting (MIT License) - Allow a snapshot test case which renders a UI component, takes a snapshot, then compares it to a reference snapshot file stored alongside the test.
  • SwiftGen (MIT License) - A tool to automatically generate Swift code for project resources (like images, localized strings, etc), to make them type-safe to use.
  • SwiftFormat (MIT License) - A tool used to reformat Swift code to automatically adjust for some style conventions.
  • SwiftLint (MIT License) - A tool to enforce Swift style and conventions.
  • ViewInspector (MIT License) - A tool used to unit test SwiftUI views.
  • XcodeGen (MIT License) - Generates the Xcode project using the folder structure and a project spec.

Setup

  1. Clone the repository:

    $ git clone https://github.com/bitwarden/authenticator-ios
    
  2. Install Mint:

    $ brew install mint
    

    If you're using a Mac with Apple Silicon with Mint installed via Homebrew, you may see the SwiftGen build phase fail with the following error:

    line 2: mint: command not found

    If so, or if you just prefer to install Mint without brew, clone the Mint repo into a temporary directory and run make.

    $ git clone https://github.com/yonaskolb/Mint.git
    $ cd Mint
    $ make
    
  3. Bootstrap the project:

    $ Scripts/bootstrap.sh
    

    Note

    Because Scripts/bootstrap.sh is how the project is generated, bootstrap.sh will need to be run every time the project configuration or file structure has changed (for example, when files have been added, removed or moved). It is typically best practice to run bootstrap.sh any time you switch branches or pull down changes.

    Alternatively, you can create git hooks to automatically execute the bootstrap.sh script every time a git hook occurs. To use the git hook scripts already defined in the Scripts directory, copy the scripts to the .git/hooks directory.

    $ cp Scripts/post-merge .git/hooks/
    $ cp Scripts/post-checkout .git/hooks/
    

Run the App

  1. Open the project in Xcode 15.2+.
  2. Run the app in the Simulator with the Authenticator target.

Running Tests

  1. In Xcode's toolbar, select the project and a connected device or simulator.

    • The Generic iOS Device used for builds will not work for testing.
  2. In Xcode's menu bar, select Product > Test.

    • Test results appear in the Debug Area, which can be accessed from View > Debug Area > Show Debug Area if not already visible.

Linting

This project is linted using both SwiftLint and SwiftFormat. Both tools run in linting mode with every build of the Authenticator target. However, if you would like to have SwiftFormat autocorrect any issues that are discovered while linting, you can manually run the fix command mint run swiftformat ..

Additionally, if you would like SwiftFormat to autocorrect any issues before every commit, you can use a git hook script. To use the git hook script already defined in the Scripts directory, copy the script to the .git/hooks directory.

$ cp Scripts/pre-commit .git/hooks/

Project Structure

AuthenticatorShared

This project's structure is split into separate sections to support sharing as much code between all of the targets as possible. All core functionality and the majority of UI elements can be found in the AuthenticatorShared framework.

GlobalTestHelpers

GlobalTestHelpers is a directory that contains helper files used in all test targets. This directory is included in each target that is defined in the project.yml file.

Description
Bitwarden mobile app for iOS.
Readme 967 MiB
2025-08-22 11:38:25 -05:00
Languages
Swift 99.5%
Shell 0.2%
Ruby 0.2%