/iOS

:iphone: Home Assistant Companion for iOS

Primary LanguageSwiftOtherNOASSERTION

Home Assistant for Apple Platforms

TestFlight Beta invite Download on the App Store GitHub issues License Apache 2.0

Getting Started

Home Assistant uses Bundler, Cocoapods and Swift Package Manager to manage build dependencies. You'll need Xcode 12.1 (or later) which you can download from the App Store. You can get this running using the following commands:

git clone https://github.com/home-assistant/iOS.git
cd iOS
[sudo] gem install bundler
bundle install
bundle exec pod install --repo-update

Once this completes, you can launch HomeAssistant.xcworkspace and run the Debug target onto your simulator or iOS device.

Code Signing

Although the app is set up to use Automatic provisioning for Debug builds, you'll need to customize a few of the options. This is because the app makes heavy use of entitlements that require code signing, even for simulator builds.

Edit the file Configuration/HomeAssistant.overrides.xcconfig (which will not exist by default and is ignored by git) and add the following:

DEVELOPMENT_TEAM = YourTeamID
BUNDLE_ID_PREFIX = some.bundle.prefix

Xcode should generate provisioning profiles in your Team ID and our configuration will disable features your team doesn't have like Critical Alerts. You can find your Team ID on Apple's developer portal.

Code style

SwiftLint runs as part of Pull Request checks and will run automatically when building the project.

Continuous Integration

We are using Github Actions alongside Fastlane to perform continuous integration both by unit testing and deploying to App Store Connect later on.

Environment variables

To make sure Fabric and App Store Connect can deploy, make sure you have them set to something similar to the following environment variables. The values are only examples!.

Note: For ENV variables to work in Xcode you to set $ defaults write com.apple.dt.Xcode UseSanitizedBuildSystemEnvironment -bool NO and launch Xcode from the terminal. Apple Developer Forums

Signing

  • HOMEASSISTANT_CERTIFICATE_KEY: The Certificate key used in Match
  • HOMEASSISTANT_CERTIFICATE_USER: The username for the git being where Match is saving the Certificates.
  • HOMEASSISTANT_CERTIFICATE_TOKEN: The access token for the git being where Match is saving the Certificates.
  • HOMEASSISTANT_CERTIFICATE_GIT: The address or the git being where Match is saving the Certificates. (e.g. https://gitlab.com/username/Certificates)

App Store Connect deployment

Deployment

Although all the deployment is done through Github Actions, you can do it manually through Fastlane:

Deployment to App Store Connect

bundle exec fastlane asc

Contributing

See CONTRIBUTING.md

LICENSE

Apache-2.0

Credits

The format and some content of this README.md comes from the SwipeIt project.