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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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