This sample app is available at https://github.com/skiptools/skipapp-hello.git, which can be checked out and run once Skip is installed.
HelloSkip
This is a Skip dual-platform app project. It builds a native app for both iOS and Android.
Building
This project is both a stand-alone Swift Package Manager module, as well as an Xcode project that builds and transpiles the project into a Kotlin Gradle project for Android using the Skip plugin.
Building the module requires that Skip be installed using
Homebrew with brew install skiptools/skip/skip
.
This will also install the necessary transpiler prerequisites: Kotlin, Gradle, and the Android build tools.
Installation prerequisites can be confirmed by running skip checkup
.
Testing
The module can be tested using the standard swift test
command
or by running the test target for the macOS destination in Xcode,
which will run 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 will output a table of the test results for both platforms.
Running
Xcode and Android Studio must be downloaded and installed in order to run the app in the iOS simulator / Android emulator. An Android emulator must already be running, which can be launched from Android Studioβs Device Manager.
To run both the Swift and Kotlin apps simultaneously, launch the HelloSkipApp target from Xcode. A build phases runs the βLaunch Android APKβ script that will deploy the transpiled app a running Android emulator or connected device. Logging output for the iOS app can be viewed in the Xcode console, and in Android Studioβs logcat tab for the transpiled Kotlin app.
Project Structure
.
βββ Android
βΒ Β βββ app
βΒ Β βΒ Β βββ build.gradle.kts
βΒ Β βΒ Β βββ proguard-rules.pro
βΒ Β βΒ Β βββ src
βΒ Β βΒ Β βββ main
βΒ Β βΒ Β βββ AndroidManifest.xml
βΒ Β βΒ Β βββ kotlin
βΒ Β βΒ Β βΒ Β βββ hello
βΒ Β βΒ Β βΒ Β βββ skip
βΒ Β βΒ Β βΒ Β βββ Main.kt
βΒ Β βΒ Β βββ res
βΒ Β βΒ Β βββ mipmap-hdpi
βΒ Β βΒ Β βΒ Β βββ ic_launcher.png
βΒ Β βΒ Β βββ mipmap-mdpi
βΒ Β βΒ Β βΒ Β βββ ic_launcher.png
βΒ Β βΒ Β βββ mipmap-xhdpi
βΒ Β βΒ Β βΒ Β βββ ic_launcher.png
βΒ Β βΒ Β βββ mipmap-xxhdpi
βΒ Β βΒ Β βΒ Β βββ ic_launcher.png
βΒ Β βΒ Β βββ mipmap-xxxhdpi
βΒ Β βΒ Β βββ ic_launcher.png
βΒ Β βββ gradle
βΒ Β βΒ Β βββ wrapper
βΒ Β βΒ Β βββ gradle-wrapper.properties
βΒ Β βββ gradle.properties
βΒ Β βββ settings.gradle.kts
βββ Darwin
βΒ Β βββ Assets.xcassets
βΒ Β βΒ Β βββ AccentColor.colorset
βΒ Β βΒ Β βΒ Β βββ Contents.json
βΒ Β βΒ Β βββ AppIcon.appiconset
βΒ Β βΒ Β βΒ Β βββ AppIcon-20@2x.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-20@2x~ipad.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-20@3x.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-20~ipad.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-29.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-29@2x.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-29@2x~ipad.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-29@3x.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-29~ipad.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-40@2x.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-40@2x~ipad.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-40@3x.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-40~ipad.png
βΒ Β βΒ Β βΒ Β βββ AppIcon-83.5@2x~ipad.png
βΒ Β βΒ Β βΒ Β βββ AppIcon@2x.png
βΒ Β βΒ Β βΒ Β βββ AppIcon@2x~ipad.png
βΒ Β βΒ Β βΒ Β βββ AppIcon@3x.png
βΒ Β βΒ Β βΒ Β βββ AppIcon~ios-marketing.png
βΒ Β βΒ Β βΒ Β βββ AppIcon~ipad.png
βΒ Β βΒ Β βΒ Β βββ Contents.json
βΒ Β βΒ Β βββ Contents.json
βΒ Β βββ Entitlements.plist
βΒ Β βββ HelloSkip.xcconfig
βΒ Β βββ HelloSkip.xcodeproj
βΒ Β βΒ Β βββ project.pbxproj
βΒ Β βΒ Β βββ project.xcworkspace
βΒ Β βΒ Β βΒ Β βββ xcshareddata
βΒ Β βΒ Β βΒ Β βββ swiftpm
βΒ Β βΒ Β βΒ Β βββ Package.resolved
βΒ Β βΒ Β βΒ Β βββ configuration
βΒ Β βΒ Β βββ xcuserdata
βΒ Β βΒ Β βββ marc.xcuserdatad
βΒ Β βΒ Β βββ xcschemes
βΒ Β βΒ Β βββ xcschememanagement.plist
βΒ Β βββ Sources
βΒ Β βββ HelloSkipAppMain.swift
βββ Package.swift
βββ README.md
βββ Skip.env
βββ Sources
βΒ Β βββ HelloSkip
βΒ Β βββ ContentView.swift
βΒ Β βββ HelloSkip.swift
βΒ Β βββ HelloSkipApp.swift
βΒ Β βββ Resources
βΒ Β βΒ Β βββ Localizable.xcstrings
βΒ Β βββ Skip
βΒ Β βββ skip.yml
βββ Tests
βββ HelloSkipTests
βββ HelloSkipTests.swift
βββ Resources
βΒ Β βββ TestData.json
βββ Skip
βΒ Β βββ skip.yml
βββ XCSkipTests.swift