{"id":23084972,"url":"https://github.com/ar-met/fastlane-plugin-unity-exporter","last_synced_at":"2025-07-14T07:39:50.566Z","repository":{"id":56845975,"uuid":"387419626","full_name":"ar-met/fastlane-plugin-unity-exporter","owner":"ar-met","description":"Plugin for 'fastlane' that defines an action to export iOS and Android projects via Unity3d. This allows Unity3d to more easily integrate with 'fastlane'.","archived":false,"fork":false,"pushed_at":"2022-03-09T13:02:55.000Z","size":151,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-23T22:45:07.145Z","etag":null,"topics":["build","export","fastlane","pipeline","plugin","unity","unity3d"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ar-met.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-19T10:06:15.000Z","updated_at":"2025-04-16T08:43:34.000Z","dependencies_parsed_at":"2022-09-17T22:22:12.896Z","dependency_job_id":null,"html_url":"https://github.com/ar-met/fastlane-plugin-unity-exporter","commit_stats":null,"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/ar-met/fastlane-plugin-unity-exporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ar-met%2Ffastlane-plugin-unity-exporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ar-met%2Ffastlane-plugin-unity-exporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ar-met%2Ffastlane-plugin-unity-exporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ar-met%2Ffastlane-plugin-unity-exporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ar-met","download_url":"https://codeload.github.com/ar-met/fastlane-plugin-unity-exporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ar-met%2Ffastlane-plugin-unity-exporter/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265257720,"owners_count":23735790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["build","export","fastlane","pipeline","plugin","unity","unity3d"],"created_at":"2024-12-16T17:41:04.759Z","updated_at":"2025-07-14T07:39:50.532Z","avatar_url":"https://github.com/ar-met.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# unity_exporter plugin\n\n[![fastlane Plugin Badge](https://rawcdn.githack.com/fastlane/fastlane/master/fastlane/assets/plugin-badge.svg)](https://rubygems.org/gems/fastlane-plugin-unity_exporter)\n\n\n## Getting Started\n\nThis project is a [_fastlane_](https://github.com/fastlane/fastlane) plugin. To get started with `fastlane-plugin-unity_exporter`, add it to your project by running:\n\n```bash\nfastlane add_plugin unity_exporter\n```\n\n\n## About unity_exporter\n\nPlugin for _fastlane_ that defines an action to export iOS and Android projects via [_Unity3d_](https://unity.com/). This allows _Unity3d_ to more easily integrate with _fastlane_. \n\nThis action works by invoking _Unity3d_ via commandline to trigger an export of your _Unity3d_ project. [Per default _Unity3d_ supports a number of different commandline arguments.](https://docs.unity3d.com/Manual/CommandLineArguments.html) Therefore there are two ways to use the plugin: Either provide your own full list of commandline arguments or let the _fastlane plugin_ help you with some of it. This becomes clearer when looking at all [available actions](#actions).\n\nFor convenience and easier versioning, there also exists the [_Unity Build Exporter_](https://github.com/ar-met/unity-build-exporter) which can be added via the [_Unity Package Manager_](https://docs.unity3d.com/Manual/Packages.html). The _Unity Build Exporter_ provides a custom execute method that parses custom commandline arguments. See [_Unity Build Exporter_](https://github.com/ar-met/unity-build-exporter) for a more in-depth explanation of the package.\n\nTo make full use of the *unity_exporter* make sure to:\n* Install the [_Unity Hub_](https://docs.unity3d.com/Manual/GettingStartedInstallingHub.html) at its default path: We use the _Unity Hub_ to get the paths of your _Unity Editor_ installations,  such that we can use the _Unity Editor_ version that matches the version used by your _Unity3d_ project when exporting a build.\n* Add the [_Unity Build Exporter_](https://github.com/ar-met/unity-build-exporter) to your _Unity3d_ project: We invoke a specific `executeMethod` ([see docs](https://docs.unity3d.com/Manual/CommandLineArguments.html) and the [readme of the package](https://github.com/ar-met/unity-build-exporter/blob/master/Assets/BuildExporter/README.md) what's that about) provided by the package to handle versioning. Note that the package also exposes a new menu item to your _Unity3d_ project that helps with setting up _fastlane_ and the *fastlane-plugin-unity_exporter*.\n\n\n## Getting Started with a blank _Unity3d_ project\n\nAssuming you don't have _fastlane_ configured yet, we propose the following:\n1) Add the [_Unity Build Exporter_](https://github.com/ar-met/unity-build-exporter) via the [_Unity Package Manager_](https://docs.unity3d.com/Manual/Packages.html) to your _Unity3d_ project\n2) Open your _Unity3d_ project and find the menu items `Build Exporter / Initialize 'fastlane' directories for Android` and `Build Exporter / Initialize 'fastlane' directories for iOS`\n3) Commit the changes to your repository\n4) Navigate to `{Unity3d-project-root}/fastlane-build-exporter/iOS/unity-export` and `{Unity3d-project-root}/fastlane-build-exporter/Android/unity-export` and `fastlane init` respectively\n5) Move the created `fastlane/` directory up one level, such that it is on the same hierarchical level as `unity-export/`\n6) Commit the changes to your repository\n7) See [Getting Started](#getting-started)\n8) Use [the actions of the plugin](#actions)\n\nWe suggest you also check out the [_example Unity3d project_](https://github.com/ar-met/fastlane-plugin-unity-exporter-example-project).\n\n\n## Actions\n\nTwo actions are provided by this plugin:\n* `fastlane action unity_export`\n* `fastlane action unity_commit_version_bump`\n\n### Using `unity_export` with parameter `arguments`\n\nNote that when writing `{path-to-unity}` we expect a path like so:\n* Mac: `/Applications/Unity/Hub/Editor/\u003cversion\u003e/Unity.app/Contents/MacOS/Unity`\n* Windows: `\"C:\\Program Files\\Unity\\Hub\\Editor\\\u003cversion\u003e\\Editor\\Unity.exe\"`\n* Linux: [see open issue](https://github.com/ar-met/fastlane-plugin-unity-exporter/issues/1)\n\n```ruby\n# for a full list of commandline arguments that are available to Unity see https://docs.unity3d.com/Manual/CommandLineArguments.html\n# uses the Unity Hub to resolve the path to a Unity Editor installation\nunity_export(arguments: \"-batchmode -nographics -quit\") \n\n# setting 'use_default_path' to 'false', will not resolve the path to a Unity Editor installation via the Unity Hub\n# a path to a Unity Editor installation is expected as part of 'arguments'\nunity_export(arguments: \"{path-to-unity} -batchmode -nographics -quit\", use_default_paths: false)\n```\n\n### Using `unity_export` with parameter `build_target` \n\n```ruby\n# will export a Xcode project\nunity_export(build_target: \"iOS\") \n\n# will export an Android project ('Export Project' is ticked, see https://docs.unity3d.com/Manual/android-BuildProcess.html)\nunity_export(build_target: \"Android\")\n\n# expects a semantic version and sets this version as the new Unity3d project version\n# for semantic versioning see https://semver.org/\nunity_export(build_target: \"...\", new_version: \"1.2.3\")\n\n# increments the major, minor or patch part of the existing semantic version\nunity_export(build_target: \"...\", new_version: \"major\")\nunity_export(build_target: \"...\", new_version: \"minor\")\nunity_export(build_target: \"...\", new_version: \"patch\")\n\n# note that the plugin will keep the version code in sync across different platforms: version code (Android) and build number (iOS) will be the same\n# expects a non-negative number and sets it as version code\nunity_export(build_target: \"...\", new_version_code: \"42\")\n\n# increments the existing version code (Android) and build number (iOS)\nunity_export(build_target: \"...\", new_version_code: \"increment\")\n\n# the expected default path is in accordance with the \"getting started\" section of this readme\n# if a custom path to the Unity project is required, it's specified this way\n# note that the starting point for relative paths is the directory that contains the 'fastlane' folder\nunity_export(build_target: \"...\", project_path: \"path/some-example-unity-projects-directory\")\n\n# exports the Unity project to the specified path\n# if no export path is specified, a default path will be used\n# note that the starting point for relative paths is the root of the Unity project\nunity_export(build_target: \"...\", export_path: \"path/some-example-builds-directory\")\n\n# combined usage of 'new_version', 'new_version_code', 'project_path' and 'export_path'\nunity_export(\n  build_target: \"...\", \n  new_version: \"2.3.4\", new_version_code: \"0\", \n  project_path: \"path/Unity-project\", export_path: \"path/Builds\")\n```\n\n### Using `unity_commit_version_bump`\n\nUses [shell commands to commit a version bump](https://github.com/ar-met/fastlane-plugin-unity-exporter/blob/master/lib/fastlane/plugin/unity_exporter/actions/unity_commit_version_bump.rb), if there is any.\n\n```ruby\n# let's say we first export the Unity3d project\nunity_export(build_target: \"...\", new_version: \"3.4.5\", new_version_code: \"0\")\n\n# after the export is finished, we commit the version bump\nunity_commit_version_bump\n\n# another invocation example that specifies a project path\n# the expected default path is in accordance with the \"getting started\" section of this readme\n# if a custom path to the Unity project is required, it's specified this way\n# note that the starting point for relative paths is the directory that contains the 'fastlane' folder\nunity_commit_version_bump(project_path: \"path/some-example-unity-projects-directory\")\n```\n\n### Using `unity_get_version_number`\n\n```ruby\n# you must first use the unity export action\nunity_export(...)\n\n# afterwards you can get the version number like so\n# note that an error code will be returned if something fails\nversion_number = unity_get_version_number\n\n# another invocation example that specifies a project path\n# the expected default path is in accordance with the \"getting started\" section of this readme\n# if a custom path to the Unity project is required, it's specified this way\n# note that the starting point for relative paths is the directory that contains the 'fastlane' folder\nversion_number = unity_get_version_number(project_path: \"path/some-example-unity-projects-directory\")\n```\n\n### Using `unity_get_build_number`\n\n```ruby\n# you must first use the unity export action\nunity_export(...)\n\n# afterwards you can get the build number like so\n# note that an error code will be returned if something fails\nbuild_number = unity_get_build_number\n\n# another invocation example that specifies a project path\n# the expected default path is in accordance with the \"getting started\" section of this readme\n# if a custom path to the Unity project is required, it's specified this way\n# note that the starting point for relative paths is the directory that contains the 'fastlane' folder\nbuild_number = unity_get_build_number(project_path: \"path/some-example-unity-projects-directory\")\n```\n\n\n## Example\n\nCheck out the [example `Fastfile`](fastlane/Fastfile) to see how to use this plugin. Try it by cloning the repo, running `fastlane install_plugins` and `bundle exec fastlane test`.\n\nAlso check out the example [_Unity3d_ project](https://github.com/ar-met/fastlane-plugin-unity-exporter-example-project) to see how this plugin works. See the repositories readme for more details.\n\n\n## Compatibility\n\nBoth this _fastlane plugin_ and the [_Unity Build Exporter_](https://github.com/ar-met/unity-build-exporter) were developed with _Unity 2020.3.13f1_. We haven't tested the plugin with any earlier versions, but we don't expect there to be any issues. If you run into trouble, regarding compatibility or anything else, [please open an issue](https://github.com/ar-met/unity-build-exporter/issues). For pull requests [see here](#pull-requests).\n\n\n## Ruby\n\nNote that this plugin requires `Ruby 2.7.4`. \n\n### Ruby on Mac\n\nInstalling ruby -- even different versions of it -- on Mac and _fastlane_ is well documented.\n\n### Ruby on Windows\n\nTo install ruby on Windows you, e.g., can use [_RubyInstaller_](https://rubyinstaller.org/downloads/). Be sure to get `Ruby 2.7.4`. After that you can use `gem` commands with Windows' command prompt and rely on _fastlane_'s documentation to get you going.\n\n\n## Pull requests\n\nWe are happy to accept [pull requests](https://github.com/ar-met/unity-build-exporter/pulls). For easier development of this plugin, we suggest you use the provided [_Unity3d_ project](https://github.com/ar-met/fastlane-plugin-unity-exporter-dev-project).\n\n\n## Run tests for this plugin\n\nTo run both the tests, and code style validation, run\n\n```\nrake\n```\n\nTo automatically fix many of the styling issues, use\n```\nrubocop -a\n```\n\n\n## Issues and Feedback\n\nFor any other issues and feedback about this plugin, please submit it to this repository.\n\n\n## Troubleshooting\n\nIf you have trouble using plugins, check out the [Plugins Troubleshooting](https://docs.fastlane.tools/plugins/plugins-troubleshooting/) guide.\n\n\n## Using _fastlane_ Plugins\n\n\nFor more information about how the `fastlane` plugin system works, check out the [Plugins documentation](https://docs.fastlane.tools/plugins/create-plugin/).\n\n\n## About _fastlane_\n\n_fastlane_ is the easiest way to automate beta deployments and releases for your iOS and Android apps. To learn more, check out [fastlane.tools](https://fastlane.tools).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Far-met%2Ffastlane-plugin-unity-exporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Far-met%2Ffastlane-plugin-unity-exporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Far-met%2Ffastlane-plugin-unity-exporter/lists"}