Skip to content
Skip
3.1k

Ahoy Skipper (Split Fuse)

This is a Skip dual-platform sample app: from a single Swift and SwiftUI codebase it builds a native app for both iOS and Android. AhoySkipper is a natively-compiled app (Skip Fuse mode) split into two modules — the AhoySkipper app and a separate SkipperModel model layer, both compiled natively for Android — with unit tests for each module.

It is one of four Skip sample apps that share the same conventional Skip app project layout but differ in their module structure and Skip mode, as shown below.

SampleModulesSkip mode
skipapp-helloHelloSkipfully transpiled — Skip Lite
skipapp-howdyHowdySkipfully native — Skip Fuse
skipapp-ahoyAhoySkipper, SkipperModelfully native — Skip Fuse
skipapp-hiyaHiyaSkip, HiyaSkipModel, HiyaSkipLogicmixed — native model bridged to a transpiled UI

In transpiled (“Skip Lite”) modules, Swift is converted to Kotlin and SwiftUI to Jetpack Compose. In native (“Skip Fuse”) modules, Swift is compiled directly for Android with the Swift toolchain and bridged to Kotlin/Jetpack Compose; see Native and Transpiled Modes for the distinction. skipapp-hello, skipapp-ahoy, and skipapp-hiya include unit tests that run on both platforms; skipapp-howdy omits them.

This repository is exactly what skip init produces — its CI verifies that it stays identical to the generated template — so it can be re-created with:

skip init --no-build --native-app --module-tests --appid=ahoy.skipper --version 1.0.0 skipapp-ahoy AhoySkipper SkipperModel

This project is both a stand-alone Swift Package Manager package and an Xcode project that builds the iOS app and, using the skipstone plugin, generates and builds the equivalent Kotlin Gradle project for Android.

The app can be tested with the standard swift test command, or by running the test target for the macOS destination in Xcode, which runs the Swift tests as well as the transpiled Kotlin JUnit tests in the Robolectric Android simulation environment. Parity testing can be performed with skip test, which outputs a table comparing the test results on both platforms.

Xcode and Android Studio must both be installed to run the app in the iOS simulator and the Android emulator. Start an Android emulator first (for example, from Android Studio’s Device Manager).

Open Project.xcworkspace in Xcode and run the “AhoySkipper App” scheme. A build phase runs the “Launch Android APK” script, which deploys the app to a running Android emulator or connected device alongside the iOS build. iOS logs appear in the Xcode console; Android logs appear in Android Studio’s Logcat tab (or via adb logcat).

We welcome contributions to this package in the form of enhancements and bug fixes.

The general flow for contributing to this and any other Skip package is:

  1. Fork this repository and enable actions from the “Actions” tab
  2. Check out your fork locally
  3. When developing alongside a Skip app, add the package to a shared workspace to see your changes incorporated in the app
  4. Push your changes to your fork and ensure the CI checks all pass in the Actions tab
  5. Add your name to the Skip Contributor Agreement
  6. Open a Pull Request from your fork with a description of your changes