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