Install ADB on Windows & ubuntu 12.04 or 12.10 - Ubuntu Touch Ports to Android

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

Related

[GUIDE] ADB For Beginners (Setup, Use, and More!)

Hello All!
After much frustration with setting up ADB i finally got it working. Everyone said its simple and takes minimal knowledge but when things dont work, nothing really worked. Anyways after 2 hours of research trying to get ADB to work i finally got it all working and wanted to share my knowledge to anyone else that needed help.
This Guide is for windows only. If you are using Mac OS X please go here: ADB For Dummies
If you are using Linux please go here: [HOW-TO]Set up Android SDK/ADB/Fastboot on Ubuntu Linux
Like My Guide(s)? Donate
--------------------------------------------------------------------------
Things you need:
Android SDK - Download
Winrar - Download (32bit) Download (64bit)
Windows PC
USB Cable
A Rooted HTC Dream (Google G1)
--------------------------------------------------------------------------
Setting up the Android SDK
Download the file from above
Unzip to your desktop
Take the "android-sdk-windows" folder and move it to the root of your hard drive (C:\)
Right click on My Computer and click properties
Select the Advanced Tab or Advanced System Setting (Vista/Windows 7)
Select Environment Variables...
Press New
For Variable Name type: adb
For Variable Value type: C:\android-sdk-windows\tools
Now, [Get new sdk (1.5r3) to work]
1. Run SDK Setup.exe
2. If it gives you an error go to settings and click on "Force http//....."
3. Select all options and let it download and install
If you cant get the setup to work, Download the USB-DRIVERS folder - HERE (Windows XP/Vista/Windows 7)
--------------------------------------------------------------------------
Preparing your phone for ADB
Go to Settings on your phone
Select Applications
Select Development
Make sure 'USB Debugging' is checked
--------------------------------------------------------------------------
Installing Drivers
Plug in your phone through USB and DO NOT MOUNT IT!!!!!
Your computer should see a new device and try to install Android 1.0 driver (If it doesnt, scroll down to the "Im not getting a notification of Android ADB when i plug in my USB" section)
Let it load
Once it cant find them select "Install drivers from my pc"
The drivers you need are in the Android SDK 1.5r2 folder (C:\android-sdk-windows\usb_driver)
Depending on your OS pick x86 or amd64
You ADB Android Device should now be installed! Good Job
For Android SDK 1.5r3+
1. Run SDK Setup.exe
2. If it gives you an error go to settings and click on "Force http//....."
3. Select all options and let it download and install
If you cant get the setup to work, Download the USB-DRIVERS folder - HERE (Windows XP/Vista/Windows 7)
--------------------------------------------------------------------------
Check if your phone is detected by ADB
Open up Command Prompt (Go to run, type in cmd, press enter)
Type in
Code:
cd C:\android-sdk-windows\tools === Press Enter
adb devices === You should see your device listed
adb shell === you should see # in the next line
Now you are all set to run adb commands
Note: for a list of commands type in 'adb' in cmd
CONGRATS YOU NOW HAVE ADB FULLY RUNNING!
--------------------------------------------------------------------------
Droid Explorer by Camalot
Droid Explorer is a Windows software that will download, install, and setup the android SDK for you all in under a minute so you are ready to go. I use this on a daily basis. This amazing piece of software has tons of plugins and a built in file explorer for all your files on your phone! All you gotta do is download, install, and go!
Download Droid Explorer - Here
Install the program, and let it setup the SDK files for you
Connect your phone
Enjoy!
--------------------------------------------------------------------------
"Im not getting a notification of Android ADB when i plug in my USB"
Why: Your computer has detected your phone but as a protable device and as a storage device.
Fix: This took me a lot of research and time to figure out so this is what your are going to do.
First download USBDeview - Here
Unzip it
Run USBDeview.exe as Administrator
You will see all drivers being used on your computer
Highlight and Uninstall all drivers with the description have HTC Android (Should be 3 of them)
Right Click on the driver and press uninstall
Once done, Unplug your phone and plug it back in
You should now get the notification of the ADB device
Follow the steps above to install the drivers
--------------------------------------------------------------------------
When Typing just adb in cmd you will get whats called a "usage doc" which gives you a lits of commands that you can use:
Code:
-d - directs command to the only connected USB devic
e
returns an error if more than one USB device is
present.
-e - directs command to the only running emulator.
returns an error if more than one emulator is r
unning.
-s <serial number> - directs command to the USB device or emulator w
ith
the given serial number
-p <product name or path> - simple product name like 'sooner', or
a relative/absolute path to a product
out directory like 'out/target/product/sooner'.
If -p is not specified, the ANDROID_PRODUCT_OUT
environment variable is used, which must
be an absolute path.
devices - list all connected devices
device commands:
adb push <local> <remote> - copy file/dir to device
adb pull <remote> <local> - copy file/dir from device
adb sync [ <directory> ] - copy host->device only if changed
(see 'adb help all')
adb shell - run remote shell interactively
adb shell <command> - run remote shell command
adb emu <command> - run emulator console command
adb logcat [ <filter-spec> ] - View device log
adb jdwp - list PIDs of processes hosting a JDWP transport
adb install [-l] [-r] <file> - push this package file to the device and instal
l it
('-l' means forward-lock the app)
('-r' means reinstall the app, keeping its data
)
adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories
)
adb bugreport - return all information from the device
that should be included in a bug report.
adb help - show this help message
adb version - show version num
scripting:
adb wait-for-device - block until device is online
adb start-server - ensure that there is a server running
adb kill-server - kill the server if it is running
adb get-state - prints: offline | bootloader | device
adb get-serialno - prints: <serial-number>
adb status-window - continuously print device status for a specifie
d device
adb remount - remounts the /system partition on the device re
ad-write
adb root - restarts adb with root permissions
networking:
adb ppp <tty> [parameters] - Run PPP over USB.
Note: you should not automatically start a PDP connection.
<tty> refers to the tty for PPP stream. Eg. dev:/dev/omap_csmi_tty1
[parameters] - Eg. defaultroute debug dump local notty usepeerdns
adb sync notes: adb sync [ <directory> ]
<localdir> can be interpreted in several ways:
- If <directory> is not specified, both /system and /data partitions will be u
pdated.
- If it is "system" or "data", only the corresponding partition
is updated.
--------------------------------------------------------------------------
Commands that you should know
adb push - Insert file to phone such as Stock.apk to /data/app_s
Code:
adb push <pathtofile.apk> <file system location> - Example: adb push c:\app.apk /data/app
adb pull - Remove file from phone such as Stock.apk from /data/app_s
Code:
adb pull <pathtofile.apk> - Example: adb pull /data/app_s/Stock.apk
adb install - Install app to phone
Code:
adb install <path to file> - Example: adb install c:/apps/apps2sd.apk
adb uninstall - Uninstall app from phone
Code:
adb uninstall <name of application> - Example: adb uninstall linda.apk
For more ADB Commands go - Here
--------------------------------------------------------------------------
Thats it for ADB! Congrats and if you have any questions please ask me or if anything is missing or not correct please tell me. I got all of this from research and personal experience.
-------bump------
Good guide, pretty simple... Ill bookmark this, so I can send people that needs help here.
i have attached a zip that has the files i use to get basic use like for doing root to stock to upgrading 2.1-2.2 and other small things.
extract to C:\fastboot
in C:\fastboot you will find a "cmd" batch file. just run it and it should be ready for you to type in adb commands or fastboot. just make sure your in debug mode by doing all in the first post for installing drivers and all that.
U seriously bumped this thread? Lmfao
help?
i was trying adb and i got!
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
K:\>adb devices
List of devices attached
HT07YHL02294 offline
HT07YHL02294 device
K:\>adb remount
error: more than one device and emulator
Click to expand...
Click to collapse
ADB
i have this message Permission Denied what should i do?
thank you D200P13 soo much. i got it working thanks to your files
X10 adb issues
Can't get it to work for my X10.
ADB does not see my X10 when connected, have tried all mentioned above several times, no luck.
USB drivers seem not to install.
Do i need something special for my X10 to connect via ADB ?
p2dewit said:
Can't get it to work for my X10.
ADB does not see my X10 when connected, have tried all mentioned above several times, no luck.
USB drivers seem not to install.
Do i need something special for my X10 to connect via ADB ?
Click to expand...
Click to collapse
Turn telephone i debug mode.
when i type adb it says that it's an unrecognized command.
That's because you haven't navigated to the folder where the adb file is located...
Sent from my Nexus One using XDA App
danger-rat said:
That's because you haven't navigated to the folder where the adb file is located...
Sent from my Nexus One using XDA App
Click to expand...
Click to collapse
Isn't it in the android-sdk-windows folder?
EDIT
nvm found it. it's in another folder....thanks
when i run adb shell, it doesn't give me a # it gives me $. what do i do?
What are you trying to do?
Sent from my Nexus One using XDA App
Trying to flash a rom on my phone (x10) and was making sure adb is working properly before i do anything. When flashing the new rom there's some bugs that require adb to fix. From my understanding "$" means i don't have su access. Thanks for the help btw. Sorry for bothering you. Just taking proper precautions.
EDIT
Sorry again. Found my answer. I forgot to unlock my device to accept superuser permissions. Thanks for your help
to check ur phone is detected by adb....
i type "adb shell" in cmd,and according 2 u i should show #.....but it shows $ to me......why?
To check connection, type "adb devices"
"adb shell" will allow you to work remotely on your device. If the $ doesn't change to #, then you don't have root access.
Sent from my Nexus One using XDA App
If your just trying to set up adb to riot your device, I put this together to make things much easier...
http://www.nexusoneforum.net/forum/...mple-sdk-setup-manual-root-guide-windows.html
Sent from my Nexus One using XDA App
Where is the Mac Specific version. Everything you posted is for windows mate!

