"Fossies" - the Fresh Open Source Software Archive

Member "go/misc/ios/README" (9 Sep 2020, 2314 Bytes) of package /windows/misc/go1.14.9.windows-386.zip:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 Go on iOS
    2 =========
    3 
    4 For details on developing Go for iOS on macOS, see the documentation in the mobile
    5 subrepository:
    6 
    7     https://github.com/golang/mobile
    8 
    9 It is necessary to set up the environment before running tests or programs directly on a
   10 device.
   11 
   12 First make sure you have a valid developer certificate and have setup your device properly
   13 to run apps signed by your developer certificate. Then install the libimobiledevice and
   14 ideviceinstaller tools from https://www.libimobiledevice.org/. Use the HEAD versions from
   15 source; the stable versions have bugs that prevents the Go exec wrapper to install and run
   16 apps.
   17 
   18 Second, the Go exec wrapper must be told the developer account signing identity, the team
   19 id and a provisioned bundle id to use. They're specified with the environment variables
   20 GOIOS_DEV_ID, GOIOS_TEAM_ID and GOIOS_APP_ID. The detect.go program in this directory will
   21 attempt to auto-detect suitable values. Run it as
   22 
   23 	go run detect.go
   24 
   25 which will output something similar to
   26 
   27 	export GOIOS_DEV_ID="iPhone Developer: xxx@yyy.zzz (XXXXXXXX)"
   28 	export GOIOS_APP_ID=YYYYYYYY.some.bundle.id
   29 	export GOIOS_TEAM_ID=ZZZZZZZZ
   30 
   31 If you have multiple devices connected, specify the device UDID with the GOIOS_DEVICE_ID
   32 variable. Use `idevice_id -l` to list all available UDIDs.
   33 
   34 Finally, to run the standard library tests, run all.bash as usual, but with the compiler
   35 set to the clang wrapper that invokes clang for iOS. For example,
   36 
   37 	GOARCH=arm64 CGO_ENABLED=1 CC_FOR_TARGET=$(pwd)/../misc/ios/clangwrap.sh ./all.bash
   38 
   39 To use the go tool directly to run programs and tests, put $GOROOT/bin into PATH to ensure
   40 the go_darwin_$GOARCH_exec wrapper is found. For example, to run the archive/tar tests
   41 
   42 	export PATH=$GOROOT/bin:$PATH
   43 	GOARCH=arm64 CGO_ENABLED=1 go test archive/tar
   44 
   45 Note that the go_darwin_$GOARCH_exec wrapper uninstalls any existing app identified by
   46 the bundle id before installing a new app. If the uninstalled app is the last app by
   47 the developer identity, the device might also remove the permission to run apps from
   48 that developer, and the exec wrapper will fail to install the new app. To avoid that,
   49 install another app with the same developer identity but with a different bundle id.
   50 That way, the permission to install apps is held on to while the primary app is
   51 uninstalled.