android: add working run script

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-01-30 00:00:00 +00:00
parent 64dbf624db
commit 5b39fd2129
4 changed files with 55 additions and 7 deletions

32
run-android Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/env python3
import shutil
import common
class Main(common.LkmcCliFunction):
def __init__(self):
super().__init__(
description='''\
Run android AOSP on the AOSP pre-build emulator.
https://github.com/cirosantilli/linux-kernel-module-cheat#android
''',
)
self.add_argument('extra-emulator-args', default='', nargs='?')
def timed_main(self):
self.sh.run_cmd('''\
{}
emulator -show-kernel -verbose {}
'''.format(
self.env['android_shell_setup'],
self.env['extra_emulator_args']
),
cwd=self.env['android_dir'],
executable=shutil.which('bash'),
shell=True,
)
if __name__ == '__main__':
Main().cli()