📱 Home Assistant for Apple platforms
Go to file
Bruno Pantaleão Gonçalves 6d641e806e
Auto open share sheet after download (#3295)
<!-- Thank you for submitting a Pull Request and helping to improve Home
Assistant. Please complete the following sections to help the processing
and review of your changes. Please do not delete anything from this
template. -->

## Summary
<!-- Provide a brief summary of the changes you have made and most
importantly what they aim to achieve -->

## Screenshots
<!-- If this is a user-facing change not in the frontend, please include
screenshots in light and dark mode. -->

## Link to pull request in Documentation repository
<!-- Pull requests that add, change or remove functionality must have a
corresponding pull request in the Companion App Documentation repository
(https://github.com/home-assistant/companion.home-assistant). Please add
the number of this pull request after the "#" -->
Documentation: home-assistant/companion.home-assistant#

## Any other notes
<!-- If there is any other information of note, like if this Pull
Request is part of a bigger change, please include it here. -->
2024-12-23 14:01:55 +01:00
.github GitHub Actions: Bump codecov/codecov-action from 5.1.1 to 5.1.2 in the dependencies group (#3290) 2024-12-23 08:24:28 +01:00
Configuration Bump 2024.12.3 (#3291) 2024-12-23 08:23:57 +00:00
HomeAssistant.xcodeproj Fetch panels instead of subscribe (#3275) 2024-12-16 15:25:59 +01:00
HomeAssistant.xcworkspace Remove SPM (🎉) and upgrade deps (#1242) 2020-10-25 20:13:52 -07:00
Sources Auto open share sheet after download (#3295) 2024-12-23 14:01:55 +01:00
Tests Fallback to internal URL until location enforcement is communicated c… (#3276) 2024-12-16 16:48:31 +01:00
Tools Update dependencies (#2306) 2023-02-10 10:24:33 -08:00
WatchApp/Assets.xcassets Update logo (#2418) 2023-10-09 09:06:30 -07:00
fastlane Update ci.yml - macOS-15 image (#3160) 2024-11-14 13:33:19 +01:00
icons Update logo (#2418) 2023-10-09 09:06:30 -07:00
.env.sample Move size task into ci action (#2239) 2022-10-24 09:35:14 -07:00
.gitattributes Add .gitattributes file to fix pbxproj issues 2017-01-03 15:19:28 -08:00
.gitignore APNS server in Vapor (#2024) 2021-12-26 00:23:33 -08:00
.rubocop.yml Bump ruby version, macOS version for distribute & upgrade all the gems (#2181) 2022-08-15 21:09:07 -07:00
.ruby-version Bump ruby version, macOS version for distribute & upgrade all the gems (#2181) 2022-08-15 21:09:07 -07:00
.swiftformat Update swift lint and format + appy fixes (#2585) 2024-02-22 13:06:39 +01:00
.swiftlint.yml Update swift lint and format + appy fixes (#2585) 2024-02-22 13:06:39 +01:00
.yamllint.yml Github Actions cleanup and linting additions (#1461) 2021-02-04 23:27:26 -08:00
Brewfile Strip Cocoapods frameworks on build (#2234) 2022-10-20 14:45:44 -07:00
CLA.md Update LICENSE.md and CLA.md to reflect the new Apache 2.0 license 2017-01-28 12:12:23 -08:00
CODE_OF_CONDUCT.md Update Code of Conduct to 2.0 2020-05-25 23:39:20 +02:00
CONTRIBUTING.md Update repo name and URL in CONTRIBUTING docs (#2210) 2022-09-30 16:27:39 +00:00
Gemfile Add iOS 18 icons and update pipeline (#2923) 2024-08-28 18:34:28 +02:00
Gemfile.lock Add iOS 18 icons and update pipeline (#2923) 2024-08-28 18:34:28 +02:00
LICENSE.md Update LICENSE.md and CLA.md to reflect the new Apache 2.0 license 2017-01-28 12:12:23 -08:00
Podfile Improv CarPlay states subscription (#3236) 2024-12-05 15:03:29 +01:00
Podfile.lock Improv CarPlay states subscription (#3236) 2024-12-05 15:03:29 +01:00
README.md Add OHF logo to README (#3074) 2024-09-30 15:06:54 +00:00
codecov.yaml Github Actions cleanup and linting additions (#1461) 2021-02-04 23:27:26 -08:00
swiftgen.yml Migrate client events list to SwiftUI and GRDB for database (#3206) 2024-11-28 04:43:38 +01:00
swiftgen.yml.file-list.in Update Localized Strings (#2505) 2024-01-03 23:48:30 +00:00
swiftgen.yml.file-list.out Update Localized Strings (#2505) 2024-01-03 23:48:30 +00:00

README.md

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, Homebrew and Cocoapods to manage build dependencies. You'll need Xcode 15.3 (or later) which you can download from the App Store. You can get the app running using the following commands:

git clone https://github.com/home-assistant/iOS.git
cd iOS

# you must do one of the following, but you do not need to do all of them:

## install cocoapods via homebrew, use that
brew install cocoapods
$(brew --prefix)/opt/ruby/bin/gem install cocoapods-acknowledgements
pod install --repo-update

## install ruby via homebrew, use that
brew install ruby@3.1
$(brew --prefix)/opt/ruby@3.1/bin/bundle install
$(brew --prefix)/opt/ruby@3.1/bin/bundle exec pod install --repo-update

## install ruby via rbenv, use that
brew install rbenv ruby-build
rbenv install
bundle install
bundle exec pod install --repo-update

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

Testing just the frontend

To just test the frontend, you can use a simulator version built by our GitHub actions.

  1. Install Xcode from the App Store making sure it's at least the version noted above. You do not need to install or run anything else.
  2. Launch the simulator at /Applications/Xcode.app/Contents/Developer/Applications/Simulator.app or in Xcode under the Xcode menu > Open Developer Tool.
  3. Open a simulator under File > Open Simulator. You can install older versions of iOS in Xcode's Components preferences.
  4. Download a simulator build from the the GitHub action under "Artifacts."
  5. Drag the result .app on drop it on top of the simulator.
  6. Locate the app on the home screen and click it to launch.

The simulator behaves different than you might expect:

Action Effect
Click Tap
Click & drag Scroll
Hold ⌥ Add a second touch point
Hold ⇧⌥ Move both touch points
⌘←, ⌘→ Rotate
⌘S Take screenshot
⌘R Record video
⌘K Toggle software keyboard

You can now debug the WebView in this simulator build using Safari's Web Inspector:

  1. Make sure "Show Develop menu in menu bar" is enabled in Safari's Advanced preferences.
  2. Under the Develop menu, expand the "Simulator" menu for the simulator you've opened.
  3. Choose the WebView you want to inspect. A new window will open.

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; it looks something like ABCDEFG123.

Code style

Linters run as part of Pull Request checks. Additionally, some linting requirements can be autocorrected.

# checks for linting problems, doesn't fix
bundle exec fastlane lint
# checks for linting problems and fixes them
bundle exec fastlane autocorrect

In the Xcode project, the autocorrectable linters will not modify your source code but will provide warnings. This project uses several linters:

Continuous Integration

We use Github Actions alongside Fastlane to perform continuous integration both by unit testing and deploying to App Store Connect. Mac Developer ID builds are available as an artifact on every build of master.

Environment variables

Fastlane scripts read from the environment or .env file for configuration like team IDs. See .env.sample for available values.

Deployment

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

Deployment to App Store Connect

# creates the builds and uploads to the app store
# each save their artifacts to build/
bundle exec fastlane mac build
bundle exec fastlane ios build

Contributing

See CONTRIBUTING.md

LICENSE

Apache-2.0

Credits

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

Home Assistant - A project from the Open Home Foundation