You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/init/PLAN.md
+64-66Lines changed: 64 additions & 66 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,9 +4,9 @@ This plan is organized as small milestones. Each milestone should be implemented
4
4
5
5
## Progress
6
6
7
-
- Current milestone: M61 — Surface persistent forwarding diagnostics.
8
-
- Completed milestone range: Milestones 17–60 completed the initial CLI shell/push/pull work, CLI documentation, Linux USB transport design, transport abstraction, Linux USB discovery, Linux usbfs bulk transport, high-level USB connection API, CLI USB connection option, USB documentation, adb-go-specific target listing, explicit ADB authentication support, the client APK install helper, the CLI `install-apk` command, APK install documentation, logcat library/CLI/documentation support, property helpers, screencap support, reboot library/CLI/documentation support, foreground port forwarding support, the minimal adb-god daemon foundation, Linux systemd user-service install/lifecycle controls, Linux systemd user-service status reporting, daemon diagnostics, daemon service logs, daemon service reinstall, CLI version reporting, CLI error-message improvements, integration-test documentation, exported package documentation/examples, the daemon-backed persistent forwarding design, the daemon forwarding protocol model, daemon-owned forwarding listener registration, TCP target bridging for persistent forwards, and CLI persistent forwarding controls.
9
-
- Active focus: implement daemon-owned persistent TCP forwarding in small slices while preserving the existing foreground forwarding behavior and avoiding durable daemon-owned ADB state until explicitly designed.
7
+
- Current milestone: M62 — Extract custom CLI mode package.
8
+
- Completed milestone range: Milestones 17–61 completed the initial CLI shell/push/pull work, CLI documentation, Linux USB transport design, transport abstraction, Linux USB discovery, Linux usbfs bulk transport, high-level USB connection API, CLI USB connection option, USB documentation, adb-go-specific target listing, explicit ADB authentication support, the client APK install helper, the CLI `install-apk` command, APK install documentation, logcat library/CLI/documentation support, property helpers, screencap support, reboot library/CLI/documentation support, foreground port forwarding support, the minimal adb-god daemon foundation, Linux systemd user-service install/lifecycle controls, Linux systemd user-service status reporting, daemon diagnostics, daemon service logs, daemon service reinstall, CLI version reporting, CLI error-message improvements, integration-test documentation, exported package documentation/examples, the daemon-backed persistent forwarding design, the daemon forwarding protocol model, daemon-owned forwarding listener registration, TCP target bridging for persistent forwards, CLI persistent forwarding controls, and persistent forwarding diagnostics.
9
+
- Active focus: split the CLI into clearly separated custom and adb-compatibility modes. Custom mode preserves the current adb-go UX. Compat mode will target current Android SDK Platform-Tools `adb` CLI behavior closely enough that a future `adb` symlink can use adb-go as a drop-in replacement for supported workflows.
10
10
- Completed USB direction: Linux-only first, using the kernel usbfs interface under `/dev/bus/usb` behind build tags. This remains pure Go because it talks to device files and ioctls directly instead of linking native USB libraries.
11
11
12
12
## Milestone template
@@ -45,128 +45,126 @@ Milestone rules:
45
45
- Use grouped numbering such as `M40.1`, `M40.2`, and `M41.1` for related slices of one feature area.
46
46
- Do not keep fully implemented milestone bodies in this file long term; summarize completed ranges in `Progress` instead.
-[x] Add daemon request/response types for `forward_create`, `forward_list`, `forward_remove`, and `forward_remove_all`.
57
-
-[x] Define stable forwarding error codes such as `address_in_use`, `unsupported_endpoint`, `bad_target`, `rebind_disallowed`, and `forward_not_found`.
58
-
-[x] Add validation for the first supported endpoint families without opening listeners or ADB device connections.
59
-
-[x] Keep the protocol backward-compatible with existing `ping`, `status`, and `shutdown` commands.
56
+
-[ ] Move the current `cmd/adb-go` CLI implementation into `cmd/adb-go/internal/custom`.
57
+
-[ ] Expose a `custom.Run(args []string, stdout, stderr io.Writer) int` entrypoint for the moved implementation.
58
+
-[ ] Keep the current adb-go custom UX, command names, flags, usage text, and behavior unchanged.
59
+
-[ ] Leave `cmd/adb-go/main.go` as a thin compatibility wrapper around custom mode only; do not add mode detection yet.
60
+
-[ ] Update package names/imports and test package references after the move.
60
61
61
62
Tests:
62
63
63
-
-[x] Unit tests cover JSON request/response handling for forwarding commands.
64
-
-[x] Unit tests cover validation and stable daemon error codes.
65
-
-[x] Existing daemon protocol tests continue to pass.
66
-
-[x]`go test ./...` passes
64
+
-[ ] Existing CLI tests pass without intentional expectation changes.
65
+
-[ ]`go test ./...` passes
67
66
68
67
Done when:
69
68
70
-
-[x] The daemon protocol can parse, validate, and report forwarding commands without yet owning real listeners.
69
+
-[] The current adb-go CLI behavior is preserved exactly while the code lives under `cmd/adb-go/internal/custom`.
-[x] For each accepted daemon-owned local TCP connection, connect to the explicit TCP ADB target from the forwarding registration.
106
-
-[x] Open the configured remote `tcp:PORT` ADB service for each accepted host connection.
107
-
-[x] Copy bytes in both directions and close both sides when either side finishes.
108
-
-[x] Track active connection counts and last connection/setup errors for list diagnostics.
109
-
-[x] Keep USB target persistence out of scope for this first bridge slice.
104
+
-[ ] Add `cmd/adb-go/internal/compat` with an independent `compat.Run(args []string, stdout, stderr io.Writer) int` implementation.
105
+
-[ ] Implement compat `help`, `--help`, no-args, unknown command, and `version` behavior using the current Android SDK Platform-Tools `adb` output shape as the reference.
106
+
-[ ] Make compat `version` adb-shaped but explicit that the implementation is adb-go, for example with an `(adb-go compat)` marker or equivalent wording.
107
+
-[ ] Keep custom-only commands and flags such as `targets`, `daemon`, `install-apk`, `--addr`, `--usb`, and `ADB_GO_ADDR` out of compat mode.
108
+
-[ ] Parse official-style global options enough for host-only skeleton commands, including `-H` and `-P` before `version`.
110
109
111
110
Tests:
112
111
113
-
-[x] Tests use fake ADB and local TCP clients to verify bidirectional forwarding through the daemon.
114
-
-[x] Tests cover failed target dial/service-open behavior without dropping the local listener.
115
-
-[x] Tests cover remove/shutdown closing active bridged connections.
116
-
-[x]`go test ./...` passes
112
+
-[ ] Compat tests cover `help`, `--help`, no args, `-h`, unknown commands, `version`, and global `-H`/`-P` with `version`.
113
+
-[ ] Snapshot-style assertions cover important stdout/stderr placement and exit codes from the captured official adb reference.
114
+
-[ ]`go test ./...` passes
117
115
118
116
Done when:
119
117
120
-
-[x] A daemon-owned background forward can carry TCP traffic from a host client to a device `tcp:PORT` service through an explicit TCP ADB target.
118
+
-[ ] Compat mode has a real adb-shaped host-only skeleton while remaining independent from custom mode.
-[x] Add `adb-go forward --background` to create daemon-owned persistent forwards.
131
-
-[x] Add `adb-go forward --list`, `--remove LOCAL`, `--remove-id ID`, and `--remove-all` wired to the daemon protocol.
132
-
-[x] Keep existing foreground `adb-go forward LOCAL REMOTE` behavior unchanged when daemon flags are absent.
133
-
-[x] Print clear setup/list/remove output, including actual bound local address for `tcp:0`.
134
-
-[x] Return actionable daemon-unavailable or daemon-too-old hints, such as running `adb-go daemon doctor`.
135
-
-[x] Document the new CLI behavior and the non-durable in-memory daemon lifecycle.
128
+
-[ ] Add compat implementations for `start-server`, `kill-server`, and `devices` on top of adb-go daemon internals/protocol rather than the official adb server protocol.
129
+
-[ ] Auto-start the adb-go daemon for compat commands that need server state.
130
+
-[ ] Make `adb devices` show daemon-known TCP devices from prior compat `connect` work and locally discoverable USB devices when available.
131
+
-[ ] Keep broad blind TCP/emulator scanning out of the initial compat `devices` behavior.
132
+
-[ ] Preserve official adb CLI-facing output shape where practical while allowing different daemon internals.
136
133
137
134
Tests:
138
135
139
-
-[x] CLI tests cover argument parsing and daemon requests for background/list/remove/remove-all.
140
-
-[x] CLI tests cover foreground forwarding still using the existing process-scoped path.
141
-
-[x] CLI tests cover daemon-unavailable or unknown-command error messages.
142
-
-[x]`go test ./...` passes
136
+
-[ ] Compat tests cover server lifecycle commands and auto-start behavior.
137
+
-[ ] Compat tests cover no-device `devices` output matching the official reference shape.
138
+
-[ ] Daemon tests cover any new protocol/state needed by compat devices listing.
139
+
-[]`go test ./...` passes
143
140
144
141
Done when:
145
142
146
-
-[x] Users can create, inspect, and remove daemon-owned persistent TCP forwards from the CLI while existing foreground forwarding remains compatible.
143
+
-[ ] Compat mode has adb-shaped server lifecycle and device-list foundations backed by adb-go daemon internals.
Commit: `feat(cli): show daemon forwarding diagnostics`
149
+
Commit: `feat(cli): add compat target selection`
153
150
154
151
Tasks:
155
152
156
-
-[x] Add concise forwarding counts to daemon diagnostics without turning `daemon status` into a full forwarding table.
157
-
-[x] Include forwarding state hints in `adb-go daemon doctor` when daemon-owned forwards are degraded.
158
-
-[x] Ensure detailed mappings remain available through `adb-go forward --list`.
159
-
-[x] Update daemon and CLI documentation with troubleshooting examples for degraded forwards, target disconnects, and lost forwards after daemon restart.
153
+
-[ ] Support official target selectors `-s SERIAL`, `-d`, and `-e` in compat mode.
154
+
-[ ] Support `$ANDROID_SERIAL`, with `-s SERIAL` taking precedence.
0 commit comments