New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
x/mobile/cmd/gomobile: add iOS build support #11043
Comments
I may move the discussion to golang-dev@ if any extensive discussion is required. |
If the latter approach works, creating an Xcode project and building it with xcodebuild, I would prefer that as it offers users more flexibility. However I'm not sure how it will be compatible with our linking process. For gomobile bind this strategy will definitely work, because we provide .a files and expect the entry point to be a main function in a .m/.c file, which xcode understands how to link. Perhaps it is possible to replace the binary compile command with an xcode project setting? One alternative would be to forgo real binary building and build with -buildmode=c-archive and let xcode do the linking (with a tiny .c file containing a main function). It would be odd, building libraries and passing them to xcode because there's no other way to get at its app building machinery, but if there's no other way it would probably work. Minor notes:
|
I was able to skip the compile/link step just by removing the main.c, adding a static binary to the project and setting the CFBundleExecutable. I will investigate if it is achievable with lipo files.
We may look for a, let's say, splash.png in the assets directory and fall back to a default image (which is likely to be a black image). According to the guidelines, a black screen is not a bad idea. |
The idea worked with fat binaries! I pushed a minimal Xcode project to https://github.com/rakyll/go-xcode and am suggesting to follow this path. Being able to work with Xcode is great for the developer experience. I am seamlessly pushing the debug builds to the test device, can export the app as an ad-hoc distribution or publish the app to the App Store. |
Blocked by #11075. |
Updates golang/go#11043. Change-Id: Ied1a2a4842dc0078dc34da1266c11eec9acba114 Reviewed-on: https://go-review.googlesource.com/11263 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Blocked by #11311. |
Blocked by #11339. |
CL https://golang.org/cl/11345 mentions this issue. |
This CL will be followed by another change to remove the misc/ios/clangwrapper.sh dependency. Updates golang/go#11043. Fixes golang/go#11339. Change-Id: I82466f8d845945935ab82d3d0b75f5af9e1ef3ec Reviewed-on: https://go-review.googlesource.com/11345 Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
Blocked by #11342. |
Blocked by #11337. |
CL https://golang.org/cl/11587 mentions this issue. |
This CL adds iOS build support to gomobile command. $ gomobile build golang.org/x/mobile/example/basic gomobile builds an .app file that is signed with the development provisioning entities. You may deploy .app files to your test device or convert them to IPA to publish on App Store or share them as an AdHoc distribution. target=ios flag requires a Darwin host machine. Fixes golang/go#11043. Change-Id: Ibc23b6d355f10b09940b20c813eb73d0f4313851 Reviewed-on: https://go-review.googlesource.com/11587 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This CL adds iOS build support to gomobile command. $ gomobile build golang.org/x/mobile/example/basic gomobile builds an .app file that is signed with the development provisioning entities. You may deploy .app files to your test device or convert them to IPA to publish on App Store or share them as an AdHoc distribution. target=ios flag requires a Darwin host machine. Fixes golang/go#11043. Change-Id: Ibc23b6d355f10b09940b20c813eb73d0f4313851 Reviewed-on: https://go-review.googlesource.com/11587 Reviewed-by: David Crawshaw <crawshaw@golang.org>
This is the tracking bug for the gomobile’s iOS build support.
There are two obvious strategies we can follow to build an *.app file from a Go package.
The first alternative is what misc/ios/go_darwin_arm_exec.go has been doing.
Or a simpler alternative is to create a minimal Xcode project.
Any feedback or opinions about which way to follow?
cc/ @crawshaw @hyangah @minux
The text was updated successfully, but these errors were encountered: