Skip to content

Instantly share code, notes, and snippets.

@jmaicher
Created March 11, 2013 09:07
Show Gist options
  • Save jmaicher/5132935 to your computer and use it in GitHub Desktop.
Save jmaicher/5132935 to your computer and use it in GitHub Desktop.
Simple tcl script for sending geo locations to the android emulator via telnet. Usage: geofix lng lat [port]
#!/usr/bin/expect
log_user 0 # supress output
switch -regexp [llength $argv] {
[0,1] {
puts "Usage: geofix lng lat \[port\]"
exit
}
3 { set port [lindex $argv 2] }
default { set port "5554" }
}
set lng [lindex $argv 0]
set lat [lindex $argv 1]
spawn telnet localhost $port
expect {
-ex "OK" {
send "geo fix $lng $lat\r"
}
-re "Unable to connect" {
puts "Error: Can't connect to android emulator on port $port"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment