PythonのコマンドラインからAVD(Android Virtual Device)を作成したいと思います。そのためには、文字列n
をstdinに渡す必要があります。私は何ができる私は、次のstdinに文字列を渡す
emulator_create = str(subprocess.check_output([android,'create', 'avd', '-n', emulator_name, '-t', target_id, '-b', abi],stdin=PIPE))
emulator_create.communicate("n")
を試してみましたが、それは次のようなエラー
raise CalledProcessError(retcode, cmd, output=output)
subprocess.CalledProcessError: Command '['/home/fahim/Android/Sdk/tools/android', 'create', 'avd', '-n', 'samsung_1', '-t', '5', '-b', 'android-tv/x86']' returned non-zero exit status 1
Process finished with exit code 1
を発生させますか?
エラーをキャッチし、例外の 'output'属性をチェックする必要があります。 –