cmd/gomobile: use GOOS=ios for iOS builds

This change permits gomobile to build iOS applications by properly
set GOOS=ios in the build process. The change is locally tested on
darwin/arm64, and can be build
using the following commands:

gomobile build -target=android -o=basic.apk \

gomobile build -target=ios -bundleid=org.golang.gomobiletest \

The built binaries are also tested on iOS 15 beta7 and Android 12 API31.

Updates golang/go#47952
Fixes golang/go#47238

Change-Id: Ibf40a77933ac957640c78d0dbc1af043477e4b3a
Reviewed-by: Dmitri Shuralyov <>
Reviewed-by: Hajime Hoshi <>
Trust: Dmitri Shuralyov <>
Trust: Bryan C. Mills <>
Run-TryBot: Hajime Hoshi <>
TryBot-Result: Go Bot <>
13 files changed
tree: e76d4549fca0bc8e46aa7e61f21c866d70053ff2
  1. .gitattributes
  2. .gitignore
  9. app/
  10. asset/
  11. bind/
  12. cmd/
  13. codereview.cfg
  14. doc/
  15. event/
  16. example/
  17. exp/
  18. geom/
  19. gl/
  20. go.mod
  21. go.sum
  22. internal/
  23. testdata/

Go support for Mobile devices

Go Reference

The Go mobile repository holds packages and build tools for using Go on mobile platforms.

Package documentation as a starting point:

Caution image

The Go Mobile project is experimental. Use this at your own risk. While we are working hard to improve it, neither Google nor the Go team can provide end-user support.

This is early work and installing the build system requires Go 1.5. Follow the instructions on to install the gomobile command, build the basic and the bind example apps.

Contributions to Go are appreciated. See