How to set up Android SDK in Linux - Nexus 7 General

*If you find this Guide Thread helpful, feel free to hit the "thanks" button below!
I'm doing this guide because when I switched to arch linux ,I found no guides to setup sdk in it.Arch is a beautiful OS, but for newcomers like me ,I took some time to get used to it.So,In this guide, we’ll take a look at how to set up a development environment for Android in Arch linux(or Arch based Linux Distros) so you can start working on your Projects.Most of the Arch Linux are pro linux users so there is really no need of this guide, but this guide is meant for those who are switching from ubuntu/mint/fedora/any other disto which are not based on Arch, to say it in short its meant for new users of Arch Linux. Anyway Let's set up.
First let's set see how to install Platform tools.
Setting up platform-tools in UBUNTU(or Ubuntu based distros/Linux Mint)
In ubuntu platform tools can be setup very easily.
1.Open terminal(Default shortcut is ctrl+alt+T)
2. Type "sudo apt-get install android-tools-adb" (this will install the adb)
3. Type "sudo apt-get install android-tools-fastboot"(this will install the fastboot)
Step 4: Check whether the above tools are working by typing an adb command. For e.g. "adb devices"
Now its time to install SDK in Ubuntu and set it up but before that let me tell you there is already a great thread by matt95.You can see the guide and thank him herehttp://forum.xda-developers.com/showthread.php?t=2302780
Fedora/CentOS/RedHat
First lets install Eclipse[You can also use Android Studio if you want]
Code:
sudo yum install eclipse-jdt
Now lets download the sdk from here. http://developer.android.com/sdk/index.html. Its about 500mb , Just wait and let it downlaod. Once the download is done extract it wherever you want.
For newcomers I recommend to extract it to 'home'.So the file is now extracted inside /home/user/AndroidSDK .
Now lets setup .bash_profile file so that we can access adb anywhere or else you have to type the whole location again use the adb command which is lot of work . So let's shorten it up.
Type "sudo vim .bash_profile"in terminal.
Code:
PATH=$PATH:$HOME/AndroidSDK:$HOME/AndroidSDK/tools
export PATH
# For SDK version r_08 and higher, also add this for adb:
PATH=$PATH:$HOME/AndroidSDK/platform-tools
export PATH
Now lets install android plugin for eclipse.
Open Eclipse and click on Help.Select Install New Software. Then click Add, at the top right of that window. Type in Android Plugin for the name and https://dl-ssl.google.com/android/eclipse/ for the address.
Once this is done, click on the Available Software Sites hyperlink below the Add button, then highlight the Android Plugin source and click on Reload. Now exit this window, and choose Android Plugin from the “Work with” dropdown menu. Choose the developer tools option that you see here and Proceed with the installation.
After the installation configure your Android virtual devices.
ARCH LINUX(or Arch based Distros)
Lets install android sdk
Open terminal and type
Code:
wget https://aur.archlinux.org/packages/an/android-sdk/android-sdk.tar.gz
Note:- If terminal shows wget is not found. Type this in the terminal
Code:
pacman -Suy && pacman -S wget
Once it fetches the tarball, lets extract it by typing
Code:
tar -xvzf android-sdk.tar.gz
wait for it to finish. Change the directory to android-sdk by using the command
Code:
cd android-sdk
.
Now lets make the package by using the command
Code:
makepkg -s
now lets install it by typing
Code:
sudo pacman -U *.pkg.tar.xz
Platform tools for Arch
Let's install platform-tools now.Just like above steps ,well get a package and install it.
1. Type
Code:
wget https://aur.archlinux.org/packages/an/android-sdk-platform-tools/android-sdk-platform-tools.tar.gz
2.Type
Code:
tar -xvzf android-sdk-platform-tools.tar.gz
3.Change directory.
Code:
cd android-sdk-platform-tools
4.
Code:
makepkg -s
5.Install it
Code:
sudo pacman -U *.pkg.tar.xz
All the files are installed in /opt/android-sdk/ . Just like we had .bash_profile in FEDORA, we use symbolic links in Arch linux to use commands from anywhere .
Code:
sudo ln -s /opt/android-sdk/platform-tools/adb /usr/bin/adb //this one's for adb
sudo ln -s /opt/android-sdk/platform-tools/fastboot /usr/bin/fastboot //This one's for Fastboot
sudo ln -s /opt/android-sdk/tools/ddms /usr/bin/ddms //This is for DDMS
sudo ln -s /opt/android-sdk/tools/android /usr/bin/android //This is for Android
Now run android by typing "android" in terminal. :good:
Simple as that. If you are yet to switch to Arch linux then I recommened you to use "BBQLinux " its an Arch linux for Android developers. It comes with most of the things needed for android development. You can download it from Here.
Thanks for reading this. Help me by giving me e-books.:angel:
PM me or post here if you have any doubts. :victory:

Install an aur wrapper like pacaur .
pacaur -S android-sdk android-studio android-udev android-platform-tools
Done
Sent from my Nexus 5

Pirateghost said:
Install an aur wrapper like pacaur .
pacaur -S android-sdk android-studio android-udev android-platform-tools
Done
Sent from my Nexus 5
Click to expand...
Click to collapse
Thanks for the reply, I havent tried pacaur repository though. Will give it a try soon.:good:

sorry, I made an error:
Code:
pacaur -S android-sdk android-sdk-platform-tools android-udev android-studio android-sdk-build-tools
you dont need both platform and build tools, it looks like build-tools is more recent. if you want eclipse instead of android studio, just use 'eclipse-android' instead of android-studio

Related

[HOW-TO] Setup ADB on Ubuntu Linux 64Bit

