mobile

package
v0.2.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2024 License: BSD-3-Clause Imports: 42 Imported by: 0

Documentation

Overview

Package mobile provides functions for building Cogent Core apps for mobile devices.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Build

func Build(c *config.Config) error

Build compiles and encodes the app named by the import path.

The named package must define a main function.

The -target flag takes either android (the default), or one or more comma-delimited Apple platforms (TODO: apple platforms list).

For -target android, if an AndroidManifest.xml is defined in the package directory, it is added to the APK output. Otherwise, a default manifest is generated. By default, this builds a fat APK for all supported instruction sets (arm, 386, amd64, arm64). A subset of instruction sets can be selected by specifying target type with the architecture name. E.g. -target=android/arm,android/386.

For Apple -target platforms, gomobile must be run on an OS X machine with Xcode installed.

By default, -target ios will generate an XCFramework for both ios and iossimulator. Multiple Apple targets can be specified, creating a "fat" XCFramework with each slice. To generate a fat XCFramework that supports iOS, macOS, and macCatalyst for all supportec architectures (amd64 and arm64), specify -target ios,macos,maccatalyst. A subset of instruction sets can be selectged by specifying the platform with an architecture name. E.g. -target=ios/arm64,maccatalyst/arm64.

If the package directory contains an assets subdirectory, its contents are copied into the output.

func Install

func Install(c *config.Config) error

Install installs the app named by the import path on the attached mobile device. It assumes that it has already been built.

On Android, the 'adb' tool must be on the PATH.

Types

This section is empty.

Directories

Path Synopsis
Package binres implements encoding and decoding of android binary resources.
Package binres implements encoding and decoding of android binary resources.
Package sdkpath provides functions for locating the Android SDK.
Package sdkpath provides functions for locating the Android SDK.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL