github.com/adwpc/xmobile@v0.0.0-20231212131043-3f9720cf0e99/cmd/gomobile/doc.go (about)

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