2014-08-13
fb-adb - 改良版adb shell
Facebookが adb shell の改良版を開発しているみたい。
https://github.com/facebook/fb-adb
"adb"とつけてはいるけど、実際には"adb shell" と "adb rcmd" だけを処理して他のサブコマンドはadbにフォワードしているだけ。
改良したところはREADMEによれば以下の点だ。
- Binary clean (no LF -> CRLF mangling)
- transmits and updates window size
- distinguishes standard output and standard error
- properly muxes streams with independent flow control
- allows for ssh-like pty allocation control
- propagates program exit status instead of always exiting with status 0
- properly escapes program arguments
- kills remote program
- provides a generic facility to elevate to root without re-escaping
ざっくり言うと、いろいろまともにしたってことだけど、特に「adb shell $command」のstatus codeを返すようにした」とか「adb shellのstderrをちゃんとstderrとして出すようにした」あたりはかなりうれしくて、adbをwrapするツールを作りやすくなったと思われる。
例:
# exit status $ adb shell false $ echo $? 0 $ fb-adb shell false $ echo $? 1 # stderr $ adb shell 'echo foo >&2' >/dev/null # 何も表示されない $ fb-adb shell 'echo foo >&2' >/dev/null foo
ただいまのところ GenyMotionで動かない という問題があります。実機に対しては動きます。
トラックバック - http://d.hatena.ne.jp/gfx/20140813/1407895228
リンク元
- 28 http://t.co/DyH3yIRzbi
- 8 http://bit.ly/VhCOyV
- 6 http://news.google.com/
- 5 https://www.google.co.jp/
- 4 http://t.co/ibInap0wRf
- 2 http://api.twitter.com/1/statuses/show/499375677632552960.json
- 2 http://feeds.delicious.com/v2/rss/cutmail?count=20
- 2 http://htn.to/2NUNnB
- 2 http://longurl.org
- 2 http://pipes.yahoo.com/pipes/pipe.run?_id=51d2e158dc715868ec8dd32fc3831e46&_render=rss