"Fossies" - the Fresh Open Source Software Archive
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
the uninterpreted source code file.
1 Go on iOS
4 For details on developing Go for iOS on macOS, see the documentation in the mobile
9 It is necessary to set up the environment before running tests or programs directly on a
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
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
23 go run detect.go
25 which will output something similar to
27 export GOIOS_DEV_ID="iPhone Developer: firstname.lastname@example.org (XXXXXXXX)"
28 export GOIOS_APP_ID=YYYYYYYY.some.bundle.id
29 export GOIOS_TEAM_ID=ZZZZZZZZ
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.
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,
37 GOARCH=arm64 CGO_ENABLED=1 CC_FOR_TARGET=$(pwd)/../misc/ios/clangwrap.sh ./all.bash
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
42 export PATH=$GOROOT/bin:$PATH
43 GOARCH=arm64 CGO_ENABLED=1 go test archive/tar
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