Skip to content

Instantly share code, notes, and snippets.

@clayrisser
Forked from NickGeek/avd_selection.py
Last active January 9, 2017 19:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save clayrisser/ba6d8c4471a7cf464ceeb28987c50683 to your computer and use it in GitHub Desktop.
Save clayrisser/ba6d8c4471a7cf464ceeb28987c50683 to your computer and use it in GitHub Desktop.
#!/bin/python3
import os
os.system('cd ~/Android/Sdk/tools')
AVDs = [file.split('.')[0] for file in os.listdir(os.path.expanduser('~/.android/avd/')) if file.split('.')[len(file.split('.'))-1] == 'ini']
i = 0
for avd in AVDs:
i += 1
print("{0}. {1}".format(i, avd))
selection = int(input("Type in the number of the AVD you wish to launch: "))
os.system("LD_PRELOAD='/usr/$LIB/libstdc++.so.6' DISPLAY=:0 ./emulator -avd {}".format(AVDs[selection-1]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment