Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
標準の Android アプリから Android シェル (BusyBox) にコマンドを送信 (および出力を受信) したい。どうすればこれを行うことができますか?1時間のグーグル検索では結果が得られませんでした。
大変助かりました。
よろしく、 スヴァンテ
Process proc = Runtime.getRuntime().exec("ls -la");
これにより、ls -laコマンドが実行され、プロセスが返されます。より複雑なやり取りが必要な場合は、入力ストリームと出力ストリームを使用する必要がありますproc.getInputStream()。proc.getOutputStream()
ls -la
proc.getInputStream()
proc.getOutputStream()