github.com/graybobo/golang.org-package-offline-cache@v0.0.0-20200626051047-6608995c132f/x/mobile/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 // DO NOT EDIT. GENERATED BY 'gomobile help documentation doc.go'. 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.5 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 init install android compiler toolchain 27 install compile android APK and install on device 28 version print version 29 30 Use 'gomobile help [command]' for more information about that command. 31 32 33 Build a library for Android and iOS 34 35 Usage: 36 37 gomobile bind [-target android|ios] [-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 a target system name, either android (the 43 default) or ios. 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 9 or newer) to build the 56 library for Android. The environment variable ANDROID_HOME must be set 57 to the path to Android SDK. The generated Java class is in the java 58 package 'go.<package_name>' unless -javapkg flag is specified. 59 60 For -target ios, gomobile must be run on an OS X machine with Xcode 61 installed. Support is not complete. The generated Objective-C types 62 are prefixed with 'Go' unless the -prefix flag is provided. 63 64 The -v flag provides verbose output, including the list of packages built. 65 66 The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, and -work 67 are shared with the build command. For documentation, see 'go help build'. 68 69 70 Compile android APK and iOS app 71 72 Usage: 73 74 gomobile build [-target android|ios] [-o output] [build flags] [package] 75 76 Build compiles and encodes the app named by the import path. 77 78 The named package must define a main function. 79 80 The -target flag takes a target system name, either android (the 81 default) or ios. 82 83 For -target android, if an AndroidManifest.xml is defined in the 84 package directory, it is added to the APK output. Otherwise, a default 85 manifest is generated. 86 87 For -target ios, gomobile must be run on an OS X machine with Xcode 88 installed. Support is not complete. 89 90 If the package directory contains an assets subdirectory, its contents 91 are copied into the output. 92 93 The -o flag specifies the output file name. If not specified, the 94 output file name depends on the package built. 95 96 The -v flag provides verbose output, including the list of packages built. 97 98 The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, and -work are 99 shared with the build command. For documentation, see 'go help build'. 100 101 102 Install android compiler toolchain 103 104 Usage: 105 106 gomobile init [-u] 107 108 Init installs the Android C++ compiler toolchain and builds copies 109 of the Go standard library for mobile devices. 110 111 When first run, it downloads part of the Android NDK. 112 The toolchain is installed in $GOPATH/pkg/gomobile. 113 114 The -u option forces download and installation of the new toolchain 115 even when the toolchain exists. 116 117 118 Compile android APK and install on device 119 120 Usage: 121 122 gomobile install [-target android] [build flags] [package] 123 124 Install compiles and installs the app named by the import path on the 125 attached mobile device. 126 127 Only -target android is supported. The 'adb' tool must be on the PATH. 128 129 The build flags -a, -i, -n, -x, -gcflags, -ldflags, -tags, and -work are 130 shared with the build command. 131 For documentation, see 'go help build'. 132 133 134 Print version 135 136 Usage: 137 138 gomobile version 139 140 Version prints versions of the gomobile binary and tools 141 */ 142 package main // import "golang.org/x/mobile/cmd/gomobile"