Skip to content

[Compile]: How to compile IOS version #516

Closed
@zhaolibo1989

Description

@zhaolibo1989

What would you like to share?

I am trying to compile Android, WASM, and IOS versions on the Windows platform.

I have successfully compiled Android and WASM versions using the following scripts.

Android:

go get golang.org/x/mobile/bind
go env -w GOOS=windows GOARCH=amd64
set JAVA_TOOL_OPTIONS=-Dfile.encoding=utf-8 
gomobile bind -v -trimpath -ldflags="-s -w" -o ./open_im_sdk.aar -target=android ./open_im_sdk/ ./open_im_sdk_callback/

WASM:

go env -w GOOS=js GOARCH=wasm 
go build -trimpath -ldflags "-s -w" -o ./_output/bin/openIM.wasm wasm/cmd/main.go

However, using similar scripts cannot compile the IOS version.

IOS:

go get golang.org/x/mobile/bind

RMDIR /Q build
RMDIR /Q open_im_sdk\ws_wrapper
DEL /Q open_im_sdk\t_friend_sdk.go
DEL /Q open_im_sdk\t_group_sdk.go

go env -w GOOS=darwin GOARCH=arm64
gomobile bind -v -trimpath -ldflags "-s -w" -o build/OpenIMCore.xcframework -target=ios ./open_im_sdk/ ./open_im_sdk_callback/

How can I complie the IOS version?

Additional information

My IOS build script output:

D:\work\code\OpenIMSDK\openim-sdk-core>go get golang.org/x/mobile/bind

D:\work\code\OpenIMSDK\openim-sdk-core>RMDIR /Q build
系统找不到指定的文件。

D:\work\code\OpenIMSDK\openim-sdk-core>RMDIR /Q open_im_sdk\ws_wrapper
系统找不到指定的文件。

D:\work\code\OpenIMSDK\openim-sdk-core>DEL /Q open_im_sdk\t_friend_sdk.go
找不到 D:\work\code\OpenIMSDK\openim-sdk-core\open_im_sdk\t_friend_sdk.go

D:\work\code\OpenIMSDK\openim-sdk-core>DEL /Q open_im_sdk\t_group_sdk.go
找不到 D:\work\code\OpenIMSDK\openim-sdk-core\open_im_sdk\t_group_sdk.go

D:\work\code\OpenIMSDK\openim-sdk-core>go env -w GOOS=darwin GOARCH=arm64

D:\work\code\OpenIMSDK\openim-sdk-core>gomobile bind -v -trimpath -ldflags "-s -w" -o build/OpenIMCore.xcframework -target=ios ./open_im_sdk/ ./open_im_sdk_callback/
gomobile: -target="ios" requires Xcode

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIndicates an issue or PR lacks a `triage/foo` label and requires one.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions