← writing

Wrapping the tools you already have

Rudra Narayan Panda ·

lazymobile is a terminal dashboard for mobile development: iOS simulators, Android emulators, connected phones, their logs, and Expo builds in one screen. It is one Go binary that calls xcrun, adb, emulator and eas. Its device logic started in devices.nvim, the same idea as a Neovim plugin, and was ported to Go.

Wrapping existing tools sounds easy. The work is in what those tools do not promise: stable output, one process id per app, and a place where a release build's print() goes. Here are the parts that took thought.

the output changes under you

lazymobile does not link to any Apple or Android library. It runs the tool and parses what comes back, so the parser is the contract. simctl alone has two generations of output. Modern versions report isAvailable as a boolean. Older ones report an availability string. Runtime keys changed too, from names like iOS 12.1 to SimRuntime.iOS-18-2. Both are read:

func available(isAvailable *bool, availability *string) bool {
	if isAvailable != nil {
		return *isAvailable
	}
	return availability == nil || *availability == "(available)"
}

devicectl, which lists physical iPhones, moved its fields under properties in Xcode 27 and reports versions as an object with a stringValue. The parser reads the new layout first and falls back to the old one. One more rule: each device entry is decoded on its own, so one malformed entry cannot hide the rest of the list.

following an Android app across restarts

adb logcat prints a process id on every line. Filter on one pid and the log goes quiet the moment the app restarts, because the new process has a new pid. lazymobile keeps a set of pids for the package instead, and fills it from two places:

func (f *AppFilter) Accept(line Line) bool {
	if m := f.start.FindStringSubmatch(line.Text); m != nil {
		f.pids[m[1]] = true
		return true
	}
	if line.PID != "" && f.pids[line.PID] {
		return true
	}
	return strings.Contains(line.Text, f.pkg)
}

The last line keeps anything that names the package, so crash reports and system messages about your app stay in view even when they come from another process.

the release build that prints nothing

On iOS, a release app's print() and NSLog output goes to its standard output, and only the tool that launched the app sees that. Open the system log for a release build and you will not find it. So alongside the system log, lazymobile offers to launch the app itself and show its output. On a simulator that is simctl launch --console-pty. A pseudo-terminal keeps the app's output line-buffered, so lines arrive as they are printed and not in a late burst. On a phone it is devicectl device process launch --console.

treat the arguments as untrusted

A dashboard that builds command lines from names on a screen needs rules about what reaches the shell.

what I have and have not tested

The README keeps a status table, and I would rather say it here than let you find out. Tested on real hardware or real tools:

Tested with fake tools only:

Fake tools are how most of the suite runs in CI, on Ubuntu and macOS. They prove the parsing and the flow, not that a real device agrees.

try it

brew install 0xrnp/tap/lazymobile
lazymobile doctor

lazymobile doctor says what is missing and how to install it. If something fails, the issue form asks for its output. The Neovim version is devices.nvim.