Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Makefile targets to implement the buildbot steps.
- Loading branch information
Showing
7 changed files
with
106 additions
and
43 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
"""Kill the emulator.""" | ||
|
||
import sys | ||
import os | ||
import telnetlib | ||
|
||
def main(): | ||
try: | ||
with telnetlib.Telnet('localhost', 5554) as tn: | ||
idx, _, bytes_read = tn.expect([b'Android Console'], timeout=5) | ||
if idx != 0: | ||
if bytes_read: | ||
print(bytes_read, file=sys.stderr) | ||
return 'Timed out, not an Android Console' | ||
with open(os.path.expanduser('~/.emulator_console_auth_token'), | ||
'rb') as f: | ||
token = f.read() | ||
tn.write(b'auth ' + token + b'\n') | ||
tn.write(b'kill\n') | ||
print(tn.read_all().decode('ascii'), file=sys.stderr) | ||
except OSError as e: | ||
return e | ||
|
||
if __name__ == "__main__": | ||
err = main() | ||
if err is not None: | ||
print('Error: Cannot telnet to the Android Console: %s.' % err) | ||
sys.exit(1) |
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