doc.go 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. // Copyright 2015 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // Code generated by 'gomobile help documentation doc.go'. DO NOT EDIT.
  5. /*
  6. Gomobile is a tool for building and running mobile apps written in Go.
  7. To install:
  8. $ go install golang.org/x/mobile/cmd/gomobile@latest
  9. $ gomobile init
  10. At least Go 1.16 is required.
  11. For detailed instructions, see https://golang.org/wiki/Mobile.
  12. Usage:
  13. gomobile command [arguments]
  14. Commands:
  15. bind build a library for Android and iOS
  16. build compile android APK and iOS app
  17. clean remove object files and cached gomobile files
  18. init build OpenAL for Android
  19. install compile android APK and install on device
  20. version print version
  21. Use 'gomobile help [command]' for more information about that command.
  22. # Build a library for Android and iOS
  23. Usage:
  24. gomobile bind [-target android|ios|iossimulator|macos|maccatalyst] [-bootclasspath <path>] [-classpath <path>] [-o output] [build flags] [package]
  25. Bind generates language bindings for the package named by the import
  26. path, and compiles a library for the named target system.
  27. The -target flag takes either android (the default), or one or more
  28. comma-delimited Apple platforms (ios, iossimulator, macos, maccatalyst).
  29. For -target android, the bind command produces an AAR (Android ARchive)
  30. file that archives the precompiled Java API stub classes, the compiled
  31. shared libraries, and all asset files in the /assets subdirectory under
  32. the package directory. The output is named '<package_name>.aar' by
  33. default. This AAR file is commonly used for binary distribution of an
  34. Android library project and most Android IDEs support AAR import. For
  35. example, in Android Studio (1.2+), an AAR file can be imported using
  36. the module import wizard (File > New > New Module > Import .JAR or
  37. .AAR package), and setting it as a new dependency
  38. (File > Project Structure > Dependencies). This requires 'javac'
  39. (version 1.7+) and Android SDK (API level 15 or newer) to build the
  40. library for Android. The environment variable ANDROID_HOME must be set
  41. to the path to Android SDK. Use the -javapkg flag to specify the Java
  42. package prefix for the generated classes.
  43. By default, -target=android builds shared libraries for all supported
  44. instruction sets (arm, arm64, 386, amd64). A subset of instruction sets
  45. can be selected by specifying target type with the architecture name. E.g.,
  46. -target=android/arm,android/386.
  47. For Apple -target platforms, gomobile must be run on an OS X machine with
  48. Xcode installed. The generated Objective-C types can be prefixed with the
  49. -prefix flag.
  50. For -target android, the -bootclasspath and -classpath flags are used to
  51. control the bootstrap classpath and the classpath for Go wrappers to Java
  52. classes.
  53. The -v flag provides verbose output, including the list of packages built.
  54. The build flags -a, -n, -x, -gcflags, -ldflags, -tags, -trimpath, and -work
  55. are shared with the build command. For documentation, see 'go help build'.
  56. # Compile android APK and iOS app
  57. Usage:
  58. gomobile build [-target android|ios|iossimulator|macos|maccatalyst] [-o output] [-bundleid bundleID] [build flags] [package]
  59. Build compiles and encodes the app named by the import path.
  60. The named package must define a main function.
  61. The -target flag takes either android (the default), or one or more
  62. comma-delimited Apple platforms (ios, iossimulator, macos, maccatalyst).
  63. For -target android, if an AndroidManifest.xml is defined in the
  64. package directory, it is added to the APK output. Otherwise, a default
  65. manifest is generated. By default, this builds a fat APK for all supported
  66. instruction sets (arm, 386, amd64, arm64). A subset of instruction sets can
  67. be selected by specifying target type with the architecture name. E.g.
  68. -target=android/arm,android/386.
  69. For Apple -target platforms, gomobile must be run on an OS X machine with
  70. Xcode installed.
  71. By default, -target ios will generate an XCFramework for both ios
  72. and iossimulator. Multiple Apple targets can be specified, creating a "fat"
  73. XCFramework with each slice. To generate a fat XCFramework that supports
  74. iOS, macOS, and macCatalyst for all supportec architectures (amd64 and arm64),
  75. specify -target ios,macos,maccatalyst. A subset of instruction sets can be
  76. selectged by specifying the platform with an architecture name. E.g.
  77. -target=ios/arm64,maccatalyst/arm64.
  78. If the package directory contains an assets subdirectory, its contents
  79. are copied into the output.
  80. Flag -iosversion sets the minimal version of the iOS SDK to compile against.
  81. The default version is 13.0.
  82. Flag -androidapi sets the Android API version to compile against.
  83. The default and minimum is 15.
  84. The -bundleid flag is required for -target ios and sets the bundle ID to use
  85. with the app.
  86. The -o flag specifies the output file name. If not specified, the
  87. output file name depends on the package built.
  88. The -v flag provides verbose output, including the list of packages built.
  89. The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, -trimpath, and -work are
  90. shared with the build command. For documentation, see 'go help build'.
  91. # Remove object files and cached gomobile files
  92. Usage:
  93. gomobile clean
  94. # Clean removes object files and cached NDK files downloaded by gomobile init
  95. Build OpenAL for Android
  96. Usage:
  97. gomobile init [-openal dir]
  98. If a OpenAL source directory is specified with -openal, init will
  99. build an Android version of OpenAL for use with gomobile build
  100. and gomobile install.
  101. # Compile android APK and install on device
  102. Usage:
  103. gomobile install [-target android] [build flags] [package]
  104. Install compiles and installs the app named by the import path on the
  105. attached mobile device.
  106. Only -target android is supported. The 'adb' tool must be on the PATH.
  107. The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, -trimpath, and -work are
  108. shared with the build command.
  109. For documentation, see 'go help build'.
  110. # Print version
  111. Usage:
  112. gomobile version
  113. Version prints versions of the gomobile binary and tools
  114. */
  115. package main // import "golang.org/x/mobile/cmd/gomobile"