How to set up Android SDK in Linux

*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

[ADB 1.0.32][Linux]

Hello there,
I just tried sideloading the 5.01 update on my Nexus 5 only to find that my adb was out of date! Shocking! For some reason it cannot be simply updated by using:
sudo apt-get install android-tools-adb
So I have adapted an old package with the new ADB binary (1.0.32) which can easily update you. Worked for me on Xubuntu 14.04.
Instructions:
1. Unzip the zip
2. Either cd to the directory Android in the extracted package and run ./ADB-Install-Linux.sh or just navigate to the same directory and right click and select "Execute" if your OS so allows.
This is not my work, merely a tutorial to get you up and running on 1.0.32. All credit goes to @kalaker who made this script back in 2012.
Thanks should help me on Ubuntu 14.04
Hmm, in sid
Code:
[email protected]:~$ apt-cache policy android-tools-adb
android-tools-adb:
Installed: 4.2.2+git20130529-5.1
Candidate: 4.2.2+git20130529-5.1
piperx said:
Hmm, in sid
Code:
[email protected]:~$ apt-cache policy android-tools-adb
android-tools-adb:
Installed: 4.2.2+git20130529-5.1
Candidate: 4.2.2+git20130529-5.1
Click to expand...
Click to collapse
Sorry, I don't quite understand, help me out a little here! Was there a quicker way to update?
Is this why I cant see my device after adb devices in terminal ubuntu 14.10?
I can see my device when N5 is on but not when in botloader mode.
this is what I see after that command:
~# apt-cache policy android-tools-adb
android-tools-adb:
Installed: 4.2.2+git20130218-3ubuntu36
Candidate: 4.2.2+git20130218-3ubuntu36
Version table:
*** 4.2.2+git20130218-3ubuntu36 0
500 http://us.archive.ubuntu.com/ubuntu/ utopic/universe amd64 Packages
100 /var/lib/dpkg/status
Ane idea?
hormosapiens said:
I can see my device when N5 is on but not when in botloader mode. Ane idea?
Click to expand...
Click to collapse
Yep. ADB works in recovery or the OS. Fastboot works in bootloader.
hormosapiens said:
Is this why I cant see my device after adb devices in terminal ubuntu 14.10?
I can see my device when N5 is on but not when in botloader mode.
this is what I see after that command:
~# apt-cache policy android-tools-adb
android-tools-adb:
Installed: 4.2.2+git20130218-3ubuntu36
Candidate: 4.2.2+git20130218-3ubuntu36
Version table:
*** 4.2.2+git20130218-3ubuntu36 0
500 http://us.archive.ubuntu.com/ubuntu/ utopic/universe amd64 Packages
100 /var/lib/dpkg/status
Ane idea?
Click to expand...
Click to collapse
Yeah you need fastboot as well. If you run the script that should work for you.
Guynan said:
Hello there,
I just tried sideloading the 5.01 update on my Nexus 5 only to find that my adb was out of date! Shocking! For some reason it cannot be simply updated by using:
sudo apt-get install android-tools-adb
So I have adapted an old package with the new ADB binary (1.0.32) which can easily update you. Worked for me on Xubuntu 14.04.
Instructions:
1. Unzip the zip
2. Either cd to the directory Android in the extracted package and run ./ADB-Install-Linux.sh or just navigate to the same directory and right click and select "Execute" if your OS so allows.
This is not my work, merely a tutorial to get you up and running on 1.0.32. All credit goes to @kalaker who made this script back in 2012.
Click to expand...
Click to collapse
I unziped and run this script.
now on N5 fastbood mode connected to my ubuntu 14.10 after adb devices I get "bash: /usr/bin/adb: Permission denied"
am I missing something?
Thanks
Try running it again, that should work. Were you root? Well you have to be for the script to run to completion. Please try it again?
hormosapiens said:
I unziped and run this script.
now on N5 fastbood mode connected to my ubuntu 14.10 after adb devices I get "bash: /usr/bin/adb: Permission denied"
am I missing something?
Thanks
Click to expand...
Click to collapse
I solved this issue navigating to the folder /usr/bin and then changing the Properties of both adb and fastboot files, in Permissions, check the "Allow to run as a program" (or something like this) box.
I guess it could be set in the script sh file. :good:
Thanks.
Worked after editing permissions in the usr/adb file. Cheers.
Tested on Zorin OS.
isn't working for me.
I was also getting the "permission denied" error after typing "adv version" or "adb devices". I changed the permission of the "adb" file in /usr/bin but after this, I got the error saying "no such file or directory. I'm running Ubuntu 15.04. Any ideas? at least tell me how to revert back to the old thing as I didn't understand "run Uninstall ADB.sh" as written in the README file. thanks in advance.
You are probably on a 64bit OS.
You just need to install some 32bit library:
This should fix your issue:
Code:
sudo apt-get install libc6:i386 libstdc++6:i386

GUIDE: connect OP3 with MTP on Linux (ubuntu)

I got my OP3 today and my laptop, running ElementaryOS (ubuntu based) didn't recognize the OP3 as MTP,
Here is a guide how to fix this, I based this guide on this guide for the OP2.
steps:
Do NOT connect your OP3 to your pc
run the command "lsusb" from your terminal
Connect your OP3 to your pc with original cable
run the command "lsusb" again
You will see a new device, my OP3 is called " Bus 001 Device 012: ID 05c6:900e Qualcomm, Inc. "
You see that it has an ID, in my case "05c6:900e".
the first value is the vendor-id, the second the product-id, you need those so write them down!
so in my case it's :
vendor id: 05c6
product id: 900e
Install the MTP drivers: "sudo apt-get install libmtp-dev mtpfs"
edit the following file with the command: "sudo gedit /lib/udev/rules.d/69-libmtp.rules"
if you don't have gedit installed use the command: "sudo nano /lib/udev/rules.d/69-libmtp.rules"
Add the following line to the file:
Code:
ATTR{idVendor}=="[COLOR="Blue"]vendor-id[/COLOR]", ATTR{idProduct}=="[COLOR="blue"]product-id[/COLOR]", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1", TAG+="uaccess"
make sure you change the blue values to your own values found in the step above.
safe the file
restart the service: "sudo service udev restart"
If you did it correct you will see a popup on your OP3, select "File Transfers (MTP)", select that and now you can transfer files between your OP3 and linux
I don't know if the vendor-id and/or product-id are always the same, if some people can confirm that then I will edit the post.
Hey, I got the same vendor id and product id as you did.
However, even after following the procedure step-by-step, I am unable to transfer files between my OP3 and my laptop running Ubuntu 12.04 LTS.
The OnePlus drivers folder gets loaded as a CD(though I'm connecting the phone using USB) when I change the "Use USB for" setting to "File Transfer(MTP)," and the file named "adb_config_Linux_OSX.sh" doesn't do anything when run in terminal either.
Could you help me out with this?
I run Ubuntu 16.04 and needed to install any drivers. simply connect op and I was able to access it.
Sent from my ONEPLUS A3003 using XDA-Developers mobile app
krankyvampire25 said:
Hey, I got the same vendor id and product id as you did.
However, even after following the procedure step-by-step, I am unable to transfer files between my OP3 and my laptop running Ubuntu 12.04 LTS.
The OnePlus drivers folder gets loaded as a CD(though I'm connecting the phone using USB) when I change the "Use USB for" setting to "File Transfer(MTP)," and the file named "adb_config_Linux_OSX.sh" doesn't do anything when run in terminal either.
Could you help me out with this?
Click to expand...
Click to collapse
update: In "设置" -"其他设置" - "内部设备和USB" - "USB计算机连接", select -- "File Transfers (MTP)", everything is ok.
14.04 can't transfer file. a folder cant write anything(not cd image folder).
hi....... i have a other problem with the same OS (Ubuntu 16.04)
MTP works
fastboot works
ADB DON'T !!!
do you know why ?????
ADB and fastboot are working at the same device with Win 10
OK, thanks, forget it, i found a file named "adb_config_Linux_OSX.sh" on the phone and run it...... now it works
ty, it worked after two reboots and a system update. btw, i have the OP3 soft gold with ID 2a70:f003
cheers!
washichi said:
I got my OP3 today and my laptop, running ElementaryOS (ubuntu based) didn't recognize the OP3 as MTP,
Here is a guide how to fix this, I based this guide on this guide for the OP2.
steps:
Do NOT connect your OP3 to your pc
run the command "lsusb" from your terminal
Connect your OP3 to your pc with original cable
run the command "lsusb" again
You will see a new device, my OP3 is called " Bus 001 Device 012: ID 05c6:900e Qualcomm, Inc. "
You see that it has an ID, in my case "05c6:900e".
the first value is the vendor-id, the second the product-id, you need those so write them down!
so in my case it's :
vendor id: 05c6
product id: 900e
Install the MTP drivers: "sudo apt-get install libmtp-dev mtpfs"
edit the following file with the command: "sudo gedit /lib/udev/rules.d/69-libmtp.rules"
if you don't have gedit installed use the command: "sudo nano /lib/udev/rules.d/69-libmtp.rules"
Add the following line to the file:
Code:
ATTR{idVendor}=="[COLOR="Blue"]vendor-id[/COLOR]", ATTR{idProduct}=="[COLOR="blue"]product-id[/COLOR]", SYMLINK+="libmtp-%k", MODE="660", GROUP="audio", ENV{ID_MTP_DEVICE}="1", ENV{ID_MEDIA_PLAYER}="1", TAG+="uaccess"
make sure you change the blue values to your own values found in the step above.
safe the file
restart the service: "sudo service udev restart"
If you did it correct you will see a popup on your OP3, select "File Transfers (MTP)", select that and now you can transfer files between your OP3 and linux
I don't know if the vendor-id and/or product-id are always the same, if some people can confirm that then I will edit the post.
Click to expand...
Click to collapse
I just now happened upon this forum because my OP3 wasn't connecting for file transfers over USB. This worked like a charm for me; the vendor and product IDs were different (as I'm sure others have commented already), thank you for putting this out there, I definitely hit that 'thanks' button!!!!!!!
It's also possible to use this script (Vendor & Product id can differ).
Code:
#!/bin/sh
# adb configuration script
PATH=$PATH:/bin:/sbin:/usr/sbin
ANDROID_HOME=~/.android
ANDROID_CONFIG=~/.android/adb_usb.ini
CUST_VID="0x2a70"
if [ -e $ANDROID_HOME ] ; then
echo "android home is exist!"
else
echo "creat android home!"
mkdir $ANDROID_HOME
fi
grep $CUST_VID $ANDROID_CONFIG 2>/dev/null
if [ $? -eq 0 ] ; then
echo VID $CUST_VID is already configured..
echo "adb should be OK!"
exit 0
else
echo config adb ...
echo $CUST_VID >> $ANDROID_CONFIG
fi
adb kill-server
if [ $? -eq 0 ] ; then
echo "OK! You can use adb now!"
exit 0
else
echo "try sudo exec adb.."
sudo adb kill-server
if [ $? -eq 0 ] ; then
echo "OK! You can use adb now!"
exit 0
else
echo "Please do command \"adb kill-server\""
fi
fi
exit 0
Useful link: https://wiki.archlinux.org/index.php/android#Android_Debug_Bridge_.28ADB.29
Thanks a lot washichi It worked liked a charm on my OnePlus3T. Thanks a ton

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