Android ADB Shell-Ash或Ksh? [英] Android adb shell - ash or ksh?

查看:131
本文介绍了Android ADB Shell-Ash或Ksh?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android在线文档 Android调试桥说,"Adb提供了灰壳".果然,如果我adb shell使用AVD模拟器,我会得到灰烬,它基本上是缩减的Bourne外壳.

The Android online documentation Android Debug Bridge says "Adb provides an ash shell". Sure enough, if I adb shell to an AVD emulator I get ash which is basically a cut-down Bourne shell.

但是,如果我连接到几个远程设备,一个是HTC电话,另一个是ASUS Transformer Prime平板电脑,则它们都具有Korn外壳的版本,该外壳提供:KSH_VERSION='@(#)MIRBSD KSH R39 2010/08/24'.尽管MIRBSD KSH不是成熟的AT& T Korn外壳,但它仍然比灰烬功能强大得多.

However, if I connect to a couple of remote devices, one an HTC telephone and the other an ASUS Transformer Prime tablet, they both have a version of the Korn shell, which gives: KSH_VERSION='@(#)MIRBSD KSH R39 2010/08/24'. Although MIRBSD KSH is not a full-blown AT&T Korn shell, it is still a lot more powerful than ash.

模拟器正在运行Jelly Bean,并且两个设备都使用ICS.进行更多的挖掘,看起来像是姜饼中的灰烬,而蜂窝中的mirbsd ksh.

The emulator is running Jelly Bean, and both devices are using ICS. Doing a bit more digging, it looks like ash was in Gingerbread but mirbsd ksh in Honeycomb.

那么,有人可以确认Android在线文档有误,并且模拟器运行的是过时的Shell吗?还是供应商正在实施自己的计划?

So, can someone confirm that the Android online documentation is wrong, and that the emulator is running an out-of-date shell? Or is it that suppliers are implementing their own?

推荐答案

我是mksh(The MirBSD Korn Shell)的作者,在进行了mksh的实验性构建后,大约在1.6倍的时间内将其提交到Android中适用于Android 1.5.

I’m the author of mksh (The MirBSD Korn Shell) and have submitted it for inclusion into Android at roughly the 1.6 time after having had experimental builds of mksh for Android 1.5 already.

尽管Android-x86很早就使用了它,但花了相当长的时间才接受它.最初,我们有一个可配置的开关,板配置将决定使用ash还是mksh. Google同意只能在设备上运送一个.在准备2.4的时候(从未发布),硬件板配置使用mksh,而仿真器配置使用ash,以确保在需要或需要返回到mksh时不引入特定于mksh的特性.灰. 2.4从未发布,我也不知道3.0系列使用了什么,但是由于Android 4.0 mksh是其标准系统外壳.

It took quite a while for this to be accepted, although Android-x86 used it very early. At first we had a configurable switch where the board config would determine whether ash or mksh were used; Google agreed that only one should be shipped on a device. Around the time when 2.4 was prepared (which was never released), the hardware board configs used mksh, whereas the emulator config used ash, in order to make sure to not introduce mksh-specifics in case they should want or need to go back to ash. 2.4 never got released, and I don’t know what was used on the 3.0 series, but since Android 4.0 mksh is its standard system shell.

mksh甚至得到了Geremy Condra的安全审查,我们(包括我和AOSP/Google员工)都定期向代码推送更新.有趣的事实:他们最初并不打算在手机上全部装运外壳,而是同意装运mksh,因为那时他们已经装运了带有外壳的设备,因此它成为了手机的一部分.已发布的API.像mksh和ash一样,Android开发人员的#1功能是制表符补全.

mksh even got a security review by Geremy Condra, and we (both the AOSP/Google people as well as me) regularily push updates to the code. Fun fact: they didn’t intend to ship a shell on the phones initially at all but agreed to ship mksh because they already had shipped devices with a shell on them by then, so it became part of the published API. The #1 feature Android developers like in mksh, over ash, is tab completion.

现在看在线文档,似乎他们删除了ash参考.现在,他们只是不清楚可以使用哪个外壳. (他们确实同意链接到在线文档中的mksh主页(我为此提交了一个补丁),以便用户可以进行RTFM并提供错误报告和其他反馈.)

Looking at the online docs now, it seems that they removed the ash reference. They’re now just not explicit on which shell is available. (They did agree to link to the mksh homepage in the online docs – I submitted a patch for that – so that users can RTFM and provide bug reports and other feedback.)

这篇关于Android ADB Shell-Ash或Ksh?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