droidsuite 1.0.0-beta.11 → 1.0.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/COMMANDS.md CHANGED
@@ -360,7 +360,7 @@ droidsuite skill --project # only this project (commit it to share)
360
360
  droidsuite skill --dir ~/.my-agent/skills
361
361
  ```
362
362
 
363
- The installer offers this when it finds an AI agent on your computer. Always installs into .agents/skills and .claude/skills, and into the folders of Gemini CLI, Antigravity, Cursor, GitHub Copilot, Windsurf, Qwen Code and Amp when they are on this computer. The skill shows an agent how to install builds on your phone, read logcat and screenshots over Wi-Fi, and move files, and which steps need you (pairing, Allow, PIN). Run it again after updating droidsuite or adding an agent.
363
+ The installer offers this when it finds an AI agent on your computer. Always installs into .agents/skills and .claude/skills, and into the folders of Gemini CLI, Antigravity, Cursor, GitHub Copilot, Windsurf, Qwen Code and Amp when they are on this computer. The skill shows an agent how to install builds on your phone, read logcat and screenshots over Wi-Fi, and copy files, and which steps need you (pairing, Allow, PIN). Run it again after updating droidsuite or adding an agent.
364
364
 
365
365
  ## help
366
366
 
Binary file
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "droidsuite",
3
- "version": "1.0.0-beta.11",
4
- "description": "Your Android phone on your computer, no cable: see and control its screen, type on it, move files and clipboard both ways, install builds and debug over Wi-Fi.",
3
+ "version": "1.0.0-beta.13",
4
+ "description": "Your Android phone on your computer, no cable: see and control its screen, type on it, copy files and text both ways, install builds and debug over Wi-Fi.",
5
5
  "keywords": [
6
6
  "android",
7
7
  "apk",
@@ -14,6 +14,8 @@
14
14
  ],
15
15
  "author": "Mahmoud Helmy",
16
16
  "license": "MIT",
17
+ "homepage": "https://github.com/Mahmoud-Helmy-m/DroidSuite#readme",
18
+ "bugs": { "url": "https://github.com/Mahmoud-Helmy-m/DroidSuite/issues" },
17
19
  "type": "module",
18
20
  "bin": {
19
21
  "droidsuite": "bin/droidsuite.mjs"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: droidsuite
3
- description: Install, run, debug and test Android apps on the user's real phone over Wi-Fi, and move files between the computer and the phone, with the `droidsuite` CLI (no USB cable). Use this whenever the user wants to try a build on their phone or a physical device, "install it on my phone", auto-install every new build, see logcat or crashes from a real device, take a screenshot from the phone, show or control the phone's screen from the computer, debug or pair wireless adb (including with a pairing code when the camera can't scan, or on older Android versions), send an APK or any file to a phone, or pull files/photos/screenshots off it, in any Android project (Gradle, Flutter, React Native, Kotlin Multiplatform), even if they don't mention DroidSuite by name. Also use it when a phone install fails, needs a tap each time, or a build "needs a newer Android".
3
+ description: Install, run, debug and test Android apps on the user's real phone over Wi-Fi, and copy files between the computer and the phone, with the `droidsuite` CLI (no USB cable). Use this whenever the user wants to try a build on their phone or a physical device, "install it on my phone", auto-install every new build, see logcat or crashes from a real device, take a screenshot from the phone, show or control the phone's screen from the computer, debug or pair wireless adb (including with a pairing code when the camera can't scan, or on older Android versions), send an APK or any file to a phone, or pull files/photos/screenshots off it, in any Android project (Gradle, Flutter, React Native, Kotlin Multiplatform), even if they don't mention DroidSuite by name. Also use it when a phone install fails, needs a tap each time, or a build "needs a newer Android".
4
4
  ---
5
5
 
6
6
  # DroidSuite for agents
@@ -81,6 +81,25 @@ async function extractSplits(path) {
81
81
  }
82
82
  }
83
83
 
84
+ /**
85
+ * sha256 of the APK [serial] has installed for [packageName], or null (not installed, split APKs, or no sha256sum).
86
+ * A build that matches is already on the phone (Gradle or Android Studio just installed it): reinstalling it would
87
+ * kill the app, and any test running in it.
88
+ */
89
+ export async function installedSha(adb, serial, packageName) {
90
+ if (!/^[\w.]+$/.test(packageName ?? '')) return null;
91
+ try {
92
+ const paths = (await adb(['-s', serial, 'shell', `pm path ${packageName}`], { timeout: 10_000 }))
93
+ .split(/\r?\n/).map((l) => l.trim()).filter((l) => l.startsWith('package:')).map((l) => l.slice(8));
94
+ // Android 11+ paths look like /data/app/~~Xy3_=/com.example.app-Ab9==/base.apk: allow ~ = + but nothing a shell reads.
95
+ if (paths.length !== 1 || !/^\/[\w./~=+-]+\.apk$/.test(paths[0])) return null;
96
+ const out = await adb(['-s', serial, 'shell', `sha256sum ${paths[0]}`], { timeout: 30_000 });
97
+ return /^([0-9a-f]{64})\s/i.exec(out.trim())?.[1].toLowerCase() ?? null;
98
+ } catch {
99
+ return null;
100
+ }
101
+ }
102
+
84
103
  /**
85
104
  * Installs [build] ({ path, kind }) on [serial]: `install -r -d -t` (replace, allow downgrade of debug builds,
86
105
  * allow test-only APKs), or `install-multiple` for split bundles. Resolves to { ok, code, message, routeProblem }.
package/src/builds.mjs CHANGED
@@ -7,7 +7,10 @@ import { basename, extname, join, resolve, dirname } from 'node:path';
7
7
  import { readApkInfo } from './apkinfo.mjs';
8
8
 
9
9
  const EXTS = new Set(['.apk', '.apks', '.zip']);
10
- const SKIP_DIRS = new Set(['node_modules', '.git', '.gradle', 'intermediates', 'tmp']);
10
+ // androidTest: Gradle's instrumentation-test APKs. They aren't apps to install, and pushing them (or the app again)
11
+ // while Gradle runs its tests on the phone kills the app under test, so the tests restart.
12
+ const SKIP_DIRS = new Set(['node_modules', '.git', '.gradle', 'intermediates', 'tmp', 'androidTest']);
13
+ const isTestApk = (name) => /-androidTest(-[\w-]+)?\.apk$/i.test(name);
11
14
 
12
15
  export function buildId(path) {
13
16
  return createHash('sha1').update(resolve(path)).digest('hex').slice(0, 12);
@@ -23,7 +26,7 @@ export function sha256File(path) {
23
26
  async function listFiles(root, depth = 0) {
24
27
  let st;
25
28
  try { st = await stat(root); } catch { return []; }
26
- if (st.isFile()) return EXTS.has(extname(root).toLowerCase()) ? [root] : [];
29
+ if (st.isFile()) return EXTS.has(extname(root).toLowerCase()) && !isTestApk(basename(root)) ? [root] : [];
27
30
  if (!st.isDirectory() || depth > 8) return [];
28
31
  const out = [];
29
32
  for (const ent of await readdir(root, { withFileTypes: true })) {
package/src/commands.mjs CHANGED
@@ -170,7 +170,7 @@ export const COMMANDS = [
170
170
  ['--print', 'Only print where the bundled skill is.'],
171
171
  ],
172
172
  examples: ['droidsuite skill # every project on this computer, for every agent', 'droidsuite skill --project # only this project (commit it to share)', 'droidsuite skill --dir ~/.my-agent/skills'],
173
- notes: 'The installer offers this when it finds an AI agent on your computer. Always installs into .agents/skills and .claude/skills, and into the folders of Gemini CLI, Antigravity, Cursor, GitHub Copilot, Windsurf, Qwen Code and Amp when they are on this computer. The skill shows an agent how to install builds on your phone, read logcat and screenshots over Wi-Fi, and move files, and which steps need you (pairing, Allow, PIN). Run it again after updating droidsuite or adding an agent.',
173
+ notes: 'The installer offers this when it finds an AI agent on your computer. Always installs into .agents/skills and .claude/skills, and into the folders of Gemini CLI, Antigravity, Cursor, GitHub Copilot, Windsurf, Qwen Code and Amp when they are on this computer. The skill shows an agent how to install builds on your phone, read logcat and screenshots over Wi-Fi, and copy files, and which steps need you (pairing, Allow, PIN). Run it again after updating droidsuite or adding an agent.',
174
174
  },
175
175
  {
176
176
  name: 'help',
package/src/server.mjs CHANGED
@@ -11,7 +11,7 @@ import { pairLink, safeEqual } from './config.mjs';
11
11
  import { PushStore } from './files.mjs';
12
12
  import { sha256File } from './builds.mjs';
13
13
  import { Nearby, NearbyError } from './nearby.mjs';
14
- import { adbDevices, installApk, matchDevice } from './adbinstall.mjs';
14
+ import { adbDevices, installApk, installedSha, matchDevice } from './adbinstall.mjs';
15
15
  import { InstallQueue } from './installer.mjs';
16
16
  import { capabilities, tooNew } from './capabilities.mjs';
17
17
  import {
@@ -217,9 +217,14 @@ export function createBridgeServer({
217
217
  const current = index.get(build.id);
218
218
  if (!current || current.sha256 !== build.sha256) return; // superseded by a newer build of the same file
219
219
  const route = await resolveAdb(res, phone);
220
- const result = route
221
- ? await installApk(route.runner, route.serial, current)
222
- : { ok: false, code: null, message: 'Wireless debugging is no longer connected', routeProblem: true };
220
+ // Already on the phone byte for byte (Gradle or Android Studio installed it): don't restart the app for nothing.
221
+ const same = route && !manual && current.kind === 'apk' && current.packageName
222
+ && (await installedSha(route.runner, route.serial, current.packageName)) === current.sha256;
223
+ const result = same
224
+ ? { ok: true, code: null, message: 'Already installed' }
225
+ : route
226
+ ? await installApk(route.runner, route.serial, current)
227
+ : { ok: false, code: null, message: 'Wireless debugging is no longer connected', routeProblem: true };
223
228
  if (!phones.has(res)) {
224
229
  // The phone went away (DroidSuite updating itself restarts the app): still say what happened here;
225
230
  // the phone sees the build list when it's back.
package/web/index.html CHANGED
@@ -476,7 +476,7 @@
476
476
  </div>
477
477
  <div class="sub" id="agent-note" style="margin-top:18px">Use an AI coding agent such as Claude Code, Codex or Gemini CLI? Run <code class="mono">droidsuite skill</code> once in a terminal, so it can install and check your app on the phone.</div>
478
478
  </section>
479
- <p class="credit">DroidSuite · made by Mahmoud Helmy</p>
479
+ <p class="credit">DroidSuite · made by Mahmoud Helmy · <a href="https://github.com/Mahmoud-Helmy-m/DroidSuite/issues" target="_blank" rel="noopener">Report a problem</a></p>
480
480
  </div>
481
481
 
482
482
  <script>