Skip to content

WatchOS compatibility #33

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
zifeo opened this issue Apr 5, 2025 · 4 comments
Open

WatchOS compatibility #33

zifeo opened this issue Apr 5, 2025 · 4 comments

Comments

@zifeo
Copy link

zifeo commented Apr 5, 2025

Currently: error: While building for watchOS Simulator, no library for this platform was found in '/Users/USER/Library/Developer/Xcode/DerivedData/kite_and_work-fusbjqcfyjsuraegryjkczwuruaj/SourcePackages/artifacts/powersync-kotlin/PowerSyncKotlin/PowerSyncKotlin.xcframework'

Is this supported?

@simolus3
Copy link
Contributor

simolus3 commented Apr 7, 2025

At the moment, we support iOS only. We don't want things to stay that way forever (adding macOS support is in progress, we're currently trying to work our way around some limitations of our dependencies to enable that).

Generally, it looks like there isn't anything that fundamentally prevents watchOS / tvOS support either (our core extension is written in Rust which should support this, and our upstream Kotlin multiplatform dependencies used to implement the Swift SDK should support this too). So while it's not on our roadmap at this point (you might be the first one asking for it), I think it's something that we could support in the future given enough interest.

@zifeo
Copy link
Author

zifeo commented Apr 8, 2025

@simolus3 Would you share some technical direction? I am happy to investigate & contribute back.

@simolus3
Copy link
Contributor

simolus3 commented Apr 8, 2025

Awesome, thanks for offering to help! Basically, most of the Swift SDK is either:

  • using this loadable extension for SQLite. The extension is re-used across all our PowerSync SDKs and contains code to apply downloaded changes from the sync service as well as tracking local writes. This is written in Rust and we ship this as an xcframework on Apple platforms (currently iOS and macOS). We're already using Rust nightly so the tier 3 targets for watchOS shouldn't be a problem. To me, it sounds like adding watchOS support would involve adding compiler flags, installing these targets for CI (here and here) and finally changing our xcframework build script to include the new platforms.
  • implemented in Kotlin. Adding watchOS support here should be a lot easier after macOS support gets merged. I assume it would simply involve adding new targets to this block (we need watchosSimulatorArm64, watchosX64, watchosArm32 (okay maybe we can skip that one), watchosArm64 and watchosDeviceArm64). Our SDK compiles and links SQLite statically on Apple platforms, so this block needs entries for watchOS as well. We also need to test our SDK in the simulator, which would involve linking our framework here.

So there are quite a few steps, but I hope they're all rather straightforward (I'm also happy to give more pointers or take care of these steps, but as I've said it's not a huge priority for us at the moment). It might be that watchOS doesn't support some of the platform APIs we need, but from a quick look the most concerning one is our sync client which uses an HTTP stream that should be supported on watchOS as well.

@zifeo
Copy link
Author

zifeo commented May 11, 2025

@simolus3 I just added an attempt for 1. though I am not convinced of the approach: https://github.com/powersync-ja/powersync-sqlite-core/pull/73/files. Feedback is appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants