Created
March 11, 2013 09:07
-
-
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]
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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