cmd/gomobile: concurrent build for iOS archive files

This change makes building archive files for iOS concurrent for each
architecture and each platform. The strategy is basically the same as
my previous CL for Android:

This change also specifies GOMODCACHE explicitly when executing Go
commands so that the existing cache is always used. The default
GOMODCACHE is $GOPATH/pkg/mod, and this path varies when a temporary
GOPATH is specified, which results in cold cache.

Before this change (on my MacBook Pro 2020):

$ time go run ./cmd/gomobile/ bind -target ios ./example/bind/hello/

real    0m23.274s
user    0m15.751s
sys     0m10.469s

After this change:

$ time go run ./cmd/gomobile/ bind -target ios ./example/bind/hello/

real    0m8.059s
user    0m13.763s
sys     0m9.004s

Updates golang/go#37902
Updates golang/go#54770

Change-Id: Iaeb077b58c22ab63d28f78972a0af76660883a05
Reviewed-by: Changkun Ou <>
Run-TryBot: Hajime Hoshi <>
Reviewed-by: Dmitri Shuralyov <>
TryBot-Result: Gopher Robot <>
Reviewed-by: Hyang-Ah Hana Kim <>
Reviewed-by: Dmitri Shuralyov <>
6 files changed
tree: d6def2880a8581033765c613bb5a7ab293a349c8
  1. app/
  2. asset/
  3. bind/
  4. cmd/
  5. doc/
  6. event/
  7. example/
  8. exp/
  9. geom/
  10. gl/
  11. internal/
  12. testdata/
  13. .gitattributes
  14. .gitignore
  15. codereview.cfg
  17. go.mod
  18. go.sum

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