<?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>ostebaronen.dk &#187; Bash</title>
	<atom:link href="http://ostebaronen.dk/tag/bash/feed/" rel="self" type="application/rss+xml" />
	<link>http://ostebaronen.dk</link>
	<description>write letters and shit, yo!</description>
	<lastBuildDate>Wed, 07 Jul 2010 00:43:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=abc</generator>
		<item>
		<title>Install batches of apps through adb</title>
		<link>http://ostebaronen.dk/install-batches-of-apps-through-adb/</link>
		<comments>http://ostebaronen.dk/install-batches-of-apps-through-adb/#comments</comments>
		<pubDate>Sun, 08 Nov 2009 13:19:39 +0000</pubDate>
		<dc:creator>ostebaronen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[adb]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Cellphone]]></category>
		<category><![CDATA[Language]]></category>
		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://ostebaronen.dk/?p=291</guid>
		<description><![CDATA[I made a small script just to test the syntax highlighting plug-in I installed for WordPress. So here it goes: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 #!/bin/bash # Scipt that installs a batch of apk files on an Android device, # through the adb tool from Android [...]]]></description>
			<content:encoded><![CDATA[<p>I made a small script just to test the syntax highlighting plug-in I installed for WordPress. So here it goes:<br />
<span class="notranslate"></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># Scipt that installs a batch of apk files on an Android device,</span>
<span style="color: #666666; font-style: italic;"># through the adb tool from Android SDK.</span>
<span style="color: #007800;">adbPath</span>=<span style="color: #ff0000;">&quot;/home/tomasz/android/android-sdk/tools/adb&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;usage: <span style="color: #780078;">`basename $0`</span> foldername&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">for</span> f <span style="color: #000000; font-weight: bold;">in</span> $<span style="color: #7a0874; font-weight: bold;">&#40;</span> <span style="color: #c20cb9; font-weight: bold;">ls</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#41;</span>;
<span style="color: #000000; font-weight: bold;">do</span>
        <span style="color: #007800;">$adbPath</span> <span style="color: #c20cb9; font-weight: bold;">install</span> <span style="color: #ff0000;">&quot;<span style="color: #007800;">$f</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">done</span></pre></td></tr></table></div>

<p></span><br />
The script is very simple and installs apk files in a folder through adb (Android Debug Bridge). This of course requires the Android SDK and a some kind of a Linux distribution.</p>
]]></content:encoded>
			<wfw:commentRss>http://ostebaronen.dk/install-batches-of-apps-through-adb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bash script for pushing files and folders through adb</title>
		<link>http://ostebaronen.dk/bash-script-for-pushing-files-and-folders-through-adb/</link>
		<comments>http://ostebaronen.dk/bash-script-for-pushing-files-and-folders-through-adb/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 14:52:35 +0000</pubDate>
		<dc:creator>ostebaronen</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Android]]></category>
		<category><![CDATA[Bash]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Scripts]]></category>

		<guid isPermaLink="false">http://ostebaronen.dk/?p=277</guid>
		<description><![CDATA[I have made a script for pushing files and folders through adb to the SDcard of an Android device. This can be used in combination with nautilus for right-clicking on folders to push it. 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 [...]]]></description>
			<content:encoded><![CDATA[<p>I have made a script for pushing files and folders through adb to the SDcard of an Android device. This can be used in combination with nautilus for right-clicking on folders to push it.<br />
<span class="notranslate"></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre></td><td class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># Script for pushing files and folders through adb.</span>
<span style="color: #666666; font-style: italic;"># Can also be used without nautilus.</span>
<span style="color: #666666; font-style: italic;"># Feel free to edit and distribute as much as you want.</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># if you want dialogs set dialog_enable=1 else dialog_enable=0</span>
<span style="color: #007800;">dialog_enable</span>=<span style="color: #000000;">1</span>
&nbsp;
<span style="color: #666666; font-style: italic;"># Write the entire path to adb here</span>
<span style="color: #007800;">adbPath</span>=<span style="color: #ff0000;">&quot;/home/tomasz/AndroidSDK/tools/adb&quot;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> dialogs <span style="color: #7a0874; font-weight: bold;">&#123;</span>
        <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$dialog_enable</span> = <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                <span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;/usr/bin/gdialog&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                        gdialog <span style="color: #660033;">--title</span> <span style="color: #ff0000;">&quot;adb push&quot;</span> <span style="color: #660033;">--msgbox</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000;">200</span> <span style="color: #000000;">200</span>
                <span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;/usr/bin/Xdialog&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
                        Xdialog <span style="color: #660033;">--title</span> <span style="color: #ff0000;">&quot;adb push&quot;</span> <span style="color: #660033;">--msgbox</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000;">0</span> <span style="color: #000000;">0</span>
                <span style="color: #000000; font-weight: bold;">else</span>
                        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;No dialog program present&quot;</span>
                <span style="color: #000000; font-weight: bold;">fi</span>
        <span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">1</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>    <span style="color: #666666; font-style: italic;"># If arguments not equal 1, complain!</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage - $0 file&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;or - $0 directory&quot;</span>
        <span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-d</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">$adbPath</span> shell <span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #ff0000;">&quot;/sdcard/<span style="color: #780078;">`basename &quot;$1&quot;`</span>&quot;</span>  <span style="color: #666666; font-style: italic;"># Create the directory on SDcard</span>
        <span style="color: #007800;">$adbPath</span> push <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #ff0000;">&quot;/sdcard/<span style="color: #780078;">`basename &quot;$1&quot;`</span>&quot;</span>    <span style="color: #666666; font-style: italic;"># Push files in the folder to folder on SDcard</span>
        dialogs <span style="color: #ff0000;">&quot;Folder $1 was pushed&quot;</span>
<span style="color: #000000; font-weight: bold;">elif</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
        <span style="color: #007800;">$adbPath</span> push <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>sdcard<span style="color: #000000; font-weight: bold;">/</span>    <span style="color: #666666; font-style: italic;"># Push single file to SDcard</span>
        dialogs <span style="color: #ff0000;">&quot;$1 was pushed&quot;</span>
<span style="color: #000000; font-weight: bold;">else</span>
        <span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Gurumeditation!&quot;</span>    <span style="color: #666666; font-style: italic;"># Oops!</span>
<span style="color: #000000; font-weight: bold;">fi</span></pre></td></tr></table></div>

<p></span><br />
Download the script by using this link: <a href="../android/adbpush.sh">http://ostebaronen.dk/android/adbpush.sh</a></p>
<p>In order to have it in your right-click menu in Nautilus place the script in: <em>~/.gnome2/nautilus-scripts/</em> and run <em>chmod u+x ~/.gnome2/nautilus-scripts/</em>. Now you should see the script in your right click menu under scripts in Nautilus.</p>
]]></content:encoded>
			<wfw:commentRss>http://ostebaronen.dk/bash-script-for-pushing-files-and-folders-through-adb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
