Skip to content

Commit

Permalink
Merge pull request tidev#1574 from CPep22/timob-7333
Browse files Browse the repository at this point in the history
timob-7333: builder.py can take an avd name as an argument instead of the avd id and the avd skin
  • Loading branch information
marshall committed Mar 12, 2012
2 parents a2fe1b9 + d0a6736 commit 47da5ef
Showing 1 changed file with 19 additions and 8 deletions.
27 changes: 19 additions & 8 deletions support/android/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,12 +413,15 @@ def create_avd(self,avd_id,avd_skin):

return name

def run_emulator(self,avd_id,avd_skin,add_args):
def run_emulator(self,avd_id,avd_skin,avd_name,add_args):
info("Launching Android emulator...one moment")
debug("From: " + self.sdk.get_emulator())
debug("SDCard: " + self.sdcard)
debug("AVD ID: " + avd_id)
debug("AVD Skin: " + avd_skin)
if avd_name == None:
debug("AVD ID: " + avd_id)
debug("AVD Skin: " + avd_skin)
else:
debug("AVD Name: " + avd_name)
debug("SDK: " + sdk_dir)

# make sure adb is running on windows, else XP can lockup the python
Expand All @@ -433,7 +436,8 @@ def run_emulator(self,avd_id,avd_skin,add_args):
sys.exit()

# this will create an AVD on demand or re-use existing one if already created
avd_name = self.create_avd(avd_id,avd_skin)
if avd_name == None:
avd_name = self.create_avd(avd_id,avd_skin)

# start the emulator
emulator_cmd = [
Expand Down Expand Up @@ -2083,14 +2087,21 @@ def usage():

try:
if command == 'run-emulator':
s.run_emulator(avd_id, avd_skin, [])
s.run_emulator(avd_id, avd_skin, None, [])
elif command == 'run':
s.build_and_run(False, avd_id)
elif command == 'emulator':
avd_id = dequote(sys.argv[6])
avd_skin = dequote(sys.argv[7])
add_args = sys.argv[8:]
s.run_emulator(avd_id, avd_skin, add_args)
if avd_id.isdigit():
avd_name = None
avd_skin = dequote(sys.argv[7])
add_args = sys.argv[8:]
else:
avd_name = sys.argv[6]
avd_id = None
avd_skin = None
add_args = sys.argv[7:]
s.run_emulator(avd_id, avd_skin, avd_name, add_args)
elif command == 'simulator':
info("Building %s for Android ... one moment" % project_name)
avd_id = dequote(sys.argv[6])
Expand Down

0 comments on commit 47da5ef

Please sign in to comment.