github.com/acrespo/mobile@v0.0.0-20190107162257-dc0771356504/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 get golang.org/x/mobile/cmd/gomobile 13 $ gomobile init 14 15 At least Go 1.10 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 install NDK toolchains and 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] [-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 a target system name, either android (the 44 default) or ios. 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 -target ios, gomobile must be run on an OS X machine with Xcode 67 installed. The generated Objective-C types can be prefixed with the -prefix 68 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, 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] [-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 a target system name, either android (the 91 default) or ios. 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 -target ios, gomobile must be run on an OS X machine with Xcode 101 installed. 102 103 If the package directory contains an assets subdirectory, its contents 104 are copied into the output. 105 106 Flag -iosversion sets the minimal version of the iOS SDK to compile against. 107 The default version is 6.1. 108 109 The -bundleid flag is required for -target ios and sets the bundle ID to use 110 with the app. 111 112 The -o flag specifies the output file name. If not specified, the 113 output file name depends on the package built. 114 115 The -v flag provides verbose output, including the list of packages built. 116 117 The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, and -work are 118 shared with the build command. For documentation, see 'go help build'. 119 120 121 Remove object files and cached gomobile files 122 123 Usage: 124 125 gomobile clean 126 127 Clean removes object files and cached NDK files downloaded by gomobile init 128 129 130 Install NDK toolchains and build OpenAL for Android 131 132 Usage: 133 134 gomobile init [-ndk dir] [-openal dir] 135 136 If the -ndk flag is specified or the Android NDK is installed at 137 $ANDROID_HOME/ndk-bundle, init will create NDK standalone toolchains 138 for Android targets. 139 140 If a OpenAL source directory is specified with -openal, init will 141 build an Android version of OpenAL for use with gomobile build 142 and gomobile install. 143 144 145 Compile android APK and install on device 146 147 Usage: 148 149 gomobile install [-target android] [build flags] [package] 150 151 Install compiles and installs the app named by the import path on the 152 attached mobile device. 153 154 Only -target android is supported. The 'adb' tool must be on the PATH. 155 156 The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, and -work are 157 shared with the build command. 158 For documentation, see 'go help build'. 159 160 161 Print version 162 163 Usage: 164 165 gomobile version 166 167 Version prints versions of the gomobile binary and tools 168 */ 169 package main // import "golang.org/x/mobile/cmd/gomobile"