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.
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.
SwiftLint runs as part of Pull Request checks and will run automatically when building the project.
We are using Github Actions alongside Fastlane to perform continuous integration both by unit testing and deploying to App Store Connect later on.
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
HOMEASSISTANT_CERTIFICATE_KEY
: The Certificate key used in MatchHOMEASSISTANT_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)
HOMEASSISTANT_TEAM_ID
: Team ID from App Store Connect MembershipHOMEASSISTANT_APP_STORE_CONNECT_TEAM_ID
: Team ID from App Store Connect. ($ pilot list
to check the number)HOMEASSISTANT_APPLE_ID
: Your Apple ID (e.g. john@apple.com)
Although all the deployment is done through Github Actions, you can do it manually through Fastlane:
bundle exec fastlane asc
See CONTRIBUTING.md
Apache-2.0
The format and some content of this README.md comes from the SwipeIt project.