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 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 """Creates an AVD with the given name. | 168 """Creates an AVD with the given name. |
169 | 169 |
170 Return avd_name. | 170 Return avd_name. |
171 """ | 171 """ |
172 avd_command = [ | 172 avd_command = [ |
173 self.android, | 173 self.android, |
174 '--silent', | 174 '--silent', |
175 'create', 'avd', | 175 'create', 'avd', |
176 '--name', avd_name, | 176 '--name', avd_name, |
177 '--abi', self.abi, | 177 '--abi', self.abi, |
178 '--target', 'android-15', | 178 '--target', 'android-16', |
179 '-c', '64M', | 179 '-c', '64M', |
180 '--force', | 180 '--force', |
181 ] | 181 ] |
182 avd_process = subprocess.Popen(args=avd_command, | 182 avd_process = subprocess.Popen(args=avd_command, |
183 stdin=subprocess.PIPE, | 183 stdin=subprocess.PIPE, |
184 stdout=subprocess.PIPE, | 184 stdout=subprocess.PIPE, |
185 stderr=subprocess.STDOUT) | 185 stderr=subprocess.STDOUT) |
186 avd_process.stdin.write('no\n') | 186 avd_process.stdin.write('no\n') |
187 avd_process.wait() | 187 avd_process.wait() |
188 logging.info('Create AVD command: %s', ' '.join(avd_command)) | 188 logging.info('Create AVD command: %s', ' '.join(avd_command)) |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
310 """Install a handler to kill the emulator when we exit unexpectedly.""" | 310 """Install a handler to kill the emulator when we exit unexpectedly.""" |
311 for sig in self._SIGNALS: | 311 for sig in self._SIGNALS: |
312 signal.signal(sig, self._ShutdownOnSignal) | 312 signal.signal(sig, self._ShutdownOnSignal) |
313 | 313 |
314 def main(argv): | 314 def main(argv): |
315 Emulator(None, True).Launch(True) | 315 Emulator(None, True).Launch(True) |
316 | 316 |
317 | 317 |
318 if __name__ == '__main__': | 318 if __name__ == '__main__': |
319 main(sys.argv) | 319 main(sys.argv) |
OLD | NEW |