As you all may know (or may not know or may not even care), Google's current implementation of ADB for Linux only works on 32Bit Linux systems (boooh!) which leaves the rest of us x64 users with the dilemma of either installing an extra redundant 32bit version of Ubuntu that will hord 15Gb of space so that we may type a few ADB commands in the bash prompt or install ADB on Windows for those of us that have it. Ever since I bought my phone and was forced to reboot my beloved free OS to type those few commands, I'd wave my fists in the air and curse Google for not having had enough sense to make a 64Bit implementation.
Fortunately, my fists will need tire themselves no more. Using a guide compiled by a Geeksphone.com forum user called Talpa, I was able to successfully compile and run ADB on a Linux 64Bit system in short order. Little things make me happy and having seen that this technique is not very wide spread on the forums, I've decided to spread the happiness myself...
CREDITS:
Big, big thanks to the users of the geeksphone forums for having pooled their time, skills and efforts together to figure out this hack and a another big thank you to talpa for having sifted through all the of posts and having made a coherent and unified guide out of it. The guide can be originally found at:
http://wiki.geeksphone.com/en/index.php?title=CompileADB64bitLinux
the discussion that lead to the guide is at:
http://forum.geeksphone.com/index.php?topic=850.0
ADB Linux 64Bit (yeeehhhaaaah!!!)
For the sake of added clarity, I've completely rewrote the geeksphone guide. go to your terminal
#> sudo su
#> mkdir /tmp/my-adb
#> cd /tmp/my-adb
if you don't already have it, install git-core:
#>apt-get install git-core
once that's done, type out the following commands:
#> git clone git://android.git.kernel.org/platform/system/core.git system/core
#> git clone git://android.git.kernel.org/platform/build.git build
#> git clone git://android.git.kernel.org/platform/external/zlib.git external/zlib
#> git clone git://android.git.kernel.org/platform/bionic.git bionic
Before you run compile, you need to the following alterations to the compile scripts to make the output bianaries 64bit compatible. As time progress and this post ages in the ageless internet, some additional modifications may be necessary (or they may change the place of the offending code or may add new bits that need to be deleted or changed). You can go back to the GeeksPhone wiki link (up above) to see if the forum members there have updated it. Hopefully by then, Google would have compiled a 64Bit Linux version of ADB and all of this would be unnecessary. If for any reason you're unable or unwilling to modify the source code yourself, go to this link where I have posted the source code that I have modified:
http://www.mediafire.com/file/q42gektqr32nr31/adb-Linux64bit-source-code-jan-2011.zip
Editing the Source Code Yourself
first, edit the file /tmp/my-adb/build/target/product/sdk.mk and delete the last six lines:
==============================
# include available languages for TTS in the system image
include external/svox/pico/lang/PicoLangDeDeInSystem.mk
include external/svox/pico/lang/PicoLangEnGBInSystem.mk
include external/svox/pico/lang/PicoLangEnUsInSystem.mk
include external/svox/pico/lang/PicoLangEsEsInSystem.mk
include external/svox/pico/lang/PicoLangFrFrInSystem.mk
include external/svox/pico/lang/PicoLangItItInSystem.mk
==============================
then, edit the file /tmp/my-adb/build/core/main.mk at line 116 (again the position may change, just keep an eye out for the offending code) and erase the following lines:
==============================
# Check for the correct version of java
java_version := $(shell java -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
ifeq ($(strip $(java_version)),)
$(info ************************************************** **********)
$(info You are attempting to build with the incorrect version)
$(info of java.)
$(info $(space))
$(info Your version is: $(shell java -version 2>&1 | head -n 1).)
$(info The correct version is: 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/source/download.html)
$(info ************************************************** **********)
$(error stop)
endif
# Check for the correct version of javac
javac_version := $(shell javac -version 2>&1 | head -n 1 | grep '[ "]1\.6[\. "$$]')
ifeq ($(strip $(javac_version)),)
$(info ************************************************** **********)
$(info You are attempting to build with the incorrect version)
$(info of javac.)
$(info $(space))
$(info Your version is: $(shell javac -version 2>&1 | head -n 1).)
$(info The correct version is: 1.6.)
$(info $(space))
$(info Please follow the machine setup instructions at)
$(info $(space)$(space)$(space)$(space)http://source.android.com/source/download.html)
$(info ************************************************** **********)
$(error stop)
endif
==============================
Edit /tmp/my-adb/build/core/combo/HOST_linux-x86.mk and change every "-m32 string" to "m64"
Now that that's done, you should be able to get the compiling going with the following command:
#> make -f build/core/main.mk out/host/linux-x86/bin/adb
Once that's done, you go to /tmp/my-adb/out/host/linux-x86/bin/ and you get your adb and acp binaries and move them to wherever your OS keeps all the system binaries.
In ubuntu 10.04, that would be
/bin/adb
/bin/acp
That's it, adb should work from your 64 bit linux shell.
==========================
Holy hell that looks overly complicated. I've installed adb about a dozen times on x64 Ubuntu. I'll post a link to the guide i was using in a minute...
Sent from my SGH-T959 using Tapatalk
http://forum.xda-developers.com/showthread.php?t=537508
(skip the last part about setting up fastboot)
except on this step:
SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666"
Click to expand...
Click to collapse
You need to do lsusb in console (with your phone plugged in) and find the Samsung vendor id, it's like 0ed4 or something, I don't remember.
Much easier, I think.
birgertime said:
Holy hell that looks overly complicated. I've installed adb about a dozen times on x64 Ubuntu. I'll post a link to the guide i was using in a minute...
Sent from my SGH-T959 using Tapatalk
Click to expand...
Click to collapse
Um, yeah, I don't know why the OP is doing all this. All you need to do is download the android SDK for your platform:
http://developer.android.com/sdk/index.html
An adb binary is included in the tarball in the tools directory. Just add that to your path somewhere.
Yes, the binary included in the SDK is 32bit. No, it doesn't matter at all. A clean install of 64-bit Ubuntu includes multilib support for the (very few) 32-bit shared libraries it requires.
If you really, really need a 64-bit binary... well, go for it. But unless you're building your own Linux distribution or are doing something really exotic, it's highly likely that the 32-bit version will work just fine.
Yikes! This is overkill. Dude, just install the lib32 library files. You should really read the Android developers page on how to setup the sdk on 64-bit linux, its all there. ;-) Good luck with this though. Really...
Sent from my SGH-T959 using XDA App
I thought some people might appreciate the instructions to get adb working over WiFi too and this seems like a good place to put it:
Type this in your terminal emulator on your Android device:
Code:
setprop service.adb.tcp.port 5555
stop adbd
start adbd
Then check it with this:
Code:
getprop service.adb.tcp.port
If it doesn't return "5555" and you're rooted, then do a "su" command and try again. You shouldn't need to be rooted for adb over wifi to work, but I haven't tried every device:
Code:
su
setprop service.adb.tcp.port 5555
stop adbd
start adbd
Then check it:
Code:
getprop service.adb.tcp.port
When it returns "5555" then run this command in the terminal (or command prompt) on your computer:
Code:
adb connect 192.168.0.151
(Obviously enter your device's IP address. You must be on the same network as the computer that has the Android SDK installed.)
And you should be connected!
To tell the Android device to listen for adb on the USB port instead of TCP again, enter this into the terminal emulator:
Code:
setprop service.adb.tcp.port -1
stop adbd
start adbd
(again, might need "su" on your device)
Or just reboot the Android device.
And to tell your computer to use USB for adb instead of TCP:
Code:
adb usb
Now, keep in mind, when your Android device is listening for adb via WiFi, it's wide open... anybody that that the Android SDK installed and knows your device's IP address can access it without a password.
HTH,
Billy
PS - Your
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
are appreciated!
Yes, I just installed a clean Ubuntu 64 bit and the lib32 binaries were included. I only needed to create a /etc/udev/rules.d/70-android.rules and enter my device ID - SUBSYSTEM=="usb", SYSFS{idVendor}=="18d1", MODE="0666". I can connect via ADB 32 bit just fine.
Of course using 64 bit drivers falls under the I did it because I could category as well. Kudos!
JeremyNT said:
Um, yeah, I don't know why the OP is doing all this. All you need to do is download the android SDK for your platform:
http://developer.android.com/sdk/index.html
An adb binary is included in the tarball in the tools directory. Just add that to your path somewhere.
Yes, the binary included in the SDK is 32bit. No, it doesn't matter at all. A clean install of 64-bit Ubuntu includes multilib support for the (very few) 32-bit shared libraries it requires.
If you really, really need a 64-bit binary... well, go for it. But unless you're building your own Linux distribution or are doing something really exotic, it's highly likely that the 32-bit version will work just fine.
Click to expand...
Click to collapse
Exactly my thoughts as well. It is simple enough to get it working using the standard package that Android provides!
Like others have said adb packaged with the android sdk works fine on ubuntu 10.10 with no additional configuration. The only problem that I know of is you have to run the adb server as root.
Sent from my SGH-T959 using XDA App
I'm pretty sure that you only have to give it root on the first time.
Sent from my SGH-T959 using Tapatalk
phattchumpy said:
Like others have said adb packaged with the android sdk works fine on ubuntu 10.10 with no additional configuration. The only problem that I know of is you have to run the adb server as root.
Sent from my SGH-T959 using XDA App
Click to expand...
Click to collapse
I am able to run the adb server with a user login with guest permissions. Did not have to use root. But I run Ubuntu 10.04. I guess that it would probably be the same for 10.10 as well, but can't confirm.
This is what I do (very simple and fast)
1) Open the terminal and type: wget dl.google.com/android/android-sdk_r07-linux_x86.tgz (Downloads The SDK with ADB)
2) Then type: tar xvfz android-sdk_r07-linux_x86.tgz && cd android-sdk-linux_x86 (Extracts the archive)
3) After that type: sudo mv tools /usr/local/share/android-tools (Moves the sdk tools to your local system folder)
4) Now type: sudo ln -s /usr/local/share/android-tools/adb /usr/local/bin/ (Makes a symbolic link to the adb executable)
5) Then type: sudo adb devices (This will start the adb server and search for connected devices)
You should now see this in your terminal:
List of devices attached
T959730f48f7 device
Firstly, Thanks a lot to the OP for posting this and the link to the geeksphone wiki. I really needed this and I would have removed my existing linux install, had I not come across this in the next few minutes.
Now back to the main reason why I am posting this comment.
I didn't see even one single reply that was grateful to the OP and the first many posts were just plain crap. If you people don't know what someone is talking about, then please don't show your ignorance and move on to troll other threads.
Of course you can install adb from the default google sdk package and it would work fine on 99% of your systems. It is the remaining 1% for whom this post is intended.
This method is for those who have a pure non-multilib 64-bit system. For such users, google has not packaged a 64-bit adb file in their release, and the default adb will not work. Such users have to build the adb file for a 64-bit machine from the sources. It is for such users that this is necessary and it was very much necessary for me, as well as for the OP, I presume.
So if you don't understand something, please don't waste others' time by spamming the post. The title is quite obvious to those who are looking for a solution.
Update: Just as I finished typing this, my adb has got compiled and I am able to run it. Thanks a million once again, OP.
geekoo said:
Firstly, Thanks a lot to the OP for posting this and the link to the geeksphone wiki. I really needed this and I would have removed my existing linux install, had I not come across this in the next few minutes.
Now back to the main reason why I am posting this comment.
I didn't see even one single reply that was grateful to the OP and the first many posts were just plain crap. If you people don't know what someone is talking about, then please don't show your ignorance and move on to troll other threads.
Of course you can install adb from the default google sdk package and it would work fine on 99% of your systems. It is the remaining 1% for whom this post is intended.
This method is for those who have a pure non-multilib 64-bit system. For such users, google has not packaged a 64-bit adb file in their release, and the default adb will not work. Such users have to build the adb file for a 64-bit machine from the sources. It is for such users that this is necessary and it was very much necessary for me, as well as for the OP, I presume.
So if you don't understand something, please don't waste others' time by spamming the post. The title is quite obvious to those who are looking for a solution.
Update: Just as I finished typing this, my adb has got compiled and I am able to run it. Thanks a million once again, OP.
Click to expand...
Click to collapse
damn!
The adb tool has moved to platform-tools/
If you don't see this directory in your SDK,
launch the SDK and AVD Manager (execute the android tool)
and install "Android SDK Platform-tools"
Please also update your PATH environment variable to
include the platform-tools/ directory, so you can
execute adb from any location.
ofcourse they meved it. so ... any new tutorial with android sdk ?
in windows is the same problem with missing adb.exe (but i have an older version installed). just that i use windows for starcraft2 so i want adb for linux (eventually x64).
later edit: found it ->scroll down to platform tools
and after:
extract in a folder, cd to that folder
$sudo apt-get install lib32ncurses5 lib32stdc++6
# echo SUBSYSTEM=="usb", SYSFS{idVendor}=="0bb4", MODE="0666">/etc/udev/rules.d/51-android.rules
$./adb kill-server
$./adb start-server
(kill and start i don`t know if is necessary, but it can`t do nothing wrong)
connect the device, $./adb devices and shall see it.
$./adb shell and enjoy
$ => as regular user
# => as root
i`m on kubuntu 12.04 (x64) and using an android 2.3.7 (cm7 based) huawei u8180 / orange stockholm
even easier
even easier paste these commands in linux terminal
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install android-tools-adb android-tools-fastboot
btw # < $

[GUIDE] Rolling your own CM7 kernel

I have like 3 private messages per day asking help on the kernel so I decided to write a short tutorial on how to build your own CM7 kernel.
Requirements:
- Linux distro such as Ubuntu (recommended).
- Time and 10 GB.
Instructions:
(Instructions tailored for Ubuntu, somewhat similar for other distros)
1. First we need to download some stuff, open your terminal and type these commands:
Code:
sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
sudo apt-get update
sudo apt-get install git-core gnupg sun-java6-jdk flex bison gperf libsdl-dev libesd0-dev libwxgtk2.6-dev build-essential zip curl libncurses5-dev zlib1g-dev gcc-arm-linux-gnueabi
Toolchain is already included.
If you're in a 64-bit machine, run this command too:
Code:
sudo apt-get install ia32-libs lib32z1-dev lib32ncurses5-dev gcc-multilib g++-multilib
2. Open terminal, navigate to a folder where you want the kernel source and type this:
Code:
git clone git://github.com/CyanogenMod/lge-kernel-sniper.git
After the download, navigate (in the terminal of course) to the new folder.
3. Now we need to edit the Makefile in that newly created folder, open it. Look for the flags:
Code:
ARCH ?= ...
CROSS_COMPILE ?= ...
Change to:
Code:
ARCH ?= arm
CROSS_COMPILE ?= /usr/bin/arm-linux-gnueabi-
Save and close.
4. Now we need a .config file. Run this command (the terminal must be in that kernel folder where Makefile is):
Code:
make ARCH=arm cyanogenmod_hub_defconfig
Voilá, you can find the .config in the folder (control+h to show hidden files).
5. Edit the kernel as you want. You can grab some ideas from my incomplete source of knzo kernel for CM7: http://github.com/mnlsrv/kernel
6. Let's compile it! Run the command:
Code:
make -j4
In the end you'll get a zImage and .ko files (modules).
7. Now use unpackbootimg or Dsixda kitchen to unpack CM7's boot.img (you can extract it from a nightly), replace zImage with yours and repack.
8. Now you need to flash the boot.img; just use the zip for knzo kernel and replace the boot.img for yours; replace the modules too (/system/lib/modules).
9. Flash and enjoy.
Hope I didn't forget to mention any step.
I am not an active dev, but would like to thank you at the first place. Any beginner in android development will surely be grateful to this simple step wise guide....
A few tips:
Custom governors go into /drivers/cpufreq.
Custom I/O schedulers go into /block/.
For each addition you need to change Kconfig and Makefile. Then the .config will need to be updated and this is automatic when you run the make command. Open and edit .config when you're more familiar with all of it.
Here https://github.com/mnlsrv/kernel/commits/master you can see some commits (changes) I did to the kernel and if you click on one of it, it will show exactly how and which files were changed.
Only a remark:
- To completely add a governor, you have to edit /include/linux/cpufreq.c too in order to set a different default governor without compile errors.
if i have more time ,i'll have a try
thank you knzo,you did a great job!
So kind of you knzo... I'll definitely try this if I still have black....
However... Black is still the best phone I ever had.... miss my black very much...
Keep the good works guys, i keep my eyes to this community, wondering how far this device will go....
Beginners guide to making kernel images
Here I have logged down my own experiences with making Optimus Black kernel binary. Being a Windows person myself I know how troublesome and confusing a development under MinGW can get so I decided to do it under VirtualBox instead. I sincerely hope that the steps described below are a good reference to everybody who is interested in modding his or her own kernel but hasn't gotten over the administrative burden yet. Written as from beginner to beginner I tried to be as concise as possible, leaving out nothing important and everything optional. Just enough to get from zero to updated kernel on your phone.
1. Prepare the environment
Download VirtualBox from https://www.virtualbox.org/wiki/Downloads and install it. I downloaded version 4.1.6 which was the latest version at the moment (http://download.virtualbox.org/virtualbox/4.1.6/VirtualBox-4.1.6-74713-Win.exe)
Download Ubuntu from http://www.ubuntu.com/download/ubuntu/download and install it under VirtualBox. I downloaded latest 32-bit version (http://www.ubuntu.com/start-download?distro=desktop&bits=32&release=latest). Install Guest Additions afterwards as well if you want to use clipboard between host and guest operating systems.
Open terminal and create a folder under your home directory for all the things involved.
Code:
mkdir android
cd android
Install Git and get the kernel source. I had to use http protocol as git protocol was blocked for me.
Code:
sudo apt-get install git
git clone http://github.com/CyanogenMod/lge-kernel-sniper.git
2. This is the part where you change the code
Done? Move to the next step and cross your fingers. For the purpose of this guide we are not changing anything.
3. Make the kernel image
Go to kernel directory
Code:
cd lge-kernel-sniper
Install Arm toolchain and make the kernel image
Code:
sudo apt-get install gcc-arm-linux-gnueabi lzma
export ARCH=arm
export CROSS_COMPILE=/usr/bin/arm-linux-gnueabi-
make cyanogenmod_hub_defconfig
make
There was one thing I had to modify before make completed without errors. Inside drivers/net/wireless/bcm4329 I had to remove -Werror from the Makefile because the warnings were considered as errors otherwise. If everything goes well you'll find zImage under arch/arm/boot directory.
4. Create and deploy the update image (see also http://forum.xda-developers.com/showthread.php?t=1350679)
Download Kernel Injector update image template
Code:
cd ..
wget -O output.zip http://forum.xda-developers.com/attachment.php?attachmentid=785468
Update zImage inside update.zip
Code:
zip -j update.zip lge-kernel-sniper/arch/arm/boot/zImage
Update modules inside update.zip
Code:
mkdir modules
find lge-kernel-sniper/ -name "*.ko" -exec cp {} modules \;
zip -d update modules/\*
zip update modules/*
Use your favourite method of getting the update.zip to your phone's SD card, boot into recovery and flash.
Good luck! And as always - comments and suggestions are most welcome!
- Aprold

[GUIDE] Setup Android Development Environment on Ubuntu 13.04+

{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Hi guys and future devs here you will find a very helpful guide on how to setup the android development so that you can basically do anything you want!
I'll suggest you many useful programs that are needed in this field
In this guide I'll be using Ubuntu 13.04 but probably this will also work on 12.04-12.10 and future releases!
Ok now let's begin with the real stuff :good:
INSTALL UBUNTU
The first thing you'll need to do is obviously the ubuntu installation, unfortunately i won't cover this part of the guide cause I think that everyone who is looking at this guide knows how to install an OS on a Desktop (hope so)
Download
SETUP ANDROID DEVELOPMENT ENVIRONMENT
WHAT WE NEED
1- JDK 6(Java Development Kit) NOTE: you will need to sign in the oracle site for this version of java unfortunately )
2- GNU Make (Optional)
3- Python 2.7
4- Git 1.7
5- Android SDK
6- Some more packages
INSTALLATION
JDK
Installing the JDK is pretty tricky and stressful every time
First, download the JDK 6, which you can download here. Download the .bin file! (in this case my JDK has been downloaded in the ~/Download folder and my file is named jdk-6u45-linux-x64.bin)
Open up your terminal and type
Code:
$ sudo mkdir /usr/lib/jvm
$ cd ~/Downloads/
$ chmod +x jdk-6u45-linux-x64.bin
$ ./jdk-6u45-linux-x64.bin
$ sudo mv jdk1.6.0_45 /usr/lib/jvm/
$ sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/jdk1.6.0_45/bin/javac 1
$ sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.6.0_45/bin/java 1
$ sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/jdk1.6.0_45/bin/jar 1
$ sudo update-alternatives --install /usr/bin/javaws javaws /usr/lib/jvm/jdk1.6.0_45/bin/javaws 1
$ java -version
Ok, if you did everything fine you should now have the JDK installed correctly ​
GIT
This is the easiest one
Code:
$ sudo apt-get install git
$ y
PYTHON
Download the 2.7.5 version or newer here
Code:
$ cd ~/Downloads/
$ tar -xzvf Python-2.7.5.tgz
$ cd Python-2.7.5/
$ ./configure
$ make
$ sudo make altinstall
GNU
You don't need this step, do this just if you want the latest version of GNU Make
Download the latest version here
Code:
$ cd ~/Downloads/
$ tar -zxvf make-3.82.tar.gz
$ cd make-3.82
$ ./configure
$ make
$ sudo make install
OTHER PACKAGES
These packages are needed to run many many android commands such as ADB and FASTBOOT (only 64-bit needs this)
Code:
$ sudo apt-get install ia32-libs
$ y
This will take about 20 mins especially if you have a slow processor or internet connection so relax and have a coffee :good:
If you're using Ubuntu 14.04 this won't work because that package isn't available anymore, so you just want to do these steps here
Code:
$ sudo dpkg --add-architecture i386
$ sudo apt-get update
$ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386
ANDROID SDK
This will be your best friend from now on
Download it here > download for other platforms > download the sdk tools only
Ok now i always create a Development folder where i put all the android development stuff (you can do whatever you think here)
Code:
$ mkdir ~/development
$ cd ~/Downloads
$ tar -zxvf android-sdk_r22.0.1-linux.tgz
$ mv ~/Downloads/android-sdk-linux ~/development/
Now you're ready to run the Android SDK ​
SETUP ADB/FASTBOOT
Open up the Android SDK by running this command
Code:
$ cd ~/development/android-sdk-linux/tools
$ ./android
At this point the SDK should come up and you will need to download at least all the tools and all the extras files, so select them and install'em.
When it finishes downloading everything you have to run this commands in another terminal
Code:
$ sudo gedit .bashrc
And you need to add at the end of it your SDK paths
Code:
#Android PATHS
export PATH=$PATH:~/development/android-sdk-linux/tools
export PATH=$PATH:~/development/android-sdk-linux/platform-tools
If you followed everything now adb and fastboot should work!
to check this you need to close all the terminals opened, reopen one and simply type
Code:
$ adb
$ fastboot
You should get a long list of possible commands if so you're done!​
FIXING NO PERMISSIONS ERROR
Probably, if you run
Code:
$ adb devices
or
$ fastboot devices
right now you'll get a strange output, something like this
Code:
???????? No permissions
In order to avoid this message we have to create a simple file
Code:
$ cd /tmp/
$ touch android.rules
$ nano android.rules
Now you have to paste this lines in that file and save it
Code:
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="24e3", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2116", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0482", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="17ef", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0409", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2257", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d4d", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04da", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f53", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04dd", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0930", MODE="0666"
SUBSYSTEM=="usb", ATTRS{idVendor}=="19d2", MODE="0666"
Now you have to set the right permissions to this file, just type
Code:
$ sudo cp /tmp/android.rules /etc/udev/rules.d/51-android.rules
$ sudo chmod 644 /etc/udev/rules.d/51-android.rules
$ sudo chown root. /etc/udev/rules.d/51-android.rules
$ sudo service udev restart
$ sudo killall adb
​
SUGGESTED PROGRAMS
ECLIPSE
In the Android world you don't want to miss the Eclipse IDE which is the most used! This tool will help you develop android apps
You can download it here (download the classic one)
Code:
$ cd ~/Downloads
$ tar -zxvf eclipse-SDK-4.2.2-linux-gtk-x86_64.tar.gz
$ mv ~/Downloads/eclipse ~/development/
SETUP INFO
NOTE: If you download the entire ADT bundle provided by google you will get the SDK and Eclipse IDE together ​
ANDROID STUDIO (Recommended)
This is the new development IDE made in Google, personally i love it! We are now on version 8.6 BETA and I have to say that it's a really really good looking and powerful IDE. I would recommend to use this IDE because, over time, it will be the main Android IDE (rumors say that Google will stop developing ADT bundles so Eclipse won't be supported anymore and this will force you to switch to Android Studio).
You can download it from here
It has a lot of new features that Eclipse doesn't have and it could be useful in some cases
Code:
$ cd ~/Downloads
$ tar -zxvf android-studio-bundle-130.687321-linux.tgz
$ mv ~/Downloads/android-studio ~/development/
To run it you just need to navigate to its bin folder and type
Code:
$ ./studio.sh
If you don't want to type this everytime you can just create a shortcut for it by opening Android Studio and going into Configure > Create desktop entry That's it!​
hey nice guide !
I personally am a ubuntu 13.04 user
just one suggestion , you can add in your thread alternate way of downloading the whole ADT bundle and setting it up; so that separate installation of sdk eclipse adt plugin etc is not required
Sent from my GT-S5670 using xda premium
soham jambhekar said:
hey nice guide !
I personally am a ubuntu 13.04 user
just one suggestion , you can add in your thread alternate way of downloading the whole ADT bundle and setting it up; so that separate installation of sdk eclipse adt plugin etc is not required
Sent from my GT-S5670 using xda premium
Click to expand...
Click to collapse
that's right i'll add this later!
Was looking for something like this, good work:thumbup:
Sent from my C6603 using xda app-developers app
shoey63 said:
Was looking for something like this, good work:thumbup:
Sent from my C6603 using xda app-developers app
Click to expand...
Click to collapse
glad it helped let me know if everything works correctly
matt95 said:
glad it helped let me know if everything works correctly
Click to expand...
Click to collapse
Hi matt, thanks a ton for this great tutorial. I have followed all the steps mentioned here and i think adb and fastbook has been installed on my system Running the ./adb and ./fastboot commands bring up a list of command on the terminal.
Nw i have been trying to connect my phone to flash a boot.img, after i run "./adb devices" to check if the phone is connected it shows me this :
List of devices attached
???????????? no permissions
not sure if the device is connected do u knw what is causing this error ?
Being you have a path setup (per this guide) try typing either just
adb devices
or
fastboot devices
skip the ./ and see if it will work
I have got my device now connected in fastboot mode. Thanks again for this great tutorial. I am not a rom builder but a crazy flasher I skipped a few steps from the above tutorial to get fastboot and adb working on Ubuntu 13.04.
To install JDK:
Start by removing the openJDK if it exists already
Code:
sudo apt-get purge openjdk*
To install Java 8, do this
Add the PPA:
Code:
sudo add-apt-repository ppa:webupd8team/java
Update the repo index:
Code:
sudo apt-get update
Install Java 8:
Code:
sudo apt-get install oracle-java8-installer
Install GIT from the OP tutorial
Skip Python install
Skip GNU install
Skip ia32-libs install if you are using 32bit OS
Download the Android SDK from OP and install it as mentioned there.
Setup ADB/Fastboot as mentioned in the OP
Skip Suggested programs :cyclops:
Now connect your device in fastboot mode and type in terminal fastboot to check if your device is recognised, if you get
"fastboot not installed error"
Try
Code:
sudo apt-get install android-tools-adb android-tools-fastboot
connect device in fastboot and try :
Code:
sudo fastboot devices
Done
8yt3c0d3 said:
Hi matt, thanks a ton for this great tutorial. I have followed all the steps mentioned here and i think adb and fastbook has been installed on my system Running the ./adb and ./fastboot commands bring up a list of command on the terminal.
Nw i have been trying to connect my phone to flash a boot.img, after i run "./adb devices" to check if the phone is connected it shows me this :
List of devices attached
???????????? no permissions
not sure if the device is connected do u knw what is causing this error ?
Click to expand...
Click to collapse
actually i should write more to avoid that message :/ stay tuned! tonight i'll write how to solve that... sorry for making you wait
8yt3c0d3 said:
I have got my device now connected in fastboot mode. Thanks again for this great tutorial. I am not a rom builder but a crazy flasher I skipped a few steps from the above tutorial to get fastboot and adb working on Ubuntu 13.04.
To install JDK:
Start by removing the openJDK if it exists already
Code:
sudo apt-get purge openjdk*
To install Java 8, do this
Add the PPA:
Code:
sudo add-apt-repository ppa:webupd8team/java
Update the repo index:
Code:
sudo apt-get update
Install Java 8:
Code:
sudo apt-get install oracle-java8-installer
Install GIT from the OP tutorial
Skip Python install
Skip GNU install
Skip ia32-libs install if you are using 32bit OS
Download the Android SDK from OP and install it as mentioned there.
Setup ADB/Fastboot as mentioned in the OP
Skip Suggested programs :cyclops:
Now connect your device in fastboot mode and type in terminal fastboot to check if your device is recognised, if you get
"fastboot not installed error"
Try
Code:
sudo apt-get install android-tools-adb android-tools-fastboot
connect device in fastboot and try :
Code:
sudo fastboot devices
Done
Click to expand...
Click to collapse
yeah that works too but sometimes you may have some problem with that command and probably it won't work on every distro, while the manual installation always works
8yt3c0d3 said:
Hi matt, thanks a ton for this great tutorial. I have followed all the steps mentioned here and i think adb and fastbook has been installed on my system Running the ./adb and ./fastboot commands bring up a list of command on the terminal.
Nw i have been trying to connect my phone to flash a boot.img, after i run "./adb devices" to check if the phone is connected it shows me this :
List of devices attached
???????????? no permissions
not sure if the device is connected do u knw what is causing this error ?
Click to expand...
Click to collapse
you should run adb with root user
Code:
sudo adb devices
that should do the trick
Thanks!
Just registered on xda, starting with android development, this guide helped me a lot!! I am using Ubuntu 12.04.2 LTS though.
Thanks a lot!
vaibhav_vc said:
Just registered on xda, starting with android development, this guide helped me a lot!! I am using Ubuntu 12.04.2 LTS though.
Thanks a lot!
Click to expand...
Click to collapse
glad it helped if you get any issue ask here :good:
Hello and greetings to Verona. I love your region, very nice there!
Very good guide, sir! Used this to set up my first Linux/Ubuntu/Android environment! :good:
Some points/questions i have (as a long time windows user ):
matt95 said:
OTHER PACKAGES
These packages are needed to run many many android commands such as ADB and FASTBOOT
Code:
$ sudo apt-get install ia32-libs
$ y
Click to expand...
Click to collapse
These packages are only for 64bit i think?
Code:
$ cd ~/Downloads
$ tar -zxvf eclipse-SDK-4.2.2-linux-gtk-x86_64.tar.gz
[B][COLOR="Red"]$ mv ~/Downloads/ ~/development/[/COLOR][/B]
Click to expand...
Click to collapse
Is the red line correct, cause it moves the complete download folder to development?
And the most important thing for me as windows user:
I have now all importent things for development in ~/development/ folder.
Every time i have to go with terminal to the specific folder and execute the program:
Code:
cd ~/development/kitchen
./menu
cd ~/development/eclipse
./eclipse
cd ~/development/android-studio/bin
./studio.sh
cd ~/development/android-sdk-linux/tools
./android
Is it possible to make these programs executable like adb and fastboot?
What i mean is, open terminal, write ./menu and kitchen starts, without moving to the kitchen folder (like adb).
If yes, a step-by-step guide would be very appreciated!
Or any other way to start those programs on a easy way, like linked into Cairo Dock?
Thanks in advance and keep on rockin'!
old.splatterhand said:
Hello and greetings to Verona. I love your region, very nice there!
Very good guide, sir! Used this to set up my first Linux/Ubuntu/Android environment! :good:
Some points/questions i have (as a long time windows user ):
These packages are only for 64bit i think?
Is the red line correct, cause it moves the complete download folder to development?
And the most important thing for me as windows user:
I have now all importent things for development in ~/development/ folder.
Every time i have to go with terminal to the specific folder and execute the program:
Code:
cd ~/development/kitchen
./menu
cd ~/development/eclipse
./eclipse
cd ~/development/android-studio/bin
./studio.sh
cd ~/development/android-sdk-linux/tools
./android
Is it possible to make these programs executable like adb and fastboot?
What i mean is, open terminal, write ./menu and kitchen starts, without moving to the kitchen folder (like adb).
If yes, a step-by-step guide would be very appreciated!
Or any other way to start those programs on a easy way, like linked into Cairo Dock?
Thanks in advance and keep on rockin'!
Click to expand...
Click to collapse
Yes those packages are for the x64 desktops, i should have said that! :good:
The red highlighted command was wrong, now i've corrected it! thanks for reporting that
And last thing, if you want to run that commands as adb and fastboot you only have to add those commands' directories to the .bashrc
so open up the terminal and type
Code:
$ gedit .bashrc
and then you have to write down the directories
example (the menu command is in the ~/development/kitchen directory) you should write
Code:
#Personal PATHS(you can write what you want after the #)
export PATH=$PATH:~/development/kitchen
then hit save and that's all close all the terminals that are open and now you can launch the kitchen just by typing menu (you don't have to type ./ before it).
if you need help again just ask
Excellent guide
awesome :good: very good guide thanks a lot
bliizzz said:
awesome :good: very good guide thanks a lot
Click to expand...
Click to collapse
glad to help :highfive:
matt95 said:
And last thing, if you want to run that commands as adb and fastboot you only have to add those commands' directories to the .bashrc
so open up the terminal and type
Code:
$ gedit .bashrc
and then you have to write down the directories
example (the menu command is in the ~/development/kitchen directory) you should write
Code:
#Personal PATHS(you can write what you want after the #)
export PATH=$PATH:~/development/kitchen
then hit save and that's all close all the terminals that are open and now you can launch the kitchen just by typing menu (you don't have to type ./ before it).
Click to expand...
Click to collapse
First, thank you for your super-quick reply! :good:
Yes, i thought about that, adding those lines to ".bashrc". :laugh:
I did it already yesterday, but maybe i did something wrong, cause i tried to open kitchen in terminal with ./menu and it did not work. But maybe its because of ./
The .bashrc file don't need to be "updated" after saving (like for example grub, when editing the OS that starts first on dual boot)?
Anyway, i will have a look and post the result.
old.splatterhand said:
First, thank you for your super-quick reply! :good:
Yes, i thought about that, adding those lines to ".bashrc". :laugh:
I did it already yesterday, but maybe i did something wrong, cause i tried to open kitchen in terminal with ./menu and it did not work. But maybe its because of ./
The .bashrc file don't need to be "updated" after saving (like for example grub, when editing the OS that starts first on dual boot)?
Anyway, i will have a look and post the result.
Click to expand...
Click to collapse
when you add something to the .bashrc you do not have to type the ./ before the command and yes, it doesn't need to be updated, just save it and that's it
Ok, will take a look, when i booted it again.

Install ADB on Windows & ubuntu 12.04 or 12.10

If you need to flash ROM even using fastboot for Smartphone or Tablet in which they use Android OS! Then Ubuntu OS is needed!
This is a guide I made for ubuntu users and included a guide for windows users to setup Android SDK which contains ADB.
Android Debug Bridge (ADB) provides a terminal interface on your PC to interact with your device's file system. This can be useful for many things like installing & uninstalling apps, logcat, backup & restore, and hacking your device just to name a few.
ubuntu 12.04 & 12.10 Guide
1. Go here and download android-sdk (not the adt-bundle)....
https://hotfile.com/dl/241406263/5e6a306/android-sdk_r22.0.5-linux.tgz.html
2. Place the downloaded file in your home folder and then extract it and you should get a folder named android-sdk-linux (do not rename it).
3. If you’re on a 64bit machine run these commands in terminal to make sdk compatible with 64bit (if you’re on 32bit machine then skip this step)....
sudo apt-get update
sudo apt-get install ia32-libs-multiarch
4. Run this command in terminal to install jdk if you don’t have it already....
sudo apt-get install openjdk-6-jdk
5. Navigate to the home folder where you extracted android-sdk-linux and open the folder then open the folder named tools
6. Inside the tools folder there will be a file named android... double click it and select run then android sdk manager will open.
7. In the center pane deselect everything... Now only select the following....
Android SDK Tools
Android SDK Platform-tools
Android Support Library
8. Once selections have been made click on install packages and wait till finished.
9. Upon completion of step 8 in terminal run this command....
sudo gedit ~/.bashrc
When the file opens, go to the very bottom and copy/paste the following 3 lines (make sure they’re each on separate lines)....
# Android tools
export PATH=${PATH}:~/android-sdk-linux/tools
export PATH=${PATH}:~/android-sdk-linux/platform-tools
10. Now reboot your computer.
11. Set your phone to usb debugging then plug it to your pc after pc is done booting
12. Open a terminal on your pc and enter....
adb devices
If all went well, you should see your phone’s serial number and you’ll be ready to go.
~~~~~Important~~~~~
You can use steps 5 & 6 to open Android SDK Manager & update your ADB/SDK installation. Only select your installed packages then update.
Also if you only need the fastboot/adbtools:
sudo add-apt-repository -y ppa: phablet-team/tools
Note: delete the space after"-y ppa:" -xda creates smileys like ppa
sudo apt-get update
sudo apt-get install -y phablet-tools
Sent from my Nexus 4 using xda app-developers app
Thank...
gazhead said:
Also if you only need the fastboot/adbtools:
sudo add-apt-repository -y ppa: phablet-team/tools
Note: delete the space after"-y ppa:" -xda creates smileys like ppa
sudo apt-get update
sudo apt-get install -y phablet-tools
Sent from my Nexus 4 using xda app-developers app
Click to expand...
Click to collapse
Thanks man! It's also good way!
Followed this guide (thank you for posting) but couldn't connect. Scratched around and found I needed to create a new file in /etc/udev/rules.d with:
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="<4-char_verndorID>", ATTR{idProduct}=="4-char_productID", MODE="0666", OWNER="username"
Followed by:
Code:
sudo restart udev
Then plugged device in and it worked!
qtoon said:
Followed this guide (thank you for posting) but couldn't connect. Scratched around and found I needed to create a new file in /etc/udev/rules.d with:
Code:
SUBSYSTEM=="usb", ATTR{idVendor}=="<4-char_verndorID>", ATTR{idProduct}=="4-char_productID", MODE="0666", OWNER="username"
Followed by:
Code:
sudo restart udev
Then plugged device in and it worked!
Click to expand...
Click to collapse
What did you name the new file you created? Or did you add this string to another existing file from the rules.d directory? I'm not sure what I've done wrong, but I get
Code:
[email protected]:~$ adb devices
No command 'adb' found, did you mean:
Command 'cdb' from package 'tinycdb' (main)
Command 'gdb' from package 'gdb' (main)
Command 'dab' from package 'bsdgames' (universe)
Command 'zdb' from package 'zfs-fuse' (universe)
Command 'kdb' from package 'elektra-bin' (universe)
Command 'tdb' from package 'tads2-dev' (multiverse)
Command 'pdb' from package 'python' (main)
Command 'jdb' from package 'openjdk-6-jdk' (main)
Command 'jdb' from package 'openjdk-7-jdk' (universe)
Command 'ab' from package 'apache2-utils' (main)
Command 'ad' from package 'netatalk' (universe)
adb: command not found
[email protected]:~$
This is after following each step, adding the three lines to the end of .bashrc and rebooting.
atmu5fear said:
What did you name the new file you created? Or did you add this string to another existing file from the rules.d directory? I'm not sure what I've done wrong, but I get
Code:
[email protected]:~$ adb devices
No command 'adb' found, did you mean:
Command 'cdb' from package 'tinycdb' (main)
Command 'gdb' from package 'gdb' (main)
Command 'dab' from package 'bsdgames' (universe)
Command 'zdb' from package 'zfs-fuse' (universe)
Command 'kdb' from package 'elektra-bin' (universe)
Command 'tdb' from package 'tads2-dev' (multiverse)
Command 'pdb' from package 'python' (main)
Command 'jdb' from package 'openjdk-6-jdk' (main)
Command 'jdb' from package 'openjdk-7-jdk' (universe)
Command 'ab' from package 'apache2-utils' (main)
Command 'ad' from package 'netatalk' (universe)
adb: command not found
[email protected]:~$
This is after following each step, adding the three lines to the end of .bashrc and rebooting.
Click to expand...
Click to collapse
@atmu5fear, inferring that you're new to Linux (a common background for all), some notes:
Unlike wlth Win-d'oh-s, there is a worldwide development community that's always working toward improvement of every aspect of the system, including echoed messages and documentation. You may have to shake off the tendency to ignore Windudz messages, which are frequently unhelpful. Linux command echoes are much more on-target. Also, look for files such as README in rules.d and read it!
Now before creating a new config file (which may not be necessary on your system), see the top feedback line: "No command 'adb' found." First, see that the adb binary is present and that it has exec permission. (Since it's a small file and functions alone, I prefer to copy it to the folder I'm working from.)
If it then runs but won't connect, read on...
Directory (or "folder") names with a trailing '.d' are special: They configure, control, or provide executables for daemons (programs which run continuously, providing a service).
Within service-config.d folders, if the service steps through the files sequentially (as in this case), then it does so based on each filename. (True except for the special case of rc.d, iIRC, in which order is set by the special program rcorder).
So in this case, for example, since the existing files are named 70-whatever, your newly-created file could be 80-atmu5fears-phone to load after the others.
Should connect.
qtoon said:
@atmu5fear, inferring that you're new to Linux (a common background for all), some notes:
Unlike wlth Win-d'oh-s, there is a worldwide development community that's always working toward improvement of every aspect of the system, including echoed messages and documentation. You may have to shake off the tendency to ignore Windudz messages, which are frequently unhelpful. Linux command echoes are much more on-target. Also, look for files such as README in rules.d and read it!
Now before creating a new config file (which may not be necessary on your system), see the top feedback line: "No command 'adb' found." First, see that the adb binary is present and that it has exec permission. (Since it's a small file and functions alone, I prefer to copy it to the folder I'm working from.)
If it then runs but won't connect, read on...
Directory (or "folder") names with a trailing '.d' are special: They configure, control, or provide executables for daemons (programs which run continuously, providing a service).
Within service-config.d folders, if the service steps through the files sequentially (as in this case), then it does so based on each filename. (True except for the special case of rc.d, iIRC, in which order is set by the special program rcorder).
So in this case, for example, since the existing files are named 70-whatever, your newly-created file could be 80-atmu5fears-phone to load after the others.
Should connect.
Click to expand...
Click to collapse
Thanks @qtoon for the reply. I'm not really new to Ubuntu, albeit, it's been a while. First started using it just prior to the realease of Hardy Heron 8.04 LTS. That being said I am certainly no expert, but am somewhat familiar and comfortable with the command line. I did read the README file before posting, but since I'm not all that familiar with configuration files and the like, I figured maybe I should ask.
As per your suggestion i moved the ADB binary to my home folder, not necessarily my working folder, but to test to see if the adb command would be recognized in terminal.
Code:
mv ~/ADB/android-sdk-linux/platform-tools/adb ~/
Still got same result so I moved it back, then went on to make a new file and add the suggested string
Code:
sudo > /etc/udev/rules.d/80-atmu5fear-adb
sudo gedit /etc/udev/rules.d/80-atmu5fear-adb
After saving and restarting udev I still get the same "adb command not found" error.
I then changed the string to read OWNER"atmu5fear" instead of "username", still nothing
Any more suggestions?
Thanks
atmu5fear
Sorted it out
instead of:
adb devices
i needed to input:
./adb devices
It's listed, and in order to use the adb shell:
./adb shell
once in the shell all adb commands work
I get this error...
[email protected]:~$ sudo > /etc/udev/rules.d/80-sjy-phone
bash: /etc/udev/rules.d/80-sjy-phone: Permission denied
ok....... didn't need to add a file, changed phone usb mode to media device and all is ok.
thanks
atmu5fear said:
Sorted it out
instead of:
adb devices
i needed to input:
./adb devices
It's listed, and in order to use the adb shell:
./adb shell
once in the shell all adb commands work
Click to expand...
Click to collapse
Didn't think to mention that, apologies.
Quick 'why' on the ./ here.
Glad you got it running.
Just tried on 14.4 and worked like a charm.
Note: No need to reboot the computer, just reload the bash config with
Code:
source ~/.bashrc
Thanks
A good step by step guide
i will try it and see if it works
Thanks again
Hello, can someone help me ? - I m having problems connecting my device with adb (I ve connected several other devices before with no problems).
I ve got an Allwinner A20 tv box, it worked fine for a few months then one day, after being on (but idle) for a few hours, I noticed the screen was blank but the light on the front was blue (indicating it was on, red is standby). It would not respond to the remote control or to anything, so I unplugged it and since then it will not boot and the screen is blank, the red light will light up but that is it. I ve eliminated the remote controller not working, but I cant boot the device.
So I ve tried connecting via ADB (with Ubuntu) but I cant get the device to show up after typing "adb devices".
Using this guide:
http://androidonlinux.wordpress.com/2013/05/12/setting-up-adb-on-linux/
I can get the vendor id and device id and I ve added it and the manufacturer to udev/modeswitch devices, but when I type "sudo usb_modeswitch -v 0x1f3a -p 0xefe8 -S -R -W"
I get the following error:
~/Android/sdk/platform-tools$ sudo usb_modeswitch -v 0x1f3a -p 0xefe8 -S -R -W
Take all parameters from the command line
* usb_modeswitch: handle USB devices with multiple modes
* Version 2.1.1 (C) Josua Dietze 2014
* Based on libusb1/libusbx
! PLEASE REPORT NEW CONFIGURATIONS !
DefaultVendor= 0x1f3a
DefaultProduct= 0xefe8
SierraMode=1
NeedResponse=0
Look for default devices ...
found USB ID 048d:1336
found USB ID 1d6b:0002
found USB ID 19a8:2036
found USB ID 1f3a:efe8
vendor ID matched
product ID matched
found USB ID 1d6b:0001
found USB ID 062a:0102
found USB ID 1d6b:0001
Found devices in default mode (1)
Access device 004 on bus 003
Current configuration number is 1
Use interface number 0
USB description data (for identification)
-------------------------
Manufacturer: not provided
Product: not provided
Serial No.: not provided
-------------------------
Send Sierra control message
Error: Sierra control message failed (error -7). Abort
I ve searched Google for the error code but I cannot find anything.
The device was rooted and USB debugging was on.
Any help would really be appreciated.
Thanks

Arch Linux - Lightweight Custom Environment Setup

Arch Linux - Lightweight Custom Environment Setup Instructions​
NOTICE: I am not responsible if something happens with your device, proceed at your own risk. It is always recommended to follow Arch's own installation guide, even though these instructions below are from it already just more simplified.​
This article is an alternative to the R method from my minimal Arch Linux instructions which you can find here, so don't do anything from here unless you have Arch Linux already installed either from my instructions or from the wiki! This instructions consists of the following packages for creating the custom environment:
i3: dynamic tiling window manager
LightDM: login page
tint2: bottom bar
rofi: application launcher
xfce4-terminal: lightweight terminal
nitrogen: wallpaper tool
thunar: lightweight file manager
autotiling: better autotiling for the window manager
PulseAudio and pavucontrol: audio manager
This has been tested in VMs and on my main computer.
--
Table of Content:
I. Lightweight Custom Environment Installation
II. Optional Notes
--​
I. Lightweight Custom Environment Installation​
R. Installing the Custom Environment
First let's enable NetworkManager, type this (do this if you came here after following my own Arch Linux installation instructions and you want to continue step R from here, or else connect to your internet in any way you want):
sudo systemctl enable NetworkManager
Reboot by typing "reboot", then after the reboot type "nmtui" and connect to your internet.
Next, update your system by typing:
sudo pacman -Syu
Now let's install these packages: xorg-server, lightdm, i3-gaps and tint2. Type:
Note: you can replace "lightdm-gtk-greeter" with another greeter of your choice, check here: https://wiki.archlinux.org/title/LightDM#Greeter
sudo pacman -S xorg-server lightdm lightdm-gtk-greeter i3-gaps tint2
After the packages are installed, enable lightdm by typing:
sudo systemctl enable lightdm
Now let's setup LightDM, type this in order to edit the config:
sudo nano /etc/lightdm/lightdm.conf
Change the [Seat:*] section, which is this:
...
greeter-session=lightdm-yourgreeter-greeter
...
Instead of "yourgreeter" replace it with the greeter you installed, for example in this case it's "gtk".
Type "reboot" to reboot your system, you should see the login page. Login to i3 (not the one with "(with debug log)", click the arrow and change to "i3") and follow the steps to create config file. After creating the config file, you can continue:
Go to TTY by doing the combination (usually ALT+SHIFT+F2) and run this:
sudo cp /etc/i3/config ~/.config/i3/
Now let's setup tint2 by adding this at the bottom of the i3 config file (run this command to be able to edit the config file: sudo nano $HOME/.config/i3/config):
exec --no-startup-id tint2
Now let's install rofi and xfce4-terminal by running this command:
sudo pacman -S rofi xfce4-terminal
Exit TTY by doing the combination (usually ALT+SHIFT+F1), if you're facing issues just reboot pc.
ALT+Enter (after logging in from the login page) is the combination to open terminal.
Now let's finish setting up rofi, do the combination above to open the terminal and run this command in it:
sudo nano ~/.config/i3/config
Go to the "start dmenu (a program launcher)" section, comment the second line, it should be like this:
# bindsym Mod1+d exec --no-startup-id dmenu_run
the # is commenting the line. And uncomment the third line, which is:
bindsym Mod1+d exec "rofi -modi drun,run -show drun"
the # should be gone
Then save by CTRL+S and close by CTRL+X and reboot your system.
Now we will configure i3 further for tint2, remove the following from the i3 configuration file:
# Start i3bar to display a workspace bar (plus the system information i3 status
# finds out, if available)
bar {
status_command i3status
}
This will be at the bottom of the config file ^ it removes i3bar so only i3 would start.
Then reboot your system by typing "reboot" in the terminal.
After rebooting, when doing the combination ALT+D it opens the application menu.
This step is optional, but it is recommended because it will let you install packages from the AUR (user repisotary). We will also install yay by running these separately:
(Let’s install git in order to install yay afterwards with it)
sudo pacman -S git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
Install Nitrogen and Thunar to have a wallpaper tool and a file manager by running this command:
sudo pacman -S nitrogen thunar
Check here for more information about Nitrogen and how to use it: https://wiki.archlinux.org/title/nitrogen#Usage
And add this at the bottom of the i3 config file:
exec nitrogen --restore &
Now let's install the user folders (Documents, Pictures...) by installing this package:
sudo pacman -S xdg-user-dirs
Then run this in terminal:
xdg-user-dirs-update
Now let's install autotiling https://aur.archlinux.org/packages/autotiling by running this command:
yay -S autotiling
Add "exec_always --no-startup-id autotiling" to the ~/.config/i3/config file.
At last, let's install PulseAudio by running this command:
sudo pacman -S pulseaudio pulseaudio-alsa pavucontrol
Now reboot your PC and enjoy! You should have memorized how to do this already, it's straight forward and simple.
II. Optional Notes​
Type this in the command in the terminal to check the themes available for rofi:
rofi-theme-selector
For controlling the volume, install this package:
yay -S pnmixer
And then add this at the bottom of your i3 config file:
exec_always pnmixer
Restart your PC
In order to fill your wallpaper fullscreen with Nitrogen, you can do it with this command:
nitrogen --set-zoom-fill /path/to/image.png
That's it! Let me know how it goes with you
I use some of these packages now, like Thunar over Dolphin, myself, in most cases, but still end up going back to Dolphin in certain situations. For one, it handles loading thumbnails better and faster, so browsing images is easier.
Everybody loves xfce4-terminal. Even Arch users!
SerjSX said:
Arch Linux - Lightweight Custom Environment Setup Instructions​
NOTICE: I am not responsible if something happens with your device, proceed at your own risk. It is always recommended to follow Arch's own installation guide, even though these instructions below are from it already just more simplified.​
This article is an alternative to the R method from my minimal Arch Linux instructions which you can find here, so don't do anything from here unless you have Arch Linux already installed either from my instructions or from the wiki! This instructions consists of the following packages for creating the custom environment:
i3: dynamic tiling window manager
LightDM: login page
tint2: bottom bar
rofi: application launcher
xfce4-terminal: lightweight terminal
nitrogen: wallpaper tool
thunar: lightweight file manager
autotiling: better autotiling for the window manager
PulseAudio and pavucontrol: audio manager
This has been tested in VMs and on my main computer.
--
Table of Content:
I. Lightweight Custom Environment Installation
II. Optional Notes
--​
I. Lightweight Custom Environment Installation​
R. Installing the Custom Environment
First let's enable NetworkManager, type this (do this if you came here after following my own Arch Linux installation instructions and you want to continue step R from here, or else connect to your internet in any way you want):
sudo systemctl enable NetworkManager
Reboot by typing "reboot", then after the reboot type "nmtui" and connect to your internet.
Next, update your system by typing:
sudo pacman -Syu
Now let's install these packages: xorg-server, lightdm, i3-gaps and tint2. Type:
Note: you can replace "lightdm-gtk-greeter" with another greeter of your choice, check here: https://wiki.archlinux.org/title/LightDM#Greeter
sudo pacman -S xorg-server lightdm lightdm-gtk-greeter i3-gaps tint2
After the packages are installed, enable lightdm by typing:
sudo systemctl enable lightdm
Now let's setup LightDM, type this in order to edit the config:
sudo nano /etc/lightdm/lightdm.conf
Change the [Seat:*] section, which is this:
...
greeter-session=lightdm-yourgreeter-greeter
...
Instead of "yourgreeter" replace it with the greeter you installed, for example in this case it's "gtk".
Type "reboot" to reboot your system, you should see the login page. Login to i3 (not the one with "(with debug log)", click the arrow and change to "i3") and follow the steps to create config file. After creating the config file, you can continue:
Go to TTY by doing the combination (usually ALT+SHIFT+F2) and run this:
sudo cp /etc/i3/config ~/.config/i3/
Now let's setup tint2 by adding this at the bottom of the i3 config file (run this command to be able to edit the config file: sudo nano $HOME/.config/i3/config):
exec --no-startup-id tint2
Now let's install rofi and xfce4-terminal by running this command:
sudo pacman -S rofi xfce4-terminal
Exit TTY by doing the combination (usually ALT+SHIFT+F1), if you're facing issues just reboot pc.
ALT+Enter (after logging in from the login page) is the combination to open terminal.
Now let's finish setting up rofi, do the combination above to open the terminal and run this command in it:
sudo nano ~/.config/i3/config
Go to the "start dmenu (a program launcher)" section, comment the second line, it should be like this:
# bindsym Mod1+d exec --no-startup-id dmenu_run
the # is commenting the line. And uncomment the third line, which is:
bindsym Mod1+d exec "rofi -modi drun,run -show drun"
the # should be gone
Then save by CTRL+S and close by CTRL+X and reboot your system.
Now we will configure i3 further for tint2, remove the following from the i3 configuration file:
# Start i3bar to display a workspace bar (plus the system information i3 status
# finds out, if available)
bar {
status_command i3status
}
This will be at the bottom of the config file ^ it removes i3bar so only i3 would start.
Then reboot your system by typing "reboot" in the terminal.
After rebooting, when doing the combination ALT+D it opens the application menu.
This step is optional, but it is recommended because it will let you install packages from the AUR (user repisotary). We will also install yay by running these separately:
(Let’s install git in order to install yay afterwards with it)
sudo pacman -S git
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
Install Nitrogen and Thunar to have a wallpaper tool and a file manager by running this command:
sudo pacman -S nitrogen thunar
Check here for more information about Nitrogen and how to use it: https://wiki.archlinux.org/title/nitrogen#Usage
And add this at the bottom of the i3 config file:
exec nitrogen --restore &
Now let's install the user folders (Documents, Pictures...) by installing this package:
sudo pacman -S xdg-user-dirs
Then run this in terminal:
xdg-user-dirs-update
Now let's install autotiling https://aur.archlinux.org/packages/autotiling by running this command:
yay -S autotiling
Add "exec_always --no-startup-id autotiling" to the ~/.config/i3/config file.
At last, let's install PulseAudio by running this command:
sudo pacman -S pulseaudio pulseaudio-alsa pavucontrol
Now reboot your PC and enjoy! You should have memorized how to do this already, it's straight forward and simple.
II. Optional Notes​
Type this in the command in the terminal to check the themes available for rofi:
rofi-theme-selector
For controlling the volume, install this package:
yay -S pnmixer
And then add this at the bottom of your i3 config file:
exec_always pnmixer
Restart your PC
In order to fill your wallpaper fullscreen with Nitrogen, you can do it with this command:
nitrogen --set-zoom-fill /path/to/image.png
That's it! Let me know how it goes with you
Click to expand...
Click to collapse
Hi, what are the keyboard shortcuts for the i3 tiling window manager?
$cronos_ said:
Hi, what are the keyboard shortcuts for the i3 tiling window manager?
Click to expand...
Click to collapse
Hello! Check these out:
i3 - ArchWiki
wiki.archlinux.org
i3 - Reference Card
i3 is a dynamic tiling window manager with clean, readable and documented code, featuring extended Xinerama support, usage of libxcb instead of xlib and several improvements over wmii
i3wm.org

Categories

Resources