Created
January 4, 2016 22:28
-
-
Save 13rac1/c455b7c627656b29e4f1 to your computer and use it in GitHub Desktop.
Automate pairing Android and Wear emulators with Expect
This file contains 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 | |
# Automates pairing Android and Wear emulators. | |
# Complete process described here: http://stackoverflow.com/questions/25205888/pairing-android-and-wear-emulators | |
# Run: ./androidwear DEVICEPORT | |
# Expect timeout, set short. | |
set timeout 4 | |
# Device port on localhost [REQUIRED] | |
set deviceport [lindex $argv 0] | |
# Start telnet and connect to device | |
spawn telnet localhost $deviceport | |
# Wait for OK to start | |
expect "OK" | |
# Send the port redirect command | |
send "redir add tcp:5601:5601\n" | |
# Wait for results | |
expect "OK" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment