135 lines
3.3 KiB
Go
135 lines
3.3 KiB
Go
|
// Copyright 2015 The Go Authors. All rights reserved.
|
||
|
// Use of this source code is governed by a BSD-style
|
||
|
// license that can be found in the LICENSE file.
|
||
|
|
||
|
// DO NOT EDIT. GENERATED BY 'gomobile help documentation'.
|
||
|
|
||
|
/*
|
||
|
Gomobile is a tool for building and running mobile apps written in Go.
|
||
|
|
||
|
Installation:
|
||
|
|
||
|
$ go get golang.org/x/mobile/cmd/gomobile
|
||
|
$ gomobile init
|
||
|
|
||
|
Note that until Go 1.5 is released, you must compile Go from
|
||
|
tip. For details see https://golang.org/doc/install/source.
|
||
|
The minimum process is:
|
||
|
|
||
|
$ git clone https://go.googlesource.com/go
|
||
|
$ cd go/src
|
||
|
$ ./all.bash
|
||
|
|
||
|
Usage:
|
||
|
|
||
|
gomobile command [arguments]
|
||
|
|
||
|
Commands:
|
||
|
|
||
|
bind build a shared library for android APK and iOS app
|
||
|
build compile android APK and iOS app
|
||
|
init install android compiler toolchain
|
||
|
install compile android APK and iOS app and install on device
|
||
|
|
||
|
Use 'gomobile help [command]' for more information about that command.
|
||
|
|
||
|
NOTE: iOS support is not ready yet.
|
||
|
|
||
|
|
||
|
Build a shared library for android APK and iOS app
|
||
|
|
||
|
Usage:
|
||
|
|
||
|
gomobile bind [package]
|
||
|
|
||
|
Bind generates language bindings like gobind (golang.org/x/mobile/cmd/gobind)
|
||
|
for a package and builds a shared library for each platform from the go binding
|
||
|
code.
|
||
|
|
||
|
The -outdir flag specifies the output directory and is required.
|
||
|
|
||
|
For Android, the bind command will place the generated Java API stubs and the
|
||
|
compiled shared libraries in the android subdirectory of the following layout.
|
||
|
|
||
|
<outdir>/android
|
||
|
libs/
|
||
|
armeabi-v7a/libgojni.so
|
||
|
...
|
||
|
src/main/java/go/
|
||
|
Seq.java
|
||
|
Go.java
|
||
|
mypackage/Mypackage.java
|
||
|
|
||
|
The -v flag provides verbose output, including the list of packages built.
|
||
|
|
||
|
These build flags are shared by the build command.
|
||
|
For documentation, see 'go help build':
|
||
|
-a
|
||
|
-i
|
||
|
-n
|
||
|
-x
|
||
|
-tags 'tag list'
|
||
|
|
||
|
|
||
|
Compile android APK and iOS app
|
||
|
|
||
|
Usage:
|
||
|
|
||
|
gomobile build [-o output] [-i] [build flags] [package]
|
||
|
|
||
|
Build compiles and encodes the app named by the import path.
|
||
|
|
||
|
The named package must define a main function.
|
||
|
|
||
|
If an AndroidManifest.xml is defined in the package directory, it is
|
||
|
added to the APK file. Otherwise, a default manifest is generated.
|
||
|
|
||
|
If the package directory contains an assets subdirectory, its contents
|
||
|
are copied into the APK file.
|
||
|
|
||
|
The -o flag specifies the output file name. If not specified, the
|
||
|
output file name depends on the package built. The output file must end
|
||
|
in '.apk'.
|
||
|
|
||
|
The -v flag provides verbose output, including the list of packages built.
|
||
|
|
||
|
These build flags are shared by the build, install, and test commands.
|
||
|
For documentation, see 'go help build':
|
||
|
-a
|
||
|
-i
|
||
|
-n
|
||
|
-x
|
||
|
-tags 'tag list'
|
||
|
|
||
|
|
||
|
Install android compiler toolchain
|
||
|
|
||
|
Usage:
|
||
|
|
||
|
gomobile init [-u]
|
||
|
|
||
|
Init downloads and installs the Android C++ compiler toolchain.
|
||
|
|
||
|
The toolchain is installed in $GOPATH/pkg/gomobile.
|
||
|
If the Android C++ compiler toolchain already exists in the path,
|
||
|
it skips download and uses the existing toolchain.
|
||
|
|
||
|
The -u option forces download and installation of the new toolchain
|
||
|
even when the toolchain exists.
|
||
|
|
||
|
|
||
|
Compile android APK and iOS app and install on device
|
||
|
|
||
|
Usage:
|
||
|
|
||
|
gomobile install [package]
|
||
|
|
||
|
Install compiles and installs the app named by the import path on the
|
||
|
attached mobile device.
|
||
|
|
||
|
This command requires the 'adb' tool on the PATH.
|
||
|
|
||
|
See the build command help for common flags and common behavior.
|
||
|
*/
|
||
|
package main
|