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