浏览代码

refactor!: consistent environment variables (#7949)

Co-authored-by: Fabian-Lars <fabianlars@fabianlars.de>
Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Amr Bashir 1 年之前
父节点
当前提交
8b166e9bf8

+ 16 - 0
.changes/cli-env-vars.md

@@ -0,0 +1,16 @@
+---
+'tauri-cli': 'major:breaking'
+'@tauri-apps/cli': 'major:breaking'
+---
+
+Changed a number of environment variables used by tauri CLI for consistency and clarity:
+
+- `TAURI_PRIVATE_KEY` -> `TAURI_SIGNING_PRIVATE_KEY`
+- `TAURI_KEY_PASSWORD` -> `TAURI_SIGNING_PRIVATE_KEY_PASSWORD`
+- `TAURI_SKIP_DEVSERVER_CHECK` -> `TAURI_CLI_NO_DEV_SERVER_WAIT`
+- `TAURI_DEV_SERVER_PORT` -> `TAURI_CLI_PORT`
+- `TAURI_PATH_DEPTH` -> `TAURI_CLI_CONFIG_DEPTH`
+- `TAURI_FIPS_COMPLIANT` -> `TAURI_BUNDLER_WIX_FIPS_COMPLIANT`
+- `TAURI_DEV_WATCHER_IGNORE_FILE` -> `TAURI_CLI_WATCHER_IGNORE_FILENAME`
+- `TAURI_TRAY` -> `TAURI_LINUX_AYATANA_APPINDICATOR`
+- `TAURI_APPLE_DEVELOPMENT_TEAM` -> `APPLE_DEVELOPMENT_TEAM`

+ 6 - 0
.changes/cli-no-dev-server-wait.md

@@ -0,0 +1,6 @@
+---
+'tauri-cli': 'minor:feat'
+'@tauri-apps/cli': 'minor:feat'
+---
+
+Add `--no-dev-server-wait` option to skip waiting for the dev server to start when using `tauri dev`.

+ 6 - 0
.changes/cli-removed-new-version-check.md

@@ -0,0 +1,6 @@
+---
+'tauri-cli': 'major:breaking'
+'@tauri-apps/cli': 'major:breaking'
+---
+
+Removed checking for a new version of the CLI.

+ 5 - 0
.changes/tauri-env-vars.md

@@ -0,0 +1,5 @@
+---
+'tauri-runtime-wry': 'major:breaking'
+---
+
+Check if automation is enabled with the `TAURI_WEBVIEW_AUTOMATION` environment variable instead of `TAURI_AUTOMATION`.

+ 5 - 0
.changes/tauri-runtime-wry-env-vars.md

@@ -0,0 +1,5 @@
+---
+'tauri': 'major:breaking'
+---
+
+Changed `TAURI_AUTOMATION` to `TAURI_WEBVIEW_AUTOMATION`

+ 1 - 1
core/tauri-config-schema/schema.json

@@ -1762,7 +1762,7 @@
       "type": "object",
       "properties": {
         "developmentTeam": {
-          "description": "The development team. This value is required for iOS development because code signing is enforced. The `TAURI_APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.",
+          "description": "The development team. This value is required for iOS development because code signing is enforced. The `APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.",
           "type": [
             "string",
             "null"

+ 1 - 1
core/tauri-runtime-wry/src/lib.rs

@@ -2697,7 +2697,7 @@ fn create_webview<T: UserEvent, F: Fn(RawWindow) + Send + 'static>(
 
   let mut web_context = web_context_store.lock().expect("poisoned WebContext store");
   let is_first_context = web_context.is_empty();
-  let automation_enabled = std::env::var("TAURI_AUTOMATION").as_deref() == Ok("true");
+  let automation_enabled = std::env::var("TAURI_WEBVIEW_AUTOMATION").as_deref() == Ok("true");
   let web_context_key = // force a unique WebContext when automation is false;
     // the context must be stored on the HashMap because it must outlive the WebView on macOS
     if automation_enabled {

+ 1 - 1
core/tauri-utils/src/config.rs

@@ -1582,7 +1582,7 @@ pub struct TrayIconConfig {
 #[serde(rename_all = "camelCase", deny_unknown_fields)]
 pub struct IosConfig {
   /// The development team. This value is required for iOS development because code signing is enforced.
-  /// The `TAURI_APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.
+  /// The `APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.
   #[serde(alias = "development-team")]
   pub development_team: Option<String>,
 }

+ 7 - 7
tooling/bundler/src/bundle/linux/templates/appimage

@@ -8,7 +8,7 @@ set -euxo pipefail
 export ARCH={{arch}}
 APPIMAGE_BUNDLE_XDG_OPEN=${APPIMAGE_BUNDLE_XDG_OPEN-0}
 APPIMAGE_BUNDLE_GSTREAMER=${APPIMAGE_BUNDLE_GSTREAMER-0}
-TRAY_LIBRARY_PATH=${TRAY_LIBRARY_PATH-0}
+TAURI_TRAY_LIBRARY_PATH=${TAURI_TRAY_LIBRARY_PATH-0}
 
 if [ "$ARCH" == "i686" ]; then
     linuxdeploy_arch="i386"
@@ -28,15 +28,15 @@ if [[ "$APPIMAGE_BUNDLE_XDG_OPEN" != "0" ]] && [[ -f "/usr/bin/xdg-open" ]]; the
   cp /usr/bin/xdg-open usr/bin
 fi
 
-if [[ "$TRAY_LIBRARY_PATH" != "0" ]]; then
-  echo "Copying appindicator library ${TRAY_LIBRARY_PATH}"
-  cp ${TRAY_LIBRARY_PATH} usr/lib
+if [[ "$TAURI_TRAY_LIBRARY_PATH" != "0" ]]; then
+  echo "Copying appindicator library ${TAURI_TRAY_LIBRARY_PATH}"
+  cp ${TAURI_TRAY_LIBRARY_PATH} usr/lib
   # It looks like we're practicing good hygiene by adding the ABI version.
   # But for compatibility we'll symlink this file to what we did before.
   # Specifically this prevents breaking libappindicator-sys v0.7.1 and v0.7.2.
-  if [[ "$TRAY_LIBRARY_PATH" == *.so.1 ]]; then
-    readonly soname=$(basename "$TRAY_LIBRARY_PATH")
-    readonly old_name=$(basename "$TRAY_LIBRARY_PATH" .1)
+  if [[ "$TAURI_TRAY_LIBRARY_PATH" == *.so.1 ]]; then
+    readonly soname=$(basename "$TAURI_TRAY_LIBRARY_PATH")
+    readonly old_name=$(basename "$TAURI_TRAY_LIBRARY_PATH" .1)
     echo "Adding compatibility symlink ${old_name} -> ${soname}"
     ln -s ${soname} usr/lib/${old_name}
   fi

+ 1 - 1
tooling/cli/Cargo.toml

@@ -48,7 +48,7 @@ jsonrpsee-ws-client = { version = "0.16", default-features = false }
 thiserror = "1"
 sublime_fuzzy = "0.7"
 clap_complete = "4"
-clap = { version = "4.0", features = [ "derive" ] }
+clap = { version = "4.0", features = [ "derive", "env" ] }
 anyhow = "1.0"
 tauri-bundler = { version = "2.0.0-alpha.9", default-features = false, path = "../bundler" }
 colored = "2.0"

+ 15 - 13
tooling/cli/ENVIRONMENT_VARIABLES.md

@@ -10,28 +10,30 @@ These environment variables are inputs to the CLI which may have an equivalent C
 
 > if both environment variable and CLI flag are used, the CLI flag will have priority.
 
-- `TAURI_PATH_DEPTH` — Number of levels to traverse and find tauri configuration file.
-- `TAURI_DEV_SERVER_PORT` — Port to use for the CLI built-in dev server.
-- `TAURI_DEV_WATCHER_IGNORE_FILE` — A `.gitignore`-style file to control which files should be watched by the CLI in `dev` command.
-- `TAURI_SKIP_DEVSERVER_CHECK` — Skip waiting for the frontend dev server to start before building the tauri application.
-- `TAURI_SKIP_UPDATE_CHECK` — Skip checking for a newer CLI version before exiting the CLI process.
-- `TAURI_TRAY` — Set this var to `ayatana` to use `libayatana-appindicator` for system tray on Linux or set it `appindicator` to use `libappindicator`.
-  - For `deb` bundle target, the CLI will add the appropriate package as a dependency, if unset, the CLI will default to `ayatana`.
-  - For `appimage` bundle target, the CLI will copy the appropriate package to the appimage. if unset, the CLI will make a guess based on what package is installed on the developer system.
-- `TAURI_FIPS_COMPLIANT` — Specify WiX `FipsCompliant` option
-- `TAURI_PRIVATE_KEY` — Private key used to sign your app bundles
-- `TAURI_KEY_PASSWORD` — The private key password, see `TAURI_PRIVATE_KEY`
+- `CI` — If set, the CLI will run in CI mode and won't require any user interaction.
+- `TAURI_CLI_CONFIG_DEPTH` — Number of levels to traverse and find tauri configuration file.
+- `TAURI_CLI_PORT` — Port to use for the CLI built-in dev server.
+- `TAURI_CLI_WATCHER_IGNORE_FILENAME` — Name of a `.gitignore`-style file to control which files should be watched by the CLI in `dev` command. The CLI will look for this file name in each directory.
+- `TAURI_CLI_NO_DEV_SERVER_WAIT` — Skip waiting for the frontend dev server to start before building the tauri application.
+- `TAURI_LINUX_AYATANA_APPINDICATOR` — Set this var to `true` or `1` to force usage of `libayatana-appindicator` for system tray on Linux.
+- `TAURI_BUNDLER_WIX_FIPS_COMPLIANT` — Specify the bundler's WiX `FipsCompliant` option.
+- `TAURI_SIGNING_PRIVATE_KEY` — Private key used to sign your app bundles, can be either a string or a path to the file.
+- `TAURI_SIGNING_PRIVATE_KEY_PASSWORD` — The signing private key password, see `TAURI_SIGNING_PRIVATE_KEY`.
 - `APPLE_CERTIFICATE` — Base64 encoded of the `.p12` certificate for code signing. To get this value, run `openssl base64 -in MyCertificate.p12 -out MyCertificate-base64.txt`.
 - `APPLE_CERTIFICATE_PASSWORD` — The password you used to export the certificate.
 - `APPLE_ID` — The Apple ID used to notarize the application. If this environment variable is provided, `APPLE_PASSWORD` must also be set. Alternatively, `APPLE_API_KEY` and `APPLE_API_ISSUER` can be used to authenticate.
 - `APPLE_PASSWORD` — The Apple password used to authenticate for application notarization. Required if `APPLE_ID` is specified. An app-specific password can be used. Alternatively to entering the password in plaintext, it may also be specified using a '@keychain:' or '@env:' prefix followed by a keychain password item name or environment variable name.
 - `APPLE_API_KEY` — Alternative to `APPLE_ID` and `APPLE_PASSWORD` for notarization authentication using JWT.
-  - This option will search the following directories in sequence for a private key file with the name of 'AuthKey_<api_key>.p8': './private_keys', '~/private_keys', '~/.private_keys', and '~/.appstoreconnect/private_keys'. Additionally, you can set environment variable $API_PRIVATE_KEYS_DIR or a user default API_PRIVATE_KEYS_DIR to specify the directory where your AuthKey file is located.
+  - This option will search the following directories in sequence for a private key file with the name of `AuthKey\_<api_key>.p8`: `./private_keys`, `~/private_keys`, `~/.private_keys`, and `~/.appstoreconnect/private_keys`. Additionally, you can set environment variable `API_PRIVATE_KEYS_DIR` to specify the directory where your AuthKey file is located.
   - See [creating API keys](https://developer.apple.com/documentation/appstoreconnectapi/creating_api_keys_for_app_store_connect_api) for more information.
+- `API_PRIVATE_KEYS_DIR` — Specify the directory where your AuthKey file is located. See `APPLE_API_KEY`.
 - `APPLE_API_ISSUER` — Issuer ID. Required if `APPLE_API_KEY` is specified.
 - `APPLE_SIGNING_IDENTITY` — The identity used to code sign. Overwrites `tauri.conf.json > tauri > bundle > macOS > signingIdentity`.
 - `APPLE_PROVIDER_SHORT_NAME` — If your Apple ID is connected to multiple teams, you have to specify the provider short name of the team you want to use to notarize your app. Overwrites `tauri.conf.json > tauri > bundle > macOS > providerShortName`.
-- `CI` — If set, the CLI will run in CI mode and won't require any user interaction.
+- `APPLE_DEVELOPMENT_TEAM` — TODO
+- `TAURI_WEBVIEW_AUTOMATION` — Enables webview automation (Linux Only).
+- `TAURI_ANDROID_PROJECT_PATH` — Path of the tauri android project, usually will be `<project>/src-tauri/gen/android`.
+- `TAURI_IOS_PROJECT_PATH` — Path of the tauri iOS project, usually will be `<project>/src-tauri/gen/ios`.
 
 ### Tauri CLI Hook Commands
 

+ 1 - 1
tooling/cli/schema.json

@@ -1762,7 +1762,7 @@
       "type": "object",
       "properties": {
         "developmentTeam": {
-          "description": "The development team. This value is required for iOS development because code signing is enforced. The `TAURI_APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.",
+          "description": "The development team. This value is required for iOS development because code signing is enforced. The `APPLE_DEVELOPMENT_TEAM` environment variable can be set to overwrite it.",
           "type": [
             "string",
             "null"

+ 4 - 4
tooling/cli/src/build.rs

@@ -169,12 +169,12 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> {
     // If updater is active and we bundled it
     if config_.tauri.bundle.updater.active && !updater_bundles.is_empty() {
       // if no password provided we use an empty string
-      let password = var_os("TAURI_KEY_PASSWORD")
+      let password = var_os("TAURI_SIGNING_PRIVATE_KEY_PASSWORD")
         .map(|v| v.to_str().unwrap().to_string())
         .or_else(|| if ci { Some("".into()) } else { None });
       // get the private key
       let secret_key = if let Some(mut private_key) =
-        var_os("TAURI_PRIVATE_KEY").map(|v| v.to_str().unwrap().to_string())
+        var_os("TAURI_SIGNING_PRIVATE_KEY").map(|v| v.to_str().unwrap().to_string())
       {
         // check if env var points to a file..
         let pk_dir = Path::new(&private_key);
@@ -186,7 +186,7 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> {
         }
         updater_secret_key(private_key, password)
       } else {
-        Err(anyhow::anyhow!("A public key has been found, but no private key. Make sure to set `TAURI_PRIVATE_KEY` environment variable."))
+        Err(anyhow::anyhow!("A public key has been found, but no private key. Make sure to set `TAURI_SIGNING_PRIVATE_KEY` environment variable."))
       }?;
 
       let pubkey =
@@ -204,7 +204,7 @@ pub fn command(mut options: Options, verbosity: u8) -> Result<()> {
           let (signature_path, signature) = sign_file(&secret_key, path)?;
           if signature.keynum() != public_key.keynum() {
             return Err(anyhow::anyhow!(
-              "The updater secret key from `TAURI_PRIVATE_KEY` does not match the public key defined in `tauri.conf.json > tauri > updater > pubkey`."
+              "The updater secret key from `TAURI_SIGNING_PRIVATE_KEY` does not match the public key defined in `tauri.conf.json > tauri > updater > pubkey`."
             ));
           }
           signed_paths.append(&mut vec![signature_path]);

+ 16 - 36
tooling/cli/src/dev.rs

@@ -36,7 +36,8 @@ static KILL_BEFORE_DEV_FLAG: OnceCell<AtomicBool> = OnceCell::new();
 #[cfg(unix)]
 const KILL_CHILDREN_SCRIPT: &[u8] = include_bytes!("../scripts/kill-children.sh");
 
-pub const TAURI_DEV_WATCHER_GITIGNORE: &[u8] = include_bytes!("../tauri-dev-watcher.gitignore");
+pub const TAURI_CLI_BUILTIN_WATCHER_IGNORE_FILE: &[u8] =
+  include_bytes!("../tauri-dev-watcher.gitignore");
 
 #[derive(Debug, Clone, Parser)]
 #[clap(
@@ -65,19 +66,22 @@ pub struct Options {
   pub release_mode: bool,
   /// Command line arguments passed to the runner. Arguments after `--` are passed to the application.
   pub args: Vec<String>,
-  /// Disable the file watcher
+  /// Skip waiting for the frontend dev server to start before building the tauri application.
+  #[clap(long, env = "TAURI_CLI_NO_DEV_SERVER_WAIT")]
+  pub no_dev_server_wait: bool,
+  /// Disable the file watcher.
   #[clap(long)]
   pub no_watch: bool,
-  /// Disable the dev server for static files.
-  #[clap(long)]
-  pub no_dev_server: bool,
-  /// Specify port for the dev server for static files. Defaults to 1430
-  /// Can also be set using `TAURI_DEV_SERVER_PORT` env var.
-  #[clap(long)]
-  pub port: Option<u16>,
   /// Force prompting for an IP to use to connect to the dev server on mobile.
   #[clap(long)]
   pub force_ip_prompt: bool,
+
+  /// Disable the built-in dev server for static files.
+  #[clap(long)]
+  pub no_dev_server: bool,
+  /// Specify port for the built-in dev server for static files. Defaults to 1430.
+  #[clap(long, env = "TAURI_CLI_PORT")]
+  pub port: Option<u16>,
 }
 
 pub fn command(options: Options) -> Result<()> {
@@ -322,10 +326,6 @@ pub fn setup(target: Target, options: &mut Options, mobile: bool) -> Result<AppI
         let server_url = format!("http://{server_url}");
         dev_path = AppUrl::Url(WindowUrl::External(server_url.parse().unwrap()));
 
-        // TODO: in v2, use an env var to pass the url to the app context
-        // or better separate the config passed from the cli internally and
-        // config passed by the user in `--config` into to separate env vars
-        // and the context merges, the user first, then the internal cli config
         if let Some(c) = &options.config {
           let mut c: tauri_utils::config::Config = serde_json::from_str(c)?;
           c.build.dev_path = dev_path.clone();
@@ -333,13 +333,13 @@ pub fn setup(target: Target, options: &mut Options, mobile: bool) -> Result<AppI
         } else {
           options.config = Some(format!(r#"{{ "build": {{ "devPath": "{server_url}" }} }}"#))
         }
+
+        reload_config(options.config.as_deref())?;
       }
     }
-
-    reload_config(options.config.as_deref())?;
   }
 
-  if std::env::var_os("TAURI_SKIP_DEVSERVER_CHECK") != Some("true".into()) {
+  if !options.no_dev_server_wait {
     if let AppUrl::Url(WindowUrl::External(dev_server_url)) = dev_path {
       let host = dev_server_url
         .host()
@@ -427,30 +427,10 @@ pub fn on_app_exit(code: Option<i32>, reason: ExitReason, exit_on_panic: bool, n
       && (exit_on_panic || matches!(reason, ExitReason::NormalExit)))
   {
     kill_before_dev_process();
-    #[cfg(not(debug_assertions))]
-    let _ = check_for_updates();
     exit(code.unwrap_or(0));
   }
 }
 
-#[cfg(not(debug_assertions))]
-fn check_for_updates() -> Result<()> {
-  if std::env::var_os("TAURI_SKIP_UPDATE_CHECK") != Some("true".into()) {
-    let current_version = crate::info::cli_current_version()?;
-    let current = semver::Version::parse(&current_version)?;
-
-    let upstream_version = crate::info::cli_upstream_version()?;
-    let upstream = semver::Version::parse(&upstream_version)?;
-    if current < upstream {
-      println!(
-        "🚀 A new version of Tauri CLI is available! [{}]",
-        upstream.to_string()
-      );
-    };
-  }
-  Ok(())
-}
-
 pub fn kill_before_dev_process() {
   if let Some(child) = BEFORE_DEV.get() {
     let child = child.lock().unwrap();

+ 2 - 2
tooling/cli/src/helpers/app_paths.rs

@@ -41,10 +41,10 @@ fn lookup<F: Fn(&PathBuf) -> bool>(dir: &Path, checker: F) -> Option<PathBuf> {
     .require_git(false)
     .ignore(false)
     .max_depth(Some(
-      std::env::var("TAURI_PATH_DEPTH")
+      std::env::var("TAURI_CLI_CONFIG_DEPTH")
         .map(|d| {
           d.parse()
-            .expect("`TAURI_PATH_DEPTH` environment variable must be a positive integer")
+            .expect("`TAURI_CLI_CONFIG_DEPTH` environment variable must be a positive integer")
         })
         .unwrap_or(3),
     ))

+ 1 - 1
tooling/cli/src/helpers/config.rs

@@ -95,7 +95,7 @@ pub fn wix_settings(config: WixConfig) -> tauri_bundler::WixSettings {
     enable_elevated_update_task: config.enable_elevated_update_task,
     banner_path: config.banner_path,
     dialog_image_path: config.dialog_image_path,
-    fips_compliant: var_os("TAURI_FIPS_COMPLIANT").map_or(false, |v| v == "true"),
+    fips_compliant: var_os("TAURI_BUNDLER_WIX_FIPS_COMPLIANT").map_or(false, |v| v == "true"),
   }
 }
 

+ 2 - 7
tooling/cli/src/helpers/web_dev_server.rs

@@ -73,13 +73,8 @@ pub fn start_dev_server<P: AsRef<Path>>(
 
         let mut auto_port = false;
         let mut port = port.unwrap_or_else(|| {
-          std::env::var("TAURI_DEV_SERVER_PORT")
-            .unwrap_or_else(|_| {
-              auto_port = true;
-              "1430".to_string()
-            })
-            .parse()
-            .unwrap()
+          auto_port = true;
+          1430
         });
 
         let (server, server_url) = loop {

+ 11 - 8
tooling/cli/src/interface/rust.rs

@@ -306,11 +306,14 @@ fn build_ignore_matcher(dir: &Path) -> IgnoreMatcher {
 
       ignore_builder.add(path);
 
-      if let Ok(ignore_file) = std::env::var("TAURI_DEV_WATCHER_IGNORE_FILE") {
+      if let Ok(ignore_file) = std::env::var("TAURI_CLI_WATCHER_IGNORE_FILENAME") {
         ignore_builder.add(dir.join(ignore_file));
       }
 
-      for line in crate::dev::TAURI_DEV_WATCHER_GITIGNORE.lines().flatten() {
+      for line in crate::dev::TAURI_CLI_BUILTIN_WATCHER_IGNORE_FILE
+        .lines()
+        .flatten()
+      {
         let _ = ignore_builder.add_line(None, &line);
       }
 
@@ -328,14 +331,14 @@ fn lookup<F: FnMut(FileType, PathBuf)>(dir: &Path, mut f: F) {
   default_gitignore.push(".gitignore");
   if !default_gitignore.exists() {
     if let Ok(mut file) = std::fs::File::create(default_gitignore.clone()) {
-      let _ = file.write_all(crate::dev::TAURI_DEV_WATCHER_GITIGNORE);
+      let _ = file.write_all(crate::dev::TAURI_CLI_BUILTIN_WATCHER_IGNORE_FILE);
     }
   }
 
   let mut builder = ignore::WalkBuilder::new(dir);
   builder.add_custom_ignore_filename(".taurignore");
   let _ = builder.add_ignore(default_gitignore);
-  if let Ok(ignore_file) = std::env::var("TAURI_DEV_WATCHER_IGNORE_FILE") {
+  if let Ok(ignore_file) = std::env::var("TAURI_CLI_WATCHER_IGNORE_FILENAME") {
     builder.add_ignore(ignore_file);
   }
   builder.require_git(false).ignore(false).max_depth(Some(1));
@@ -1069,9 +1072,9 @@ fn tauri_config_to_bundle_settings(
     if enabled_features.contains(&"tray-icon".into())
       || enabled_features.contains(&"tauri/tray-icon".into())
     {
-      let (tray_kind, path) = std::env::var("TAURI_TRAY")
-        .map(|kind| {
-          if kind == "ayatana" {
+      let (tray_kind, path) = std::env::var("TAURI_LINUX_AYATANA_APPINDICATOR")
+        .map(|ayatana| {
+          if ayatana == "true" || ayatana == "1" {
             (
               pkgconfig_utils::TrayKind::Ayatana,
               format!(
@@ -1101,7 +1104,7 @@ fn tauri_config_to_bundle_settings(
         }
       }
 
-      std::env::set_var("TRAY_LIBRARY_PATH", path);
+      std::env::set_var("TAURI_TRAY_LIBRARY_PATH", path);
     }
 
     // provides `libwebkit2gtk-4.1.so.37` and all `4.0` versions have the -37 package name

+ 13 - 10
tooling/cli/src/mobile/android/dev.rs

@@ -58,27 +58,29 @@ pub struct Options {
   /// JSON string or path to JSON file to merge with tauri.conf.json
   #[clap(short, long)]
   pub config: Option<String>,
+  /// Run the code in release mode
+  #[clap(long = "release")]
+  pub release_mode: bool,
+  /// Skip waiting for the frontend dev server to start before building the tauri application.
+  #[clap(long, env = "TAURI_CLI_NO_DEV_SERVER_WAIT")]
+  pub no_dev_server_wait: bool,
   /// Disable the file watcher
   #[clap(long)]
   pub no_watch: bool,
-  /// Disable the dev server for static files.
-  #[clap(long)]
-  pub no_dev_server: bool,
   /// Open Android Studio instead of trying to run on a connected device
   #[clap(short, long)]
   pub open: bool,
   /// Runs on the given device name
   pub device: Option<String>,
-  /// Specify port for the dev server for static files. Defaults to 1430
-  /// Can also be set using `TAURI_DEV_SERVER_PORT` env var.
-  #[clap(long)]
-  pub port: Option<u16>,
   /// Force prompting for an IP to use to connect to the dev server on mobile.
   #[clap(long)]
   pub force_ip_prompt: bool,
-  /// Run the code in release mode
-  #[clap(long = "release")]
-  pub release_mode: bool,
+  /// Disable the built-in dev server for static files.
+  #[clap(long)]
+  pub no_dev_server: bool,
+  /// Specify port for the built-in dev server for static files. Defaults to 1430.
+  #[clap(long, env = "TAURI_CLI_PORT")]
+  pub port: Option<u16>,
 }
 
 impl From<Options> for DevOptions {
@@ -91,6 +93,7 @@ impl From<Options> for DevOptions {
       config: options.config,
       args: Vec::new(),
       no_watch: options.no_watch,
+      no_dev_server_wait: options.no_dev_server_wait,
       no_dev_server: options.no_dev_server,
       port: options.port,
       force_ip_prompt: options.force_ip_prompt,

+ 10 - 7
tooling/cli/src/mobile/ios/dev.rs

@@ -48,24 +48,26 @@ pub struct Options {
   /// Run the code in release mode
   #[clap(long = "release")]
   pub release_mode: bool,
+  /// Skip waiting for the frontend dev server to start before building the tauri application.
+  #[clap(long, env = "TAURI_CLI_NO_DEV_SERVER_WAIT")]
+  pub no_dev_server_wait: bool,
   /// Disable the file watcher
   #[clap(long)]
   pub no_watch: bool,
-  /// Disable the dev server for static files.
-  #[clap(long)]
-  pub no_dev_server: bool,
   /// Open Xcode instead of trying to run on a connected device
   #[clap(short, long)]
   pub open: bool,
   /// Runs on the given device name
   pub device: Option<String>,
-  /// Specify port for the dev server for static files. Defaults to 1430
-  /// Can also be set using `TAURI_DEV_SERVER_PORT` env var.
-  #[clap(long)]
-  pub port: Option<u16>,
   /// Force prompting for an IP to use to connect to the dev server on mobile.
   #[clap(long)]
   pub force_ip_prompt: bool,
+  /// Disable the built-in dev server for static files.
+  #[clap(long)]
+  pub no_dev_server: bool,
+  /// Specify port for the built-in dev server for static files. Defaults to 1430.
+  #[clap(long, env = "TAURI_CLI_PORT")]
+  pub port: Option<u16>,
 }
 
 impl From<Options> for DevOptions {
@@ -80,6 +82,7 @@ impl From<Options> for DevOptions {
       args: Vec::new(),
       no_watch: options.no_watch,
       no_dev_server: options.no_dev_server,
+      no_dev_server_wait: options.no_dev_server_wait,
       port: options.port,
       force_ip_prompt: options.force_ip_prompt,
     }

+ 1 - 1
tooling/cli/src/mobile/ios/mod.rs

@@ -37,7 +37,7 @@ mod open;
 pub(crate) mod project;
 mod xcode_script;
 
-pub const APPLE_DEVELOPMENT_TEAM_ENV_VAR_NAME: &str = "TAURI_APPLE_DEVELOPMENT_TEAM";
+pub const APPLE_DEVELOPMENT_TEAM_ENV_VAR_NAME: &str = "APPLE_DEVELOPMENT_TEAM";
 const TARGET_IOS_VERSION: &str = "13.0";
 
 #[derive(Parser)]

+ 3 - 1
tooling/cli/src/mobile/mod.rs

@@ -198,7 +198,9 @@ fn env_vars() -> HashMap<String, OsString> {
   vars.insert("RUST_LOG_STYLE".into(), "always".into());
   for (k, v) in std::env::vars_os() {
     let k = k.to_string_lossy();
-    if (k.starts_with("TAURI") && k != "TAURI_PRIVATE_KEY" && k != "TAURI_KEY_PASSWORD")
+    if (k.starts_with("TAURI")
+      && k != "TAURI_SIGNING_PRIVATE_KEY"
+      && k != "TAURI_SIGNING_PRIVATE_KEY_PASSWORD")
       || k.starts_with("WRY")
       || k.starts_with("CARGO_")
       || k == "TMPDIR"

+ 1 - 1
tooling/cli/src/signer/generate.rs

@@ -57,7 +57,7 @@ pub fn command(mut options: Options) -> Result<()> {
         );
   }
 
-  println!("\nEnvironment variables used to sign:\n`TAURI_PRIVATE_KEY`  Path or String of your private key\n`TAURI_KEY_PASSWORD`  Your private key password (optional)\n\nATTENTION: If you lose your private key OR password, you'll not be able to sign your update package and updates will not work.\n---------------------------\n");
+  println!("\nEnvironment variables used to sign:\n`TAURI_SIGNING_PRIVATE_KEY`  Path or String of your private key\n`TAURI_SIGNING_PRIVATE_KEY_PASSWORD`  Your private key password (optional)\n\nATTENTION: If you lose your private key OR password, you'll not be able to sign your update package and updates will not work.\n---------------------------\n");
 
   Ok(())
 }

+ 1 - 1
tooling/webdriver/src/webdriver.rs

@@ -45,7 +45,7 @@ pub fn native(args: &Args) -> Command {
   };
 
   let mut cmd = Command::new(native_binary);
-  cmd.env("TAURI_AUTOMATION", "true");
+  cmd.env("TAURI_WEBVIEW_AUTOMATION", "true");
   cmd.arg(format!("--port={}", args.native_port));
   cmd.arg(format!("--host={}", args.native_host));
   cmd