From 4fe0900d23fe498b5c56289dac296ed7d1b37174 Mon Sep 17 00:00:00 2001 From: Artemiy Davydov Date: Tue, 12 Nov 2024 17:41:41 +0300 Subject: [PATCH 1/3] fix: correct name for github releases --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 0009151..947954d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -50,7 +50,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - tagName: dogit-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version + tagName: emu-v__VERSION__ # the action automatically replaces \_\_VERSION\_\_ with the app version releaseName: "Emu v__VERSION__" releaseBody: "See the assets to download this version and install." releaseDraft: true From a1bbdd1c9e970a512e29b523d6b398bc1f80a2e4 Mon Sep 17 00:00:00 2001 From: Artemiy Davydov Date: Tue, 12 Nov 2024 21:09:43 +0400 Subject: [PATCH 2/3] feat: macos support --- bun.lockb | Bin 104890 -> 105309 bytes package.json | 1 + src-tauri/Cargo.lock | 78 ++++++++++++++++++++++++++++ src-tauri/Cargo.toml | 3 +- src-tauri/capabilities/default.json | 8 ++- src-tauri/src/lib.rs | 1 + src-tauri/tauri.conf.json | 1 + src/services/api/emulator.ts | 47 +++++------------ src/services/execute.ts | 48 +++++++++++++++-- 9 files changed, 146 insertions(+), 41 deletions(-) mode change 100644 => 100755 bun.lockb diff --git a/bun.lockb b/bun.lockb old mode 100644 new mode 100755 index c54980ee0226a4643c0581cec1622cff3930d6a6..9a9be59ae80bd7e7f43cb98490187afcb4e04ee7 GIT binary patch delta 16328 zcmeHud013O*8Z)Q2Cj;TfGmw7?hBx-O^eVF5!7}GG1~4C1r-G(q9(Y}PTUg{vD9*p zMx$cXh`51q!NjPEMonTS8a0|_qA@X}lSPc^_ny1ZWPT=@-}B7#egEV>{oYfj>eQ)I zr%u&f`c_4m>y>@3i^JPhgf9KWGpuutzh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PY9Fg*{S)rp2HYe`qo7GQ zivvE(@89LsgNN1nDJMr{r=V*JMXO}MB9Yk(P$phY#%0ve3mv2HxBBYx>eVB z>6R8N<36ic-wTb?_j6^p{-$o5tA6TMR)x00ozG>qmNqUdI(iLM${Kc*m79XVVi97bp4{1Kv=HXFY z59Es@#BBtaY060T4tIQIt$3e3B~7dTU}Wni zh53S|;?^wGqP|D@)FQ%DS*qu(?7aLrdDABj82f(5Z@N}@au)MaSqO6$<$$ngPxXhA z^P?8LWZNDZkOUsDy&Q}DMzy}<6aUEoaW<7%0^P9ck@$(kgi~y8>)RfwY9;N;561Rk X26iz0em1Uy2%W*)58j%@CdB<88C{Vc diff --git a/package.json b/package.json index 4f44e17..6a131f3 100644 --- a/package.json +++ b/package.json @@ -14,6 +14,7 @@ "@radix-ui/react-alert-dialog": "^1.1.2", "@radix-ui/react-slot": "^1.1.0", "@tauri-apps/api": "^2", + "@tauri-apps/plugin-os": "~2", "@tauri-apps/plugin-process": "~2", "@tauri-apps/plugin-shell": "~2", "class-variance-authority": "^0.7.0", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 9886ce7..94ee0d5 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -702,6 +702,7 @@ dependencies = [ "serde_json", "tauri", "tauri-build", + "tauri-plugin-os", "tauri-plugin-positioner", "tauri-plugin-process", "tauri-plugin-shell", @@ -732,6 +733,16 @@ dependencies = [ "typeid", ] +[[package]] +name = "errno" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "534c5cf6194dfab3db3242765c03bbe257cf92f22b38f6bc0c58d59108a820ba" +dependencies = [ + "libc", + "windows-sys 0.52.0", +] + [[package]] name = "fdeflate" version = "0.3.6" @@ -1003,6 +1014,16 @@ dependencies = [ "version_check", ] +[[package]] +name = "gethostname" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc3655aa6818d65bc620d6911f05aa7b6aeb596291e1e9f79e52df85583d1e30" +dependencies = [ + "rustix", + "windows-targets 0.52.6", +] + [[package]] name = "getrandom" version = "0.1.16" @@ -1718,6 +1739,12 @@ dependencies = [ "libc", ] +[[package]] +name = "linux-raw-sys" +version = "0.4.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" + [[package]] name = "litemap" version = "0.7.3" @@ -2175,6 +2202,17 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" +[[package]] +name = "os_info" +version = "3.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae99c7fa6dd38c7cafe1ec085e804f8f555a2f8659b0dbe03f1f9963a9b51092" +dependencies = [ + "log", + "serde", + "windows-sys 0.52.0", +] + [[package]] name = "os_pipe" version = "1.2.1" @@ -2709,6 +2747,19 @@ dependencies = [ "semver", ] +[[package]] +name = "rustix" +version = "0.38.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99e4ea3e1cdc4b559b8e5650f9c8e5998e3e5c1343b4eaf034565f32318d63c0" +dependencies = [ + "bitflags 2.6.0", + "errno", + "libc", + "linux-raw-sys", + "windows-sys 0.52.0", +] + [[package]] name = "ryu" version = "1.0.18" @@ -3137,6 +3188,15 @@ dependencies = [ "syn 2.0.87", ] +[[package]] +name = "sys-locale" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8eab9a99a024a169fe8a903cf9d4a3b3601109bcc13bd9e3c6fff259138626c4" +dependencies = [ + "libc", +] + [[package]] name = "system-deps" version = "6.2.2" @@ -3336,6 +3396,24 @@ dependencies = [ "walkdir", ] +[[package]] +name = "tauri-plugin-os" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fbc5f23a86f37687c7f4fecfdc706b279087bc44f7a46702f7307ff1551ee03a" +dependencies = [ + "gethostname", + "log", + "os_info", + "serde", + "serde_json", + "serialize-to-javascript", + "sys-locale", + "tauri", + "tauri-plugin", + "thiserror 1.0.69", +] + [[package]] name = "tauri-plugin-positioner" version = "2.0.2" diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 5eaeae5..e080f00 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -18,9 +18,10 @@ crate-type = ["staticlib", "cdylib", "rlib"] tauri-build = { version = "2", features = [] } [dependencies] -tauri = { version = "2", features = [] } +tauri = { version = "2", features = ["macos-private-api"] } tauri-plugin-shell = "2" serde = { version = "1", features = ["derive"] } serde_json = "1" tauri-plugin-process = "2" tauri-plugin-positioner = "2" +tauri-plugin-os = "2" diff --git a/src-tauri/capabilities/default.json b/src-tauri/capabilities/default.json index 4ce5d4e..0acb282 100644 --- a/src-tauri/capabilities/default.json +++ b/src-tauri/capabilities/default.json @@ -16,9 +16,15 @@ "name": "cmd.exe", "cmd": "cmd.exe", "args": true + }, + { + "name": "sh", + "cmd": "sh", + "args": true } ] }, - "process:default" + "process:default", + "os:default" ] } diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index c4c7164..2f80615 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -13,6 +13,7 @@ fn get_android_home() -> Result { #[cfg_attr(mobile, tauri::mobile_entry_point)] pub fn run() { tauri::Builder::default() + .plugin(tauri_plugin_os::init()) .plugin(tauri_plugin_process::init()) .plugin(tauri_plugin_shell::init()) .invoke_handler(tauri::generate_handler![get_android_home]) diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index 80312c5..d764c02 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -10,6 +10,7 @@ "frontendDist": "../dist" }, "app": { + "macOSPrivateApi": true, "windows": [ { "title": "emu", diff --git a/src/services/api/emulator.ts b/src/services/api/emulator.ts index fd77c63..2b6907d 100644 --- a/src/services/api/emulator.ts +++ b/src/services/api/emulator.ts @@ -1,4 +1,4 @@ -import { execute } from "@/services/execute"; +import { adb, emulator } from "@/services/execute"; import { OnlineEmulator, OnlineEmulatorState, @@ -6,12 +6,9 @@ import { } from "@/types/emulator"; export const getAllEmulators = async () => { - const output = await execute("cmd.exe", [ - "/c", - "%ANDROID_HOME%/emulator/emulator.exe -list-avds", - ]); + const output = await emulator("-list-avds"); return output - .split("\r\n") + .split("\n") .map((v) => v.trim()) .filter((v) => { if (!v) return false; @@ -21,11 +18,8 @@ export const getAllEmulators = async () => { }; export const getEmulatorName = async (id: string) => { - const output = await execute("cmd.exe", [ - "/c", - `%ANDROID_HOME%/platform-tools/adb.exe -s ${id} emu avd name`, - ]); - return output.split("\r\n").map((v) => v.trim())[0]; + const output = await adb(`-s ${id} emu avd name`); + return output.split("\n").map((v) => v.trim())[0]; }; export const getEmulatorState = ( @@ -36,11 +30,8 @@ export const getEmulatorState = ( }; export const getEmulatorProps = async (id: string) => { - const output = await execute("cmd.exe", [ - "/c", - `%ANDROID_HOME%/platform-tools/adb.exe -s ${id} shell getprop`, - ]); - const kv = output.split("\r\n").map((v) => { + const output = await adb(`-s ${id} shell getprop`); + const kv = output.split("\n").map((v) => { const [key, value] = v.replace(/(\[|\])/gm, "").split(": "); return [key, value]; }); @@ -48,11 +39,8 @@ export const getEmulatorProps = async (id: string) => { }; export const getEmulatorFeatures = async (id: string) => { - const output = await execute("cmd.exe", [ - "/c", - `%ANDROID_HOME%/platform-tools/adb.exe -s ${id} shell pm list features`, - ]); - return output.split("\r\n"); + const output = await adb("shell pm list features"); + return output.split("\n"); }; export const getEmulatorType = (features: string[]): OnlineEmulatorType => { @@ -63,12 +51,9 @@ export const getEmulatorType = (features: string[]): OnlineEmulatorType => { }; export const getOnlineEmulators = async () => { - const output = await execute("cmd.exe", [ - "/c", - "%ANDROID_HOME%/platform-tools/adb.exe devices -l", - ]); + const output = await adb("devices -l"); const rows = output - .split("\r\n") + .split("\n") .map((v) => v.trim()) .filter((v) => { if (!v) return false; @@ -116,15 +101,9 @@ export const startEmulator = async (name: string, cold = false) => { if (cold) args.push("-no-snapshot-load"); - await execute("cmd.exe", [ - "/c", - `%ANDROID_HOME%/emulator/emulator.exe ` + args.join(" "), - ]); + await emulator(args.join(" ")); }; export const stopEmulator = async (id: string) => { - await execute("cmd.exe", [ - "/c", - `%ANDROID_HOME%/platform-tools/adb.exe -s ${id} emu kill`, - ]); + await adb(`-s ${id} emu kill`); }; diff --git a/src/services/execute.ts b/src/services/execute.ts index 8c67343..a6894eb 100644 --- a/src/services/execute.ts +++ b/src/services/execute.ts @@ -1,13 +1,41 @@ +import { platform } from "@tauri-apps/plugin-os"; import { Command, type SpawnOptions } from "@tauri-apps/plugin-shell"; +const getAndroidHomePrefix = () => { + const currentPlatfrom = platform(); + + switch (currentPlatfrom) { + case "windows": + return "%ANDROID_HOME"; + + default: + return "$ANDROID_HOME"; + } +}; + +const makeCommand = (executable: string, ...args: string[]) => { + const currentPlatfrom = platform(); + + switch (currentPlatfrom) { + case "windows": + return Command.create("cmd.exe", [ + "/c", + executable + ".exe " + args.join(" "), + ]); + + default: + return Command.create("sh", ["-c", executable + " " + args.join(" ")]); + } +}; + export const execute = async ( - base: string, - args?: string | string[], + executable: string, + args: string[] = [], options?: SpawnOptions & { timeout?: number; verbose?: boolean } ) => { - const cmd = Command.create(base, args, options); + const cmd = makeCommand(executable, ...args); cmd.stdout.on("data", (v) => { - if (options?.verbose) console.info(base, args, v); + if (options?.verbose) console.info(executable, args, v); }); if (typeof options?.timeout === "number") { setTimeout(() => { @@ -16,5 +44,15 @@ export const execute = async ( } const process = await cmd.execute(); - return process.stdout; + return process.stdout.replace(/\r/gm, ""); +}; + +export const emulator = (command: string) => { + const prefix = getAndroidHomePrefix(); + return execute(`${prefix}/emulator/emulator`, [command]); +}; + +export const adb = (command: string) => { + const prefix = getAndroidHomePrefix(); + return execute(`${prefix}/platform-tools/adb`, [command]); }; From 89446ad0a47d9d61074fb3ad47c44ac2894a82e5 Mon Sep 17 00:00:00 2001 From: Artemiy Davydov Date: Tue, 12 Nov 2024 20:32:44 +0300 Subject: [PATCH 3/3] little windows modifications --- .github/workflows/publish.yml | 10 +++++----- package.json | 2 +- src-tauri/Cargo.lock | 2 +- src-tauri/Cargo.toml | 6 +++--- src-tauri/tauri.conf.json | 2 +- src/app.tsx | 34 +++++++++++++++++----------------- src/services/api/emulator.ts | 2 +- src/services/execute.ts | 20 +++++++++----------- 8 files changed, 38 insertions(+), 40 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 947954d..57a991e 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,11 +12,11 @@ jobs: fail-fast: false matrix: include: - # - platform: "macos-latest" # for Arm based macs (M1 and above). - # args: "--target aarch64-apple-darwin" - # - platform: "macos-latest" # for Intel based macs. - # args: "--target x86_64-apple-darwin" - # - platform: "ubuntu-22.04" # for Tauri v1 you could replace this with ubuntu-20.04. + - platform: "macos-latest" # for Arm based macs (M1 and above). + args: "--target aarch64-apple-darwin" + - platform: "macos-latest" # for Intel based macs. + args: "--target x86_64-apple-darwin" + # - platform: "ubuntu-22.04" # args: "" - platform: "windows-latest" args: "" diff --git a/package.json b/package.json index 6a131f3..5c207b6 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "emu", "private": true, - "version": "0.1.0", + "version": "0.1.1", "type": "module", "scripts": { "dev": "vite", diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 94ee0d5..9000708 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -696,7 +696,7 @@ checksum = "4ef6b89e5b37196644d8796de5268852ff179b44e96276cf4290264843743bb7" [[package]] name = "emu" -version = "0.1.0" +version = "0.1.1" dependencies = [ "serde", "serde_json", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index e080f00..d02f0e8 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -1,8 +1,8 @@ [package] name = "emu" -version = "0.1.0" -description = "A Tauri App" -authors = ["you"] +version = "0.1.1" +description = "Manage emulators with ease" +authors = ["fax1ty"] edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index d764c02..21d7c14 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,7 +1,7 @@ { "$schema": "https://schema.tauri.app/config/2", "productName": "emu", - "version": "0.1.0", + "version": "0.1.1", "identifier": "emu.app", "build": { "beforeDevCommand": "bun run dev", diff --git a/src/app.tsx b/src/app.tsx index 60cb8dc..f5906ce 100644 --- a/src/app.tsx +++ b/src/app.tsx @@ -31,8 +31,6 @@ function App() { await window.close(); }; - if (!emulators) return null; - return ( <>