2014-07-09 04:56:49 -06:00
|
|
|
Android
|
|
|
|
=======
|
|
|
|
|
|
|
|
For details on developing Go for Android, see the documentation in the
|
2015-01-15 14:47:41 -07:00
|
|
|
mobile subrepository:
|
2014-07-09 04:56:49 -06:00
|
|
|
|
2015-01-15 14:47:41 -07:00
|
|
|
https://github.com/golang/mobile
|
2014-07-09 04:56:49 -06:00
|
|
|
|
2019-02-24 07:18:02 -07:00
|
|
|
To run the standard library tests, enable Cgo and use an appropriate
|
|
|
|
C compiler from the Android NDK. For example,
|
2014-07-09 04:56:49 -06:00
|
|
|
|
2019-02-24 07:18:02 -07:00
|
|
|
CGO_ENABLED=1 \
|
|
|
|
GOOS=android \
|
|
|
|
GOARCH=arm64 \
|
2019-05-16 21:27:15 -06:00
|
|
|
CC_FOR_TARGET=$NDK/toolchains/llvm/prebuilt/linux-x86_64/bin/aarch64-linux-android21-clang \
|
2019-02-24 07:18:02 -07:00
|
|
|
./all.bash
|
2018-05-08 22:11:12 -06:00
|
|
|
|
|
|
|
To run tests on the Android device, add the bin directory to PATH so the
|
|
|
|
go tool can find the go_android_$GOARCH_exec wrapper generated by
|
2019-02-24 07:18:02 -07:00
|
|
|
make.bash. For example, to run the go1 benchmarks
|
2018-05-08 22:11:12 -06:00
|
|
|
|
|
|
|
export PATH=$GOROOT/bin:$PATH
|
|
|
|
cd $GOROOT/test/bench/go1/
|
2018-05-22 23:33:06 -06:00
|
|
|
GOOS=android GOARCH=arm64 go test -bench=. -count=N -timeout=T
|
|
|
|
|