asensor

command module
v0.0.0-...-8c85b09 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 7 Imported by: 0

README

asensor

Inspect Android sensors from the command line. Lists available sensors, shows their static metadata, and reads a single event from any of them.

Works on Android (including Termux). Uses purego to call libandroid.so at runtime.

Quick start

Run directly from GitHub without installing:

go run github.com/PeronGH/asensor@latest list

Build

GOOS=android GOARCH=arm64 go build -o asensor .

Usage

# List every sensor (index and name)
asensor list

# Full details per sensor
asensor list -verbose

# Metadata for one sensor
asensor show 0

# Read one event (waits forever by default; stop with Ctrl+C)
asensor read 0

# Or wait a limited time for sensors that fire only on real-world events
asensor read -timeout 30s 40

# Stream indefinitely (default; stop with Ctrl+C)
asensor watch 31

# Stream for a limited time (e.g. watch the flicker sensor)
asensor watch -duration 10s 31

Indices come from asensor list and are zero-based.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package sensor provides a minimal, cgo-free wrapper around the Android NDK sensor API.
Package sensor provides a minimal, cgo-free wrapper around the Android NDK sensor API.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL