<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Novoda &#187; busybox</title>
	<atom:link href="http://novoda.com/tag/busybox/feed/" rel="self" type="application/rss+xml" />
	<link>http://novoda.com</link>
	<description>Android mobile development and consultancy</description>
	<lastBuildDate>Fri, 13 Aug 2010 11:02:07 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Extending Android&#8217;s shell with BusyBox</title>
		<link>http://novoda.com/2008/11/12/extending-androids-shell-with-busybox/</link>
		<comments>http://novoda.com/2008/11/12/extending-androids-shell-with-busybox/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 01:40:25 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Blog]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Tools]]></category>
		<category><![CDATA[busybox]]></category>
		<category><![CDATA[shell]]></category>

		<guid isPermaLink="false">http://www.novoda.com/blog/?p=3</guid>
		<description><![CDATA[A vanilla android installation is a bare bones affair aimed solely at the mobile device. This comes at the initial expense of our development environment. This platform is only intended for only the smallest devices and so searching amoungst 'system/bin' reveals only a cherry picking of Linux system administrator staples, even the most common binaries such as 'ls', 'mv' and 'rm' have been stripped of all but their essential options and recompiled. Installing third party tools on Android offers a range of additional productive tools and options for ease of development within the Android shell.]]></description>
			<content:encoded><![CDATA[<p>A vanilla android installation is a bare bones affair aimed solely at the mobile device. This comes at the initial expense of our development environment. This platform is only intended for only the smallest devices and so searching amongst &#8216;<em>system/bin</em>&#8216; reveals only a cherry picking of Linux system administrator staples, even the most common binaries such as &#8216;<em>ls</em>&#8216;, &#8216;<em>mv</em>&#8216; and &#8216;<em>rm</em>&#8216; have been stripped of all but their essential options and recompiled. Installing third party tools on Android offers a range of additional productive tools and options for ease of development within the Android shell.</p>
<h2>Android shell</h2>
<p>Invoking the android emulator from within an IDE is the ideal setup but developers will find need to interact with the emulator through other means for scripting, integration testing and just practical reasons. The SDK tools are located in the tools directory and I&#8217;d recommend regular users of the sdk to add this directory to their shell&#8217;s export path.</p>
<p>I develop on a mac so I have added the <em>android-sdk-mac_x86-1.0_r1/tools</em> to my <em>.profile</em> but you could equally add it to your <em>.bashrc</em> or <em>.kornrc</em> within your user&#8217;s home area giving you convenient direct access to all of android&#8217;s development tools via the binary names such as $adb, $emulator or $ddms. If you are on a windows machine these variables would instead be set via your system settings -&gt; environment variables.</p>
<p>With the tools on the shells $PATH, the emulator can now be invoked:</p>
<pre class="sh_sh">
$emulator
</pre>
<p>Now to telnet to the running device image:</p>
<pre class="sh_sh">
$adb shell
</pre>
<h2>BusyBox</h2>
<p><a href="http://www.busybox.net/">BusyBox</a> is a single multicall binary that packages the functionality of many popular standard Unix tools. The aim of the BusyBox project is to keep the total package size overhead as small as possible by sharing  commonly used gnu libC libraries via a single set of ELF headers and stripping down gnu&#8217;s libc so as only to provide the functions necessary to support Busybox and the other executables.</p>
<h3>Side note &#8211; Standing up for GNU with legal action</h3>
<p>Busybox author&#8217;s have gained a reputation for their commendable efforts to uphold the <a href="http://www.oss-watch.ac.uk/resources/gpl.xml">legal rights of the GNU public license</a> as they have brought about court action as plaintiffs on a series of cases where they believed companies were not holding to the terms of GNU public license. Companies they have appealed against include Verizon, High-Gain Antennas and Xterasys. Most notably they are commonly credited with the first GNU public licence related court action <a href="http://www.softwarefreedom.org/news/2007/sep/20/busybox/">against Monsoon Multimedia</a> for their use of BusyBox within it&#8217;s <a href="http://www.myhava.com/index.html">HAVA</a> streaming video software (Hava have since made their alterations available). So far all cases have been settled before they reached the court.</p>
<h2>Installing busy box <span>on Android</span></h2>
<p>It is common place for developers to check out the source of BusyBox and compile a tailor made build with any preferred tools and options. There are others like myself who just use whatever they can find and I have settled with a build generously donated with the intent of android deployment by Ben Leslie available from both <a href="http://benno.id.au/blog/2007/11/14/android-busybox">his site</a> and the <a>run buddy code wiki</a>.</p>
<p>First aquire your build and then add it to the running android device like so:</p>
<pre class="sh_sh">
$adb shell mkdir /data/busybox
$adb push busybox /data/busybox
$adb shell
</pre>
<p>Now within the android Emulator shell:</p>
<pre class="sh_sh">
$cd /data/busybox
$chmod 775 busybox
$./busybox –install
</pre>
<p>Now you have installed BusyBox!</p>
<p>For ease of use I would add this to the shell&#8217;s $PATH</p>
<pre class="sh_sh">
export PATH=/data/busybox:$PATH
</pre>
<p>Now invoking busybox will reveal all your new commands!</p>
<pre class="sh_sh">
$busybox
</pre>
<p>Some highlights of this particular binary of BusyBox are:<br />
<strong>chown, chgrp</strong>: change permission ownership.<br />
<strong>awk, sed</strong>: languages to both process &amp; transform text<br />
<strong>grep</strong>: a text search utility<br />
<strong>du</strong>: shows disk usage<br />
<strong>vi</strong>: a shell based text editor<br />
<strong>pidof</strong>: return the pid of a running process<br />
<strong>less</strong>: text reader with back and forward nav<br />
<strong>tail</strong>: trail the end of a file for activity<br />
<strong>gunzip, gzip, tar, bzip2</strong>: archival compression software<br />
<strong>clear</strong>: clear screen<br />
<strong>crontab, crond</strong>: task scheduling<br />
<strong>diff</strong>: compare files<br />
<strong>httpd</strong>: a light webserver<br />
<strong>telnet</strong>: basic TCP remote login<br />
<strong>xargs</strong>: use the output of a command as the arguments for another<br />
<strong>su</strong>: masquerade as another system user<br />
<strong>wget</strong>: retrieves content from a web server<br />
<strong>which</strong>: identifies the location of an executable<br />
For info on these or any linux commands check the <a href="http://man.he.net/">man pages online</a>.</p>
<p>Have I missed any of your shell essentials? If you have any BusyBox builds for Android then we&#8217;d love to hear about how you are using them in your development environment.</p>
<blockquote><p>Android SDK at time of writing was: <strong>android-sdk-mac_x86-1.0_r1</strong></p></blockquote>
<h3>Citations &amp; Research</h3>
<ul>
<li><cite><a href="http://www.busybox.net/">http://www.busybox.net/</a></cite></li>
<li><cite><a href="http://www.busybox.net/downloads/BusyBox.html">Official Busy box documentaion</a></cite></li>
<li><cite><a href="http://www.busybox.net/cgi-bin/viewcvs.cgi/trunk/busybox/">Busy box Source code repository</a></cite></li>
<li><cite>I sourced the build of BusyBox from <a href="http://benno.id.au/blog/2007/11/14/android-busybox">Ben Leslie&#8217;s site</a> &#8211; Thanks!</cite></li>
<li><cite><a href="http://www.ibm.com/developerworks/library/l-busybox/">BusyBox article on dev works by M. Tim Jones</a></cite></li>
<li><cite><a href="http://www.linuxdevices.com/files/article018/00load.html">An Animated guide to BusyBox</a></cite></li>
<li><cite><a href="http://blogs.zdnet.com/open-source/?p=1837">Busybox takes another step up GPL protection ladder</a><cite></cite></cite></li>
<li><cite><a href="http://news.cnet.com/8301-13505_3-9831376-16.html?tag=mncol;title">GPL lawsuits: A reason to rejoice(?), not panic</a><cite></cite></cite></li>
<li><cite><a href="http://blogs.zdnet.com/open-source/?p=2511">Do the Busybox cases change anything?</a><cite></cite></cite></li>
</ul>
<script type="text/javascript" src="/wp-content/plugins/shjs-syntax-hiliter/shjs/lang/sh_sh.js"></script><script type="text/javascript" src="/wp-content/plugins/shjs-syntax-hiliter/shjs/lang/sh_sh.js"></script><script type="text/javascript" src="/wp-content/plugins/shjs-syntax-hiliter/shjs/lang/sh_sh.js"></script><script type="text/javascript" src="/wp-content/plugins/shjs-syntax-hiliter/shjs/lang/sh_sh.js"></script><script type="text/javascript" src="/wp-content/plugins/shjs-syntax-hiliter/shjs/lang/sh_sh.js"></script><script type="text/javascript" src="/wp-content/plugins/shjs-syntax-hiliter/shjs/lang/sh_sh.js"></script>


Share this post:


	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fnovoda.com%2F2008%2F11%2F12%2Fextending-androids-shell-with-busybox%2F&amp;partner=sociable" title="Print"><img src="http://novoda.com/wp-content/plugins/sociable/images/printfriendly.png" title="Print" alt="Print" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="mailto:?subject=Extending%20Android%27s%20shell%20with%20BusyBox&amp;body=http%3A%2F%2Fnovoda.com%2F2008%2F11%2F12%2Fextending-androids-shell-with-busybox%2F" title="email"><img src="http://novoda.com/wp-content/plugins/sociable/images/email_link.png" title="email" alt="email" class="sociable-hovers" /></a>
	<img src="http://novoda.com/wp-content/plugins/sociable/images/digg.png" title="Digg" alt="Digg" class="sociable-hovers" /></a>
	<img src="http://novoda.com/wp-content/plugins/sociable/images/delicious.png" title="del.icio.us" alt="del.icio.us" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://reddit.com/submit?url=http%3A%2F%2Fnovoda.com%2F2008%2F11%2F12%2Fextending-androids-shell-with-busybox%2F&amp;title=Extending%20Android%27s%20shell%20with%20BusyBox" title="Reddit"><img src="http://novoda.com/wp-content/plugins/sociable/images/reddit.png" title="Reddit" alt="Reddit" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://twitter.com/home?status=Extending%20Android%27s%20shell%20with%20BusyBox%20-%20http%3A%2F%2Fnovoda.com%2F2008%2F11%2F12%2Fextending-androids-shell-with-busybox%2F" title="Twitter"><img src="http://novoda.com/wp-content/plugins/sociable/images/twitter.png" title="Twitter" alt="Twitter" class="sociable-hovers" /></a>
	<img src="http://novoda.com/wp-content/plugins/sociable/images/googlebookmark.png" title="Google Bookmarks" alt="Google Bookmarks" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.facebook.com/share.php?u=http%3A%2F%2Fnovoda.com%2F2008%2F11%2F12%2Fextending-androids-shell-with-busybox%2F&amp;t=Extending%20Android%27s%20shell%20with%20BusyBox" title="Facebook"><img src="http://novoda.com/wp-content/plugins/sociable/images/facebook.png" title="Facebook" alt="Facebook" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://news.ycombinator.com/submitlink?u=http%3A%2F%2Fnovoda.com%2F2008%2F11%2F12%2Fextending-androids-shell-with-busybox%2F&amp;t=Extending%20Android%27s%20shell%20with%20BusyBox" title="HackerNews"><img src="http://novoda.com/wp-content/plugins/sociable/images/hackernews.png" title="HackerNews" alt="HackerNews" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://technorati.com/faves?add=http%3A%2F%2Fnovoda.com%2F2008%2F11%2F12%2Fextending-androids-shell-with-busybox%2F" title="Technorati"><img src="http://novoda.com/wp-content/plugins/sociable/images/technorati.png" title="Technorati" alt="Technorati" class="sociable-hovers" /></a>
	<a rel="nofollow"  href="http://www.printfriendly.com/print?url=http%3A%2F%2Fnovoda.com%2F2008%2F11%2F12%2Fextending-androids-shell-with-busybox%2F&amp;partner=sociable" title="PDF"><img src="http://novoda.com/wp-content/plugins/sociable/images/pdf.png" title="PDF" alt="PDF" class="sociable-hovers" /></a>


<br/><br/>]]></content:encoded>
			<wfw:commentRss>http://novoda.com/2008/11/12/extending-androids-shell-with-busybox/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
