go install github.com/iamcalledrob/ndkenv@latest
go install github.com/iamcalledrob/go-android-test@latest
Usage:
go-android-test [OPTIONS]
Example:
ANDROID_SERIAL=emulator-1234 go-android-test -s 21 -run TestFoo -v
Device selection is delegated to adb, pass in ANDROID_SERIAL= environment variable to adb to specify
a device to run tests on.
Application Options:
-s, --min-sdk-version= Minimum android SDK version
The utility currently assumes that all builds will require the NDK and cgo—and uses ndkenv to configure the cross-compilation.
Testing pure Go code is still possible, but requires the unnecessary step of having a working NDK.