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
|
|
|
|
|
|
|
To run the standard library tests, see androidtest.bash. Run it as
|
|
|
|
|
2018-05-08 22:11:12 -06:00
|
|
|
CC_FOR_TARGET=$STANDALONE_NDK_PATH/bin/clang GOARCH=arm64 ./androidtest.bash
|
|
|
|
|
|
|
|
To create a standalone android NDK tool chain, follow the instructions on
|
|
|
|
|
|
|
|
https://developer.android.com/ndk/guides/standalone_toolchain
|
|
|
|
|
|
|
|
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
|
|
|
|
androidtest.bash. Then, use the same GOARCH as when androidtest.bash ran
|
|
|
|
and set GOOS to android. For example, to run the go1 benchmarks
|
|
|
|
|
|
|
|
export PATH=$GOROOT/bin:$PATH
|
|
|
|
cd $GOROOT/test/bench/go1/
|
|
|
|
GOOS=android GOARCH=arm64 go test -bench=. -count=N -timeout=T
|