Skip to content

Commit 4b12af7

Browse files
aluedekeclaude
andauthored
Support GO_IOS_UDID environment variable (#645)
Add fallback to GO_IOS_UDID environment variable when --udid flag is not specified. This allows users to set the device UDID via environment variable for convenience. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude <[email protected]>
1 parent e4cbc45 commit 4b12af7

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ Options:
149149
--nojson Disable JSON output
150150
--pretty Pretty-print JSON command output
151151
-h --help Show this screen.
152-
--udid=<udid> UDID of the device.
152+
--udid=<udid> UDID of the device. Can also be set via GO_IOS_UDID environment variable.
153153
--tunnel-info-port=<port> When go-ios is used to manage tunnels for iOS 17+ it exposes them on an HTTP-API for localhost (default port: 28100)
154154
--address=<ipv6addrr> Address of the device on the interface. This parameter is optional and can be set if a tunnel created by MacOS needs to be used.
155155
> To get this value run "log stream --debug --info --predicate 'eventMessage LIKE "*Tunnel established*" OR eventMessage LIKE "*for server port*"'",
@@ -351,6 +351,9 @@ The commands work as following:
351351
tunnelCommand, _ := arguments.Bool("tunnel")
352352

353353
udid, _ := arguments.String("--udid")
354+
if udid == "" {
355+
udid = os.Getenv("GO_IOS_UDID")
356+
}
354357
address, addressErr := arguments.String("--address")
355358
rsdPort, rsdErr := arguments.Int("--rsd-port")
356359
userspaceTunnelHost, userspaceTunnelHostErr := arguments.String("--userspace-host")

0 commit comments

Comments
 (0)