tauri icon indicating copy to clipboard operation
tauri copied to clipboard

[feat] Remove `tauri android build` and `tauri iOS build`

Open JonasKruckenberg opened this issue 2 years ago • 13 comments

Describe the problem

Currently all the mobile code is behind their own subcommands tauri ios and tauri android respectively. This feels rather weird to me, especially since they accept wildly different options to the regular build commands.

As a new user starting off with Tauri I would also expect tauri build to build all possible targets

Describe the solution you'd like

Incorporate tauri ios build and tauri android build into tauri build proper

Alternatives considered

No response

Additional context

No response

JonasKruckenberg avatar Jan 14 '23 11:01 JonasKruckenberg

@JonasKruckenberg but would that work in windows ? If we do as you said tauri build will fail on iOS step no ? Or I did not get your point An alternative would be tauri build all ... wdyt ?

zakuru avatar Jan 15 '23 14:01 zakuru

If we do as you said tauri build will fail on iOS step no ? Or I did not get your point

Well Android and iOS would work just like any other OS, e.g. you cannot build Linux artifacts on Windows and so the CLI will just not attempt to build the app for those targets

JonasKruckenberg avatar Jan 15 '23 16:01 JonasKruckenberg

currently tauri build only builds for the host target so imo it would be a bit unexpected if it also tries to build for mobile. I don't think android build is necessarily the solution but integrating it into just tauri build is not the solution imho

FabianLars avatar Jan 15 '23 18:01 FabianLars

I am in favor of this one, tauri build should build apk/ios but only if bundle > targets includes apk and ios targets.

amrbashir avatar Jan 16 '23 16:01 amrbashir

should it also build the nsis target on linux automatically then and other targets when they get cross-platform support?

FabianLars avatar Jan 16 '23 16:01 FabianLars

yeah, it should

amrbashir avatar Jan 16 '23 16:01 amrbashir

yeah IMO the CLI should build as many targets as are possible and configured when running tauri build

JonasKruckenberg avatar Jan 16 '23 16:01 JonasKruckenberg

The main problem with that is that this needs to build the rust app multiple times. And it would be super awkward in CI (if you use multiple platforms).

i'm not completely against the idea but we really need to be careful to not mess up the user/developer experience.

FabianLars avatar Jan 16 '23 17:01 FabianLars

We can check if the rust target is available and instruct users to install the required target or skip it.

amrbashir avatar Jan 16 '23 17:01 amrbashir

We can check if the rust target is available and instruct users to install the required target or skip it. yes @amrbashir would provide better feedback, good for dev experience 👍

zakuru avatar Jan 17 '23 00:01 zakuru

currently tauri build only builds for the host target

Not sure if this counts, but on macOS you can cross compile architectures, after you install the necessary targets (x86_64 if on aarch64, aarch64 if on x86_64) you can run these:

  • tauri build --target aarch64-apple-darwin
  • tauri build --target x86_64-apple-darwin
  • tauri build --target universal-apple-darwin

This is similar to cargo build --target target-triple-here

IMO the CLI should build as many targets as are possible and configured

I personally think its best to build one target at a time, then if you want to build for multiple, you build them one at a time, or write a script to do so? ><

meadowsys avatar Mar 11 '23 05:03 meadowsys

I'd like to only build the target I'm working on, and that I want built. If I'm testing an apk why do I want to build a debian package for desktop?

bburdette avatar May 13 '24 16:05 bburdette

I'd like to only build the target I'm working on, and that I want built. If I'm testing an apk why do I want to build a debian package for desktop?

@bburdette you can do tauri build -b "nsis" or tauri build -b "deb" or tauri build -b "wix,nsis" or if you don't want to bundle any at all, you can in v1 do tauri build -b "none" or in v2 do tauri build --no-bundle

amrbashir avatar May 13 '24 16:05 amrbashir