{"id":13496690,"url":"https://github.com/flowkey/swift-android-toolchain","last_synced_at":"2026-01-19T10:07:03.220Z","repository":{"id":34878417,"uuid":"117715895","full_name":"flowkey/swift-android-toolchain","owner":"flowkey","description":"Build Swift for Android from your Mac","archived":false,"fork":false,"pushed_at":"2025-12-23T20:33:16.000Z","size":52934,"stargazers_count":50,"open_issues_count":3,"forks_count":6,"subscribers_count":16,"default_branch":"master","last_synced_at":"2025-12-25T10:46:57.198Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/flowkey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"licenses/CLANG","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-01-16T17:21:02.000Z","updated_at":"2025-12-23T20:33:19.000Z","dependencies_parsed_at":"2024-10-25T17:58:10.030Z","dependency_job_id":"0615be51-29af-45f8-b33d-b99efcdde0fa","html_url":"https://github.com/flowkey/swift-android-toolchain","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/flowkey/swift-android-toolchain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowkey%2Fswift-android-toolchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowkey%2Fswift-android-toolchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowkey%2Fswift-android-toolchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowkey%2Fswift-android-toolchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/flowkey","download_url":"https://codeload.github.com/flowkey/swift-android-toolchain/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/flowkey%2Fswift-android-toolchain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28565060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T08:53:44.001Z","status":"ssl_error","status_checked_at":"2026-01-19T08:52:40.245Z","response_time":67,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T19:01:56.959Z","updated_at":"2026-01-19T10:07:03.204Z","avatar_url":"https://github.com/flowkey.png","language":"Shell","readme":"# swift-android-toolchain\n\nBuild Swift for Android from Mac\n\n## Installation\n\n### For use within a specific project\n\n1. Add `swift-android-toolchain` as a git submodule\n2. Use `./path-to-submodule/swift-build.sh` wherever needed\n\n[UIKit-cross-platform](https://github.com/flowkey/UIKit-cross-platform) uses this method (along with the Android Studio integration, below).\n\n### For use globally from the command line\n\n1. Clone the repo\n1. Add the cloned destination to your `PATH` environment variable (e.g. in `~/.bash_profile` or equivalent)\n\n## Usage\n\n### In Android Studio / Gradle\n\nYou probably want Gradle to compile your native sources automatically when building the android app. In order to achieve this, you have to create another `CMakeLists.txt` file and reference it from `app/build.gradle`.\n\n```Gradle\nexternalNativeBuild {\n    cmake {\n        version \"3.16.2\"\n        path \"CMakeLists.txt\" // android/app/src/CMakeLists.txt\n    }\n}\n```\n\nIn `android/app/src/CMakeLists.txt`, add the following code after the `cmake_minimum_required(VERSION x.y.z)` declaration.\n\n```CMake\n# destination of project level CMakeLists.txt for building native sources\nget_filename_component(PROJECT_DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/../../ ABSOLUTE)\n\n# path to swift-android-toolchain\nset(BuildSwiftProject_DIR ../../swift-android-toolchain)\nfind_package(BuildSwiftProject REQUIRED)\n\nbuild_swift_project(\n    PROJECT_DIRECTORY ${PROJECT_DIRECTORY}\n)\n```\n\nCheck out [getting-started](https://github.com/flowkey/UIKit-cross-platform/tree/master/samples/getting-started) for a working example.\n\n### From the command line\n\n```bash\nANDROID_ABI=\"armeabi-v7a\" CMAKE_BUILD_TYPE=\"Debug\" swift-build.sh\n```\n\n#### MacOS file permissions\n\nSince we use downloaded versions of the swift toolchain and Android NDK in this build, MacOS complains about potential security issues. Running the build might show you alerts for every binary that is invoked by the build script, asking to manually grant permissions.\n\nRunning the [`fixMacOSPermissions.sh`](fixMacOSPermissions.sh) script, after setup, but before invoking the build, should resolve this issue.\n\n## Credits\n\nMaking this toolchain was only possible by standing on the shoulders of giants.\n\nMany thanks to [Vlad Gorlov](https://github.com/vgorloff) for his great work with the [swift-everywhere-toolchain](https://github.com/vgorloff/swift-everywhere-toolchain), [Gonzalo Lorralde](https://github.com/gonzalolarralde) for [swifty-robot-environment](https://github.com/gonzalolarralde/swifty-robot-environment) and [John Holdsworth](https://github.com/johnno1962) for his [android_toolchain](https://github.com/SwiftJava/android_toolchain). And to the Swift community as a whole for their ongoing work at making the language great.\n","funding_links":[],"categories":["Shell"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowkey%2Fswift-android-toolchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fflowkey%2Fswift-android-toolchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fflowkey%2Fswift-android-toolchain/lists"}