OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Provides an interface to start and stop Android emulator. | 7 """Provides an interface to start and stop Android emulator. |
8 | 8 |
9 Assumes system environment ANDROID_NDK_ROOT has been set. | 9 Assumes system environment ANDROID_NDK_ROOT has been set. |
10 | 10 |
(...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
214 if not self.fast_and_loose: | 214 if not self.fast_and_loose: |
215 self._AggressiveImageCleanup() | 215 self._AggressiveImageCleanup() |
216 (self.device, port) = self._DeviceName() | 216 (self.device, port) = self._DeviceName() |
217 emulator_command = [ | 217 emulator_command = [ |
218 self.emulator, | 218 self.emulator, |
219 # Speed up emulator launch by 40%. Really. | 219 # Speed up emulator launch by 40%. Really. |
220 '-no-boot-anim', | 220 '-no-boot-anim', |
221 # The default /data size is 64M. | 221 # The default /data size is 64M. |
222 # That's not enough for 8 unit test bundles and their data. | 222 # That's not enough for 8 unit test bundles and their data. |
223 '-partition-size', '512', | 223 '-partition-size', '512', |
| 224 # Enable GPU by default. |
| 225 '-gpu', 'on', |
224 # Use a familiar name and port. | 226 # Use a familiar name and port. |
225 '-avd', self.avd, | 227 '-avd', self.avd, |
226 '-port', str(port)] | 228 '-port', str(port)] |
227 if not self.fast_and_loose: | 229 if not self.fast_and_loose: |
228 emulator_command.extend([ | 230 emulator_command.extend([ |
229 # Wipe the data. We've seen cases where an emulator | 231 # Wipe the data. We've seen cases where an emulator |
230 # gets 'stuck' if we don't do this (every thousand runs or | 232 # gets 'stuck' if we don't do this (every thousand runs or |
231 # so). | 233 # so). |
232 '-wipe-data', | 234 '-wipe-data', |
233 ]) | 235 ]) |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 """Install a handler to kill the emulator when we exit unexpectedly.""" | 312 """Install a handler to kill the emulator when we exit unexpectedly.""" |
311 for sig in self._SIGNALS: | 313 for sig in self._SIGNALS: |
312 signal.signal(sig, self._ShutdownOnSignal) | 314 signal.signal(sig, self._ShutdownOnSignal) |
313 | 315 |
314 def main(argv): | 316 def main(argv): |
315 Emulator(None, True).Launch(True) | 317 Emulator(None, True).Launch(True) |
316 | 318 |
317 | 319 |
318 if __name__ == '__main__': | 320 if __name__ == '__main__': |
319 main(sys.argv) | 321 main(sys.argv) |
OLD | NEW |