[Galaxy S 4 i9505 Original Android Development] sa1tine:
[MENTION=1507965]adry1988[/MENTION] the process is pretty simple but takes some time and patience.

Initial Setup​

Requirements:

A USB stick with at least 8 gigs on it

Lili Linux Live USB Creator [Link]

Linux Mint 13 64-bit [Mirror for Cinnamon] [Torrent]

Time and Patience

And remember, linux is very case sensitive.

To start, download LinuxLive USB Creator and then download the Linux Mint 13 .iso file.

Once both are downloaded install lili, when the program loads up plug in your usb stick. Follow the onscreen steps. Select the USB drive you want to use. Then click on ISO/IMG/ZIP. Navigate to where you downloaded the .iso and select it. Personally, I skip step 3, I don't stay in it long enough to require that much space. Step 4 you have additional options to hide the files lili creates, format the usb, and enable live launching in windows. Since you will be using a clean hdd you can just uncheck it. The the final step is pressing the lightning button to create the Live USB.

Once that is complete swap hdds and reinsert the usb if you removed it before turning your computer on. When you start your computer up you want to press the key that corresponds with taking you to your boot menu. You want to select boot from USB. After that, you will be prompted with a selection to either try out mint or install it. I prefer to install it, because I can go in and setup my install environment the way I want it. I am type A about how I configure things so do as you prefer.

If you logged in to try linux mint you want to click on Menu on the bottom left of the screen and in the search box type in gparted. Click on it. Once gparted loads up click on the available partition(s) and delete it. Then click on Apply all operations. At this point, if linux mint is not picking up your wifi or you are not on a wired connection you want to tether your phone. Once that is done, on the home screen you should see an icon that says something like "Install This" double click it. The main choices you have to make at this point is whether or not you want to use a swap. Personally I don't care for making a swap partition, so I click on "Do something else." and press next. If you choose to go that route all you have to do is, in the next menu click on the unallocated partition and click on Add, make an ext4 filesystem and the mount point to be "/" without quotes, it is in a drop down box. After that click next and it automates itself. Or you can just tell it to install linux mint and it will create the partition and swap partition for you.

After linux mint is installed you will of course not need the USB anymore. Log into mint you will need to some quick house cleaning.

Click on Menu in the search box type sources then click on software sources. One of the software repositories that mint uses is no longer alive so you want to remove it. it is medibuntu. just click on that source and press remove. exit out of software sources. Now we need to get your wifi going if you are not on a wired connection. If your wifi is not available in the network connections button which is the 3rd icon on the bottom right of your screen you will have to do a little work in terminal.

Retether your phone and open terminal up, which is the icon on the bottom left of your screen that looks like >_

Once in terminal you will want to type:

you should see your wireless connection and can untether your phone.

Now that you have internet access you want to continue setting up the build environment. this will even help you get some terminal knowledge under your belt :o

Setting up Java and Build Dependencies​

First Download this: [DevDistro]

I updated some code stuff from broods to update the java jdk.

Extract jdk-6u45-linux-x64.bin into Downloads and open up a terminal window. In terminal you want to type or copy and paste:

Now for some more fun! we are getting close to being finished.

in terminal type in: cd

so you get back to your home directory. then copy and paste this:

confirm with a y and press enter. There are some added packages in there from broods original that i use because i build for the t989 as well, but, if a little is good, sometimes more is better.

while that is downloading you can download the android SDK and eclipse [Here]

When those are done you want to open up the file manager which is the grey looking icon on the bottom left corner system tray. click on Downloads and open up the adt zip. Drag and drop both the sdk and eclipse folders into your home folder. To keep this folder from being cluttered right click on the sdk folder and rename it .android-sdk do the same for eclipse, rename it to .android-eclipse

more to do with those in a second.

while you are in your home folder you can create an OUT folder for your build. for mine i just name it android

now you want to setup ccache Download the tarball [Here]

extract the tar file into the Downloads folder

now in terminal you want to type in:

and just like that ccache is installed.

Getting Google Source​

in terminal copy and paste:

mkdir ~/.bin && curl http://commondatastorage.googleapis.com/git-repo-downloads/repo > ~/.bin/repo && chmod a+x ~/.bin/repo

after that is complete you want to type in:

gedit ~/.bashrc

a text document should open up and paste this in and replace YOURUSERNAME with the username that you created when you installed linux.

save the document. in the same terminal window you want to type in:

from this point on, if you want to go into the android sdk you can simply type in android. or if you need to use adb shell you can just type in adb shell, anywhere.

now to download broods hard work, type in:

mkdir aosp && cd aosp

repo init -u git://github.com/AOSP-S4/aosp_manifest -b jb-4.3

repo sync

the download takes between 40 minutes to 2 hours depending on download speed. if you have a fast internet connection you can add -j7 to repo sync and it will go faster.

to build the source go into terminal and type in:

i hope that helps anyone. :)