x/mobile: reduce size of generated artifacts #40348
Labels
FrozenDueToAge
mobile
Android, iOS, and x/mobile
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
The size of Go builds can be shrunk with the
ldflags
build option like this:go build -ldflags '-s -w' -o my_app.exe
This can be reduced further with UPX as such:
upx -o my_app_min.exe my_app.exe
More on this here.
I'm able to pass the
ldflags
into gomobile like this:gomobile bind -ldflags '-s -w' -target=android github.com/my/app
.I would like to "inject" UPX somewhere in the bind process to reduce the size of my generated
.aar
and.framework
.A possible flow is this:
go build -ldflags '-s -w' -o my_app.exe
upx -o my_app_min.exe my_app.exe
gomobile bind --from-build=my_app_min.exe -target=android github.com/my/app
The text was updated successfully, but these errors were encountered: