[mirror] Go on Mobile

Go support for Mobile devices

Go Reference

The Go mobile repository holds packages and build tools for using Go on mobile platforms.

Package documentation as a starting point:

Caution image

The Go Mobile project is experimental. Use this at your own risk. While we are working hard to improve it, neither Google nor the Go team can provide end-user support.

This is early work and installing the build system requires Go 1.5. Follow the instructions on golang.org/wiki/Mobile to install the gomobile command, build the basic and the bind example apps.

--

Contributions to Go are appreciated. See https://golang.org/doc/contribute.html.

Comments
  • cmd/gomobile: improve support for macOS and Catalyst

    cmd/gomobile: improve support for macOS and Catalyst

    This is is a follow-up from my previous PR (#65). It makes gomobile aware of GOOS=ios and adds support for specifying specific Apple platforms, instead of overloading the "ios" platform.

    Supported platforms: ios, iossimulator, macos, and maccatalyst

    These can now be specified the -target argument to gomobile, e.g.: gomobile build -target=ios,iossimulator,macos,maccatalyst

    It preserves the current behavior of -target=ios, which will build for ios and iossimulator on supported architectures (arm64 and amd64).

    It adds platform-specific build tags so Go code can discriminate between different Apple platforms like maccatalyst (UIKit on macOS).

    This PR also fixes a number of broken tests.

    TODO: cgo has a bug where c-archive builds targeting Catalyst will fail unless -tags=ios is supplied. See https://golang.org/issues/47228

    Fixes https://golang.org/issues/47212 Updates https://golang.org/issues/47228

  • cmd/gomobile: support macOS and Catalyst

    cmd/gomobile: support macOS and Catalyst

    Add support for macOS (non-Catalyst) and Catalyst targets.

    The compiled library is packaged into a "fat" XCFramework file (as opposed to a Framework), which includes binaries for iOS, macOS, MacCatalyst (iOS on macOS), and iOS Simulator targets, for amd64 and arm64 architectures.

    The generated XCFramework file is suitable for distribution as a binary Swift Package Manager package: https://developer.apple.com/documentation/swift_packages/distributing_binary_frameworks_as_swift_packages

    This change is based on earlier work: https://github.com/golang/mobile/pull/45 https://github.com/golang/mobile/pull/63

    Fixes golang/go#36856

  • cmd/gomobile: add missing latest tag to gobind

    cmd/gomobile: add missing latest tag to gobind

    Go install requires a version to be provided after the package name. gomobile init command is updated to reflect this new requirement

    Fixes golang/go#50994

  • Support building for target catalyst

    Support building for target catalyst

    As of macOS 10.15 target catalyst can be used to build an iPad app to run on macOS. Existing .Framework built with gomobile produces the following error when targetting catalyst:

    error: Building for Mac Catalyst, but the linked framework 'Sample.framework' was built for iOS + iOS Simulator.
    You may need to restrict the platforms for which this framework should be linked in the target editor, or replace it with an XCFramework that supports both platforms. (in target 'MySampleApp' from project 'MySampleApp')
    

    ~~This PR adds a case for catalyst (although architecture is just amd64) when configuring the environment for each architecture, providing the flags needed to enable the built .Framework to be used with catalyst.~~

    Fixes https://github.com/golang/go/issues/36856

    Update 18-Jan-2021

    This PR has been updated to provide nominally working support of .xcframework generation with go1.15, which has removed support for some 32 bit architectures. See: https://github.com/dpwiese/mobile/pull/1#issuecomment-761931422. In addition, unlike https://github.com/dpwiese/mobile/pull/1 this PR doesn't require manual thinning or combining of the generated .frameworks for each of the various "architectures" - this is now done automatically.

    Todo Running go test fails with the following.

    bind_test.go:321: gomobile bind failed: exit status 1
        /var/folders/rx/h40bjl5n0s1fvr5h2w278tm80000gn/T/gomobile-test335293790/gomobile: darwin-catalyst: go build -tags ios -buildmode=c-archive -o /var/folders/rx/h40bjl5n0s1fvr5h2w278tm80000gn/T/gomobile-work-224727912/Cgopkg-amd64.a ./gobind failed: exit status 1
        go: cannot determine module path for source directory /private/var/folders/rx/h40bjl5n0s1fvr5h2w278tm80000gn/T/gomobile-work-224727912/src (outside GOPATH, module path must be specified)
    

    Note: on current master branch TestIOSBuild fails

  • bind: annotate ObjC types with nullability annotations

    bind: annotate ObjC types with nullability annotations

    This highly improves interop with Swift. It would map all pointers as implicitly unwrapped optionals, which skip all null safety checks. Adding _Nullable to pointer types makes swift map them as optionals.

    Also constructors are now nullable since it's valid to return nil from Go code.

  • cmd/gomobile: support Catalyst and Apple Silicon

    cmd/gomobile: support Catalyst and Apple Silicon

    This PR is derived from golang/mobile#45 .

    I changed the build process and it will create 3 frameworks for ios, simulator and catalyst. Every framework has a fat library contains both arm64 and x86_64 (except ios that only needs arm64).

    Finally create one xcframework from all 3 fat frameworks and this xcframework contains every platform and architecture.

  • cmd/gomobile: remove unnecessary IsDir check

    cmd/gomobile: remove unnecessary IsDir check

    The check when looking for android platform is unnecessarily stringent in that the error would be caught by the call to os.Stat, and it fails when the android platform folder is a symlink, which is the case when developing on NixOs.

  • example: add Swift Package Manager example

    example: add Swift Package Manager example

    Add an example Swift package built with gomobile for multiple Apple platforms (ios, iosimulator, macos, and maccatalyst).

    It builds an XCFramework file which is linked as a binary dependency by Swift Package Manager. The resulting Swift package can be imported into an iOS, macOS, or Catalyst app and called from Swift.

    It has tests written in Swift. To run the tests, run swift test from the example/swift-package directory.

    Depends on golang.org/cl/334689 (golang/mobile#70).

  • bind/java: Do not get ApplicationContext via reflection, ask for it when needed.

    bind/java: Do not get ApplicationContext via reflection, ask for it when needed.

    Previously any library created using gobind used reflection to get the ApplicationContext. The methods used are disallowed in Android 9 causing any library to crash. However the ApplictionContext is not required and only needed when using RunOnJvm. This change adds an method to set the ApplicationContext when needed, but will not get it by default by using reflection.

    Fixes #31364

  • example: updates for XCFramework and Mac Catalyst

    example: updates for XCFramework and Mac Catalyst

    This updates examples for the changes in golang.org/cl/334689 for .xcframework files and Mac Catalyst.

    Depends on golang.org/cl/334689

    https://go-review.googlesource.com/c/mobile/+/334689/28/example/bind/ios/README#1

  • cmd/gomobile: xcframework and catalyst support

    cmd/gomobile: xcframework and catalyst support

    Talked with @waylybaye offline, I decided to continue #63 and #45.

    @waylybaye:

    I changed the build process and it will create 3 frameworks for ios, simulator and catalyst. Every framework has a fat library contains both arm64 and x86_64 (except ios that only needs arm64).

    Finally create one xcframework from all 3 fat frameworks and this xcframework contains every platform and architecture.

    Review comments at https://go-review.googlesource.com/c/mobile/+/288752 should be mostly resolved.

  • fix: In runInit, install gobind without @latest

    fix: In runInit, install gobind without @latest

    To "make sure gobind is up to date", runInit calls goInstall with "golang.org/x/mobile/cmd/gobind@latest" . But it shouldn't have "@latest". This instruction can replace the gobind command in the user's $GOPATH/bin with an unexpected version. Also, it is possible that "@latest" has a breaking change with the user's application. It is better to call goInstall without "@latest" so that it will follow the directives in the user's go.mod file.

  • cmd/gomobile: filter out xcrun warnings to get path

    cmd/gomobile: filter out xcrun warnings to get path

    Currently some installations of Xcode and Command Line Tools cause warnings about missing extensions which break parsing of paths returned from xcrun that gomobile depends on resulting in errors like this:

    cgo: C compiler "2022-09-07" not found: exec: "2022-09-07": executable file not found in $PATH
    

    This is caused by these warnings returned on stdout by xcrun:

     > xcrun --find clang
    2022-09-07 14:50:13.907 xcodebuild[69942:386823822] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionSentinelHostApplications for extension Xcode.DebuggerFoundation.AppExtensionHosts.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    2022-09-07 14:50:13.908 xcodebuild[69942:386823822] Requested but did not find extension point with identifier Xcode.IDEKit.ExtensionPointIdentifierToBundleIdentifier for extension Xcode.DebuggerFoundation.AppExtensionToBundleIdentifierMap.watchOS of plug-in com.apple.dt.IDEWatchSupportCore
    2022-09-07 14:50:14.041 xcodebuild[69942:386823822] XType: com.apple.fonts is not accessible.
    2022-09-07 14:50:14.041 xcodebuild[69942:386823822] XType: XTFontStaticRegistry is enabled.
    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang
    

    Resulting in gomobile interpreting the date 2022-09-07 as Clang compiler.

    Resolves: https://github.com/golang/go/issues/53316

  • fix: Add attribute nonnull_error if returning pointer and error from Objective-C

    fix: Add attribute nonnull_error if returning pointer and error from Objective-C

    Consider the following Go code with a method that returns a byte array and an error:

    package example
    
    type TestClass struct {
    }
    func (req *TestClass) GetData() ([]byte, error) {
            return nil, nil
    }
    

    gobind creates an Objective-C method which returns NSData* and an error:

    - (NSData* _Nullable)getData:(NSError* _Nullable* _Nullable)error {
        ....
    }
    

    The method signature seen by Swift is func getData() throws -> Data . The problem is that Data is not optional, and when the Objective-C method returns NULL the program crashes. This is the default signature as explained in the Swift documentation: https://clang.llvm.org/docs/AttributeReference.html#swift-error

    But this is not appropriate for gobind since it is valid for Go to return a nil value. We don't want the crash. This pull request updates asSignature so that if the method returns an error and the method returns a nullable pointer to NSData or NSString, then add the nonnull_error attribute as explained in the Swift documentation.

    With this attribute, the method signature seen by Swift is func getData() throws -> Data? . When the Go function returns nil, it is returned as a nil optional value without crashing.

  • Update README.md

    Update README.md

    Fixed a line break/seperator. Line break/seperator is added by 3 hyphens --- but in the previous README it was just 2 hyphens -- It ain't much, but it's honest work.

  • onLowMemory funktionality

    onLowMemory funktionality

    I think this change (https://github.com/fyne-io/fyne/pull/2956) should be added to gomobile too, it is only 2 rows of imports and 2 rows to release memory if Android OS send onLowMemory signal ...

MNA - stands for mobile number assignment - a small zero external dependency golang library that is used to identify mobile number assignment in tanzania

MNA - stands for mobile number assignment - a small zero external dependency golang library that is used to identify mobile number assignment in tanzania

Nov 29, 2021
Mirror - Mirror is command line tool for mirroring a web page
Mirror - Mirror is command line tool for mirroring a web page

mirror mirror is command line tool for mirroring a web page. Caution Do not abus

May 29, 2022
Mirror of Apache Calcite - Avatica Go SQL Driver

Apache Avatica/Phoenix SQL Driver Apache Calcite's Avatica Go is a Go database/sql driver for the Avatica server. Avatica is a sub-project of Apache C

Nov 3, 2022
This is only a mirror and Moved to https://gitea.com/lunny/tango

Tango 简体中文 Package tango is a micro & pluggable web framework for Go. Current version: v0.5.0 Version History Getting Started To install Tango: go get

Nov 18, 2022
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.
💨 A real time messaging system to build a scalable in-app notifications, multiplayer games, chat apps in web and mobile apps.

Beaver A Real Time Messaging Server. Beaver is a real-time messaging server. With beaver you can easily build scalable in-app notifications, realtime

Jan 1, 2023
Uniqush is a free and open source software system which provides a unified push service for server side notification to apps on mobile devices.

Homepage Download Blog/News @uniqush Introduction Uniqush (\ˈyü-nə-ku̇sh\ "uni" pronounced as in "unified", and "qush" pronounced as in "cushion") is

Jan 9, 2023
[mirror] This is a linter for Go source code.

Golint is a linter for Go source code. Installation Golint requires a supported release of Go. go get -u golang.org/x/lint/golint To find out where g

Dec 23, 2022
DNS over HTTPS [mirror]

dnss dnss is a daemon for using DNS over HTTPS. It can act as a proxy, receiving DNS requests and resolving them using DNS-over-HTTPs (DoH). This can

Dec 26, 2022
This is only a mirror and Moved to https://gitea.com/lunny/tango

Tango 简体中文 Package tango is a micro & pluggable web framework for Go. Current version: v0.5.0 Version History Getting Started To install Tango: go get

Nov 18, 2022
Mobile Blogging System

Mobile Blogging System

Mar 3, 2022
Mirror of the Gio main repository

Immediate mode GUI programs in Go for Android, iOS, macOS, Linux, FreeBSD, OpenBSD, Windows, and WebAssembly

Jan 5, 2023
k8s-image-swapper Mirror images into your own registry and swap image references automatically.
k8s-image-swapper Mirror images into your own registry and swap image references automatically.

k8s-image-swapper Mirror images into your own registry and swap image references automatically. k8s-image-swapper is a mutating webhook for Kubernetes

Dec 27, 2022
A collection of cool tools used by Mobile hackers. Happy hacking , Happy bug-hunting
A collection of cool tools used by Mobile hackers. Happy hacking , Happy bug-hunting

A collection of cool tools used by Mobile hackers. Happy hacking , Happy bug-hunting Family project Table of Contents Weapons Contribute Thanks to con

Jan 3, 2023
A simple daemon which will watch files on your filesystem, mirror them to MFS, automatically update related pins, and update related IPNS keys.
A simple daemon which will watch files on your filesystem, mirror them to MFS, automatically update related pins, and update related IPNS keys.

ipfs-sync is a simple daemon which will watch files on your filesystem, mirror them to MFS, automatically update related pins, and update related IPNS keys, so you can always access your directories from the same address. You can use it to sync your documents, photos, videos, or even a website!

Dec 30, 2022
:zap: Transfer files over wifi from your computer to your mobile device by scanning a QR code without leaving the terminal.
:zap: Transfer files over wifi from your computer to your mobile device by scanning a QR code without leaving the terminal.

$ qrcp Transfer files over Wi-Fi from your computer to a mobile device by scanning a QR code without leaving the terminal. You can support development

Dec 28, 2022
[mirror] Performance measurement, storage, and analysis.

Go performance measurement, storage, and analysis tools This subrepository holds the source for various packages and tools related to performance meas

Dec 24, 2022
Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.
Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core network solution.

Connecting the Next Billion People Magma is an open-source software platform that gives network operators an open, flexible and extendable mobile core

Dec 31, 2022
[mirror] star-tex (or *TeX) is a TeX engine in Go.

star-tex star-tex (or *TeX) is a TeX engine in Go. cmd/star-tex star-tex provides a TeX to DVI typesetter. $> star-tex ./testdata/hello.tex out.div $>

Dec 26, 2022
HTML Canvas 2D Context API for mobile, desktop and web

canvas HTML Canvas 2D Context API for mobile, desktop and web Context2D API https://www.w3.org/TR/2dcontext/ native code implement https://github.com/

Apr 22, 2022
Mobile Money API Handyman

pesakit pesakit is a highly configurable commandline tool that comes in handy during testing and development of systems that integrate with mobile mon

Nov 22, 2021