run-android 743 B

123456789101112131415161718192021222324252627282930
  1. #!/usr/bin/env python3
  2. import shutil
  3. import common
  4. class Main(common.LkmcCliFunction):
  5. def __init__(self):
  6. super().__init__(
  7. description='''\
  8. Run android AOSP on the AOSP pre-build emulator.
  9. https://cirosantilli.com/linux-kernel-module-cheat#android
  10. ''',
  11. )
  12. self.add_argument('extra-emulator-args', default='', nargs='?')
  13. def timed_main(self):
  14. self.sh.run_cmd('{}emulator -show-kernel -verbose {}'.format(
  15. self.env['android_shell_setup'],
  16. self.env['extra_emulator_args']
  17. ),
  18. cwd=self.env['android_dir'],
  19. executable=shutil.which('bash'),
  20. shell=True,
  21. )
  22. if __name__ == '__main__':
  23. Main().cli()