Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions ios/usbmuxconnection.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,19 @@ func ToUnixSocketPath(socketAddress string) string {
func GetUsbmuxdSocket() string {
socket_override := os.Getenv("USBMUXD_SOCKET_ADDRESS")
if socket_override != "" {
if strings.Contains(socket_override, ":") {
return "tcp://" + socket_override
} else {
// if it has a scheme, just use it
if strings.Contains(socket_override, "://") {
return socket_override
}
// if it is a file, use it as unix socket
if _, err := os.Stat(socket_override); err == nil {
return "unix://" + socket_override
}
// if it is a tcp address, use it
if strings.Contains(socket_override, ":") && strings.Contains(socket_override, ".") {
Copy link
Collaborator

@aluedeke aluedeke Dec 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how about hostname:port this?

Can't we fix this and maintain backward compatibility?

Check if there is a scheme on the string if so return it. If not fallback to the old logic.

return "tcp://" + socket_override
}
panic("Unknown socket address: " + socket_override)
}
switch runtime.GOOS {
case "windows":
Expand Down