Hi Guys ..it is really disappointing that Samsung doesn't provide linux drivers for Galaxy S2. Kies, the software to connect your android to your PC is available for Windows and Mac, but not for Linux.. And that I am using an Ubuntu makes this specifically a problem related to the Samsung android device, Galaxy S2, and to Ubuntu 11.
Have searched the internet for various howtos.. and here is what I got..
While doing all this the first problem is that you don't get to install Java straight away..
so here is how you do it..
open up a terminal and get the required debs
1 ) find out current jdk version in apt-get
sudo apt-cache search jdk
2 ) Install java JDK and JRE with apt-get
sudo apt-get install sun-java6-jdk sun-java6-jre
And, you are done with Java..
Then install some more packages using
apt..
sudo apt-get install git-core gnupg sun-java5-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev sun-java6-jdk gitg qt3-dev-tools libqt3-mt-dev eclipse valgrind.
NOTE: If we want to build with a x64-bit system we must also do the following
sudo apt-get install git-core gnupg flex bison gperf build-essential zip curl sun-java5-jdk zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline5-dev lib32z-dev sun-java6-jdk gitg qt3-dev-tools libqt3-mt-dev eclipse valgrind pngcrush wput
(don't forget to run update manager again and get your system up to date)
well while we are here we might as well set up our tool for downloading the source
REPO
Repo is a tool that makes it easier to work with Git in the context of Android. So run some commands like..
cd ~
mkdir bin
export PATH=${PATH}:~/bin
curl https://android.git.kernel.org/repo >~/bin/repo
chmod a+x ~/bin/repo
~ means home/user dir, using ~ allows us to simplify our use.
By typing echo $PATH we can see the all of what is in our path.
Now we have repo set up we can set up the android sdk. Goto the sdk's page in our web browser
http://developer.android.com/sdk/index.html
and download the latest linux version, and extract it to your
home/user folder and rename it to androidsdk (to make it easy).
Next let's set up
ECLIPSE. Open up eclipse, just let it save to the workspaces folder that it defaults to and open up the help tab up on the top bar and go down to install new software and add this line into the open text bar and type this
http://dl-ssl.google.com/android/eclipse/
now click add and in the box down below you will see it says developer tools. Click on the little check box and hit next. You should see android development tools hit next and follow the prompts and wait for it to download and install.
In case an error prompts like :
Cannot complete the install because one or more required items could not be found.
Software being installed: Android Development Tools 12.0.0.v201106281929-138431 (com.android.ide.eclipse.adt.feature.group 12.0.0.v201106281929-138431)
Missing requirement: Android Development Tools 12.0.0.v201106281929-138431 (com.android.ide.eclipse.adt.feature.group 12.0.0.v201106281929-138431) requires 'org.eclipse.gef 0.0.0' but it could not be found.
You need to add the following URLs to the "Available Software Sites" of your eclipse installation:
http://download.eclipse.org/releases/indigo
http://download.eclipse.org/eclipse/updates/3.7
That should fix it. Otherwise, add links as shown in this pic..
You will have to agree to the terms to download, You will get a warning about unsigned content, just say yes. Once it is done click to restart Eclipse then go up to the window tab and go down to preferences, in the new window that pops up, go to android and add in where your android sdk is. Just hit ok and not apply or it will complain.
Close out of that window then go down to in the window tab again and go into android sdk and avd manager. Go down to available packages and click on the little check boxes again. Download all available packages. Let that download and exit out.
Go to your home folder. Press "Ctrl+H" on your keyboard to show hidden folders. Anything marked with a "." in front of it is hidden, we are looking for a folder name
.gnome2. Go into it and look for
nautilus-scripts. Once inside this folder, right click on a empty space and select "Create document" and then empty file and name it "sign". Open up that empty document and copy and paste this script from dumbfaq on xda.
#!/bin/bash
# Update the Loc var to where YOU stored the testsign.jar file !
SUCCESS=
Loc=~/androidsdk/tools/
for arg
do
TMP=$(ls $arg | sed 's/\(.*\)\..*/\1/')
EXT=${arg##*.}
java -classpath "$Loc"testsign.jar testsign "$arg" "$arg"-signed 2> /tmp/signTmp
SUCCESS=$?
if [ $SUCCESS -eq 1 ]
then
zenity --info --title "Sign APK" --text "signing FAILED! \n`cat /tmp/signTmp`"
exit 1
fi
mv $TMP.$EXT-signed $TMP-signed.$EXT
done
zenity --info --title "Sign APK" --text "signing completed!"
save and exit out. Right click on our new script and select properties. Select thru the tabs and look for a check box that says allow executing as a program. Click on it and now we have a pretty little script that we can just right click on a update.zip file and sign with our test keys for flashing. But, first we need to download the testsign java file and add it to our androidsdk/tools folder. Download it here.
http://rapidshare.com/files/257189327/testsign.jar
But, do not extract it yet, just add it to the tools folder.
Last but not least, we need to set up
adb.
adb is actually a short form of
Android Debug Bridge which is an integral part of the standard Android SDK and provides the terminal interface access so that you can easily interact with your phone’s file system. So, open up a terminal (you might still have the previous one open, you can use that just make sure you are at ~/) and type
gedit .bashrc
paste the following in it the top
#AndroidDev PATH
export PATH=${PATH}:~/androidsdk/tools
export PATH=${PATH}:~/androidsdk/platform-tools
save and exit.
Now we need to check what is our phone's vendor id, this is helpfull to see if our phone is on the list, with all the growing numbers of new manufacturs producing android it is hard know every vendor's id so type.
lsusb
(it is LSUSB not ISUSB).
while your phone is connected to see our vendor id and you will see something like this, if you have a device not listed please send the vendor id at sykopompos@gmail.com so that he can update it in for others (this is his tutorial from
here)
:Bus 002 Device 008: ID 04e8:6860 Samsung Electronics Co., Ltd
OR
:Bus 002 Device 004: ID 0bb4:0c91 High Tech Computer Corp.
check out the screenshot..
In most cases as seen below we only need the vendor id and with a new device you can just copy and paste the line and replace the vendor id. So now we can make our rules file for connecting for adb.
sudo gedit /etc/udev/rules.d/51-android.rules
paste
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM==”usb”, ATTRS{idVendor}==”18d1″, SYMLINK+=”android_adb”, MODE=”0666″
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
save and exit.
Reboot your computer to have the new changes take effect otherwise adb will not be in your $PATH
let's check to make sure our device is seen by adb by typing
adb devices
It should give you info back that you are connected if you are not or it doesn't read the vendor id than it might be a little bit more complicated.
NOTE: adb will not read if you have usb mass storage mounted, also you would need usb debugging ON in settings/apllications/development on your phone.
Now we have a complete android development environment, aren't you proud of yourself. You are well on your way to making your own custom rom. it is a wise idea to have a backup of a system dump for stock apps and to get a feel for the way android is set up and also to pull any needed files from that are easily viewed on your computer at least as refefence connect your phone in adb in the terminal type:
cd ~/
mkdir stock
adb pull /system/ ~/stock/
this will make a system dump of your systems folder of your device (see the pic below), a wise idea would be to make a zipped versions of it and put it someplace secure.
You can also check out the
full list of adb commands so that you can configure and check the same.
ORIGINALLY FROM:
Build yourself guide:
http://forum.xda-developers.com/show...8#post10635918
and
http://stackoverflow.com/questions/7082158/required-items-could-not-be-found-error-when-installing-adt-plugin.