README 732 B

12345678910111213141516171819202122232425
  1. Android
  2. =======
  3. For details on developing Go for Android, see the documentation in the
  4. mobile subrepository:
  5. https://github.com/golang/mobile
  6. To run the standard library tests, enable Cgo and use an appropriate
  7. C compiler from the Android NDK. For example,
  8. CGO_ENABLED=1 \
  9. GOOS=android \
  10. GOARCH=arm64 \
  11. CC_FOR_TARGET=$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang \
  12. ./all.bash
  13. To run tests on the Android device, add the bin directory to PATH so the
  14. go tool can find the go_android_$GOARCH_exec wrapper generated by
  15. make.bash. For example, to run the go1 benchmarks
  16. export PATH=$GOROOT/bin:$PATH
  17. cd $GOROOT/test/bench/go1/
  18. GOOS=android GOARCH=arm64 go test -bench=. -count=N -timeout=T