{"id":20790575,"url":"https://github.com/brainiumllc/cargo-mobile","last_synced_at":"2025-05-15T05:07:17.171Z","repository":{"id":37608962,"uuid":"285638969","full_name":"BrainiumLLC/cargo-mobile","owner":"BrainiumLLC","description":"Rust on mobile made easy!","archived":false,"fork":false,"pushed_at":"2024-01-04T21:56:21.000Z","size":1126,"stargazers_count":1292,"open_issues_count":38,"forks_count":50,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-05-15T05:07:10.255Z","etag":null,"topics":["android","android-studio","ios","mobile","rust","xcode"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BrainiumLLC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","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}},"created_at":"2020-08-06T18:07:36.000Z","updated_at":"2025-05-13T18:27:58.000Z","dependencies_parsed_at":"2024-11-17T15:40:39.088Z","dependency_job_id":"cd3f707d-e793-4cb0-a193-b0b4ef03ba67","html_url":"https://github.com/BrainiumLLC/cargo-mobile","commit_stats":{"total_commits":481,"total_committers":19,"mean_commits":25.31578947368421,"dds":"0.18295218295218296","last_synced_commit":"38e48c3373b23e90ab0392a651925f67af48076e"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainiumLLC%2Fcargo-mobile","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainiumLLC%2Fcargo-mobile/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainiumLLC%2Fcargo-mobile/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BrainiumLLC%2Fcargo-mobile/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BrainiumLLC","download_url":"https://codeload.github.com/BrainiumLLC/cargo-mobile/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254276447,"owners_count":22043867,"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":["android","android-studio","ios","mobile","rust","xcode"],"created_at":"2024-11-17T15:35:55.267Z","updated_at":"2025-05-15T05:07:12.141Z","avatar_url":"https://github.com/BrainiumLLC.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# cargo-mobile\n\n*The answer to \"how do I use Rust on iOS and Android?\"*\n\ncargo-mobile takes care of generating Xcode and Android Studio project files, building and running on device, generating project boilerplate, and a few other things!\n\nCheck out the [announcement post](https://dev.brainiumstudios.com/2020/11/24/cargo-mobile.html)!\n\n## Status\n\nEverything here works and is already used internally! However, this hasn't seen a lot of external use yet, so there could still be some rough edges.\n\n**Building for iOS is broken on Rust 1.46.0, 1.47.0, and 1.48.0!**\n\nSorry for the inconvenience! This is resolved in Rust 1.49.0, so please update to that if you haven't already:\n\n```bash\nrustup update stable\nrustup default stable\n```\n\n## Installation\n\nThe build will probably take a bit, so feel free to go get a snack or something.\n\n```bash\ncargo install --git https://github.com/BrainiumLLC/cargo-mobile\n```\n\ncargo-mobile is currently supported on macOS and Linux. Note that it's not possible to target iOS on platforms other than macOS! You'll still get to target Android either way.\n\nA PR adding Windows support would be hugely appreciated!\n\nYou'll need to have Xcode and the Android SDK/NDK installed. Some of this will ideally be automated in the future, or at least we'll provide a helpful guide and diagnostics.\n\nWhenever you want to update:\n\n```bash\ncargo mobile update\n```\n\n## Usage\n\nTo start a new project, all you need to do is make a directory with a cute name, `cd` into it, and then run this command:\n\n```bash\ncargo mobile init\n```\n\nAfter some straightforward prompts, you'll be asked to select a template pack. Template packs are used to generate project boilerplate, i.e. using the `bevy` template pack gives you a minimal [Bevy](https://bevyengine.org/) project that runs out-of-the-box on desktop and mobile.\n\n| name      | info                                                                                                                              |\n| --------- | --------------------------------------------------------------------------------------------------------------------------------- |\n| bevy      | Minimal Bevy project derived from [sprite](https://github.com/bevyengine/bevy/blob/master/examples/2d/sprite.rs) example          |\n| bevy-demo | Bevy [breakout](https://github.com/bevyengine/bevy/blob/master/examples/game/breakout.rs) demo                                    |\n| wgpu      | Minimal wgpu project derived from [hello-triangle](https://github.com/gfx-rs/wgpu-rs/tree/master/examples/hello-triangle) example |\n| winit     | Minimal winit project derived from [window](https://github.com/rust-windowing/winit/blob/master/examples/window.rs) example          |\n\n**Template pack contribution is encouraged**; we'd love to have very nice template packs for Bevy, Amethyst, and whatever else people find helpful! We'll write up a guide for template pack creation soon, but in the mean time, the existing ones are a great reference point. Any template pack placed into `~./cargo-mobile/templates/apps/` will appear as an option in `cargo mobile init`.\n\nOnce you've generated your project, you can run `cargo run` as usual to run your app on desktop. However, now you can also do `cargo apple run` and `cargo android run` to run on connected iOS and Android devices respectively!\n\nIf you prefer to work in the usual IDEs, you can use `cargo apple open` and `cargo android open` to open your project in Xcode and Android Studio respectively.\n\nFor more commands, run `cargo mobile`, `cargo apple`, or `cargo android` to see help information.\n\n### Android\n\n**Building for Android is broken on NDK \u003e= 23**\n\n`cargo android run` will build, install and run the app and follows device logs emitted by the app.\n\nBy default, warn and error logs are displayed. Additional logging of increasing verbosity can be shown by use of the `-v` or `-vv` options. These also provide more verbose logging for the build and install steps.\n\nFor fine-grained control of logging, use the `--filter` (or `-f`) option, which takes an Android log level, such as `debug`. This option overrides\nthe default device logging level set by `-v` or `-vv`.\n\nIf using the `android_logger` crate to handle Rust log messages, `trace` logs from Rust are mapped to `verbose` logs in Android.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainiumllc%2Fcargo-mobile","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrainiumllc%2Fcargo-mobile","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrainiumllc%2Fcargo-mobile/lists"}