[GUIDE] How to set up a basic Android Dev Environment
Since I have gotten several requests to show people how to set up a dev environment, I thought I would write up a how to guide and just post it in a thread.I have had to set up a new dev environment a few times now, and each time I've had to look the information up piece by piece. All of the guides that I have found are out of date or don't work for what I want to accomplish, which is build a basic environment that I can decompress nandroid backup images in, build kernels, compile images, and just be ready for anything that is thrown my way that needs a Linux based setup to look at or test.
And just because I probably need to put this in here,
********I AM NOT RESPONSIBLE FOR ANY HARM THAT MAY COME TO YOUR COMPUTER, PHONE, OR ANYTHING ELSE THAT YOU MAY USE WHILE READING OR TRYING TO IMPLEMENT ANY OR ALL PARTS OF THIS GUIDE.*********
Guide Tips:
Read everything first. Then go to the websites listed and read it again. This will give you somewhat of an understanding of what you are going to be doing. This is what I use and it works for what I do. I do not use Eclipse, therefore I did not include it in this guide. While reading this guide, Linux and Ubuntu are one in the same so don’t get confused by terminology. Ubuntu is just a flavor of Linux. You may prefer a different flavor and that is fine. While working in Terminal, if I put something in italics, don’t type that part. Italics are meant as an extra bit of info. If the text went to a new line and there is a space before the next line starts, hit enter. If the text went to a new line and there is no space, it’s the same line of code.
Downloads:
Download Ubuntu 10.10 32-bit desktop edition from:
http://www.ubuntu.com/desktop/get-ubuntu/download
Download and install VirtualBox from:
http://www.virtualbox.org/wiki/Downloads
Install Ubuntu 10.10 on the VirtualBox like this:
http://www.psychocats.net/ubuntu/virtualbox
VirtualBox Tips:
Use a 50GB (or bigger) Hard Drive size if you can afford the space.
Pick an easy password and log on automatically. This will make things easier later.
When you get set up, go to System, Settings, Screensaver, and uncheck Activate screensaver when computer is idle, and Lock screen when screensaver is active. It is not necessary on a VirtualBox anyway and will just become an annoyance.
I recommend downloading and installing the VirtualBox Guest Additions for Linux by clicking Devices, Install Guest Additions. This will make things easier if you need to resize your Linux desktop window, or cut and paste text from Windows to Linux.
If you need to move files easily from Windows to Linux, put them on a USB drive in Windows. Then in on the VirtualBox, click Devices, select USB Devices, find the USB drive that you are using and select it. The drive will then be accessible in Linux. To move something back to Windows, just uncheck the drive in the same manner. There is a common share folder you can set up, but I find it more of a hassle than just using a USB drive.
Inside Ubuntu:
Download and save the Android SDK for linux from:
http://developer.android.com/sdk/index.html
Download and save unyaffs from:
http://code.google.com/p/unyaffs/downloads/list
Go to Applications, Accessories, and Select Terminal
In Terminal type:
Go to Applications, Accessories, and Select Terminal
In Terminal type:
sudo passwd
(it will ask you for a new password, just enter the password you used in setup)
(retype the same password)
mkdir ~/android
cd Downloads
sudo mv unyaffs /bin
tar –zxvf android-sdk_r08-linux_86.tgz
mv android-sdk-linux_86 ~/android
sudo add-apt-repository "deb
http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install sun-java6-jdk
sudo apt-get install git-core gnupg flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev
mkdir ~/bin
curl
http://android.git.kernel.org/repo > ~/bin/repo
chmod a+x ~/bin/repo
cd ~/bin
sudo mv repo /bin
cd /bin
chmod 777 unyaffs
cd ~/android/android-sdk-linux_86/tools
. android
(notice the period and space before “android”, this is a "run" command, the Android SDK and AVD Manager will open)
Select as many or as few packages from the available packages as you want. You need to have Android SDK Tools, revision 8, which should already be installed, and Android SDK Platform-tools, revision 1 at a minimum. Press Install Selected when you are ready. When finished, close the Manager.
Closing Notes:
At this point you will have the tools to decompress a nandroid backup image and work with those files to create a basic ROM, download repos, download source code from github, and be able to do other things that are used to develop for Android phones. This is by no means all inclusive. It is just a basic setup to get you ready to do some of the things possible. If people find this useful, I may write other guides to explain how to do other things, so give me feedback.
Come see us on irc #samsung-mesmerize if you have a question or just want to hang out.
The easy way-->
http://webchat.freenode.net
Check me out on Twitter
@phidelt82 or
Google+
Currently running:
HTC Thunderbolt
BAMF Stripped v1.8
Retired:
Mesmerize - Still building for it, don't worry.
EE19 build
PnP v1
NoClock mod