WELCOME TO EHOST.COM.NP

Sunday, August 27, 2017

How to Use ADB or Fastboot From Any Directory on your Windows/Linux PC

ads space

If you’ve followed our tutorial on how to setup the adb and fastboot platform tools on your computer, it might be annoying to have to navigate to the folder every time, especially if you use either tool quite frequently. Having to copy files to the platform tools folder is also annoying whenever you want to flash stuff on your device. For me it’s frustrating as I use an SSD and I dislike having to copy my files to my platform tools folder, and then delete them after. However, it’s possible to run the adb or fastboot tools from any directory on your Windows or Linux PC so you’ll never have to change directories to run any commands.


What is the PATH system variable?

PATH is used by Windows to specify the location of important executables. Usually, these are files located in the system directories, such as C:\Windows and C:\Windows\system32. This is why you can type “calc” in the command prompt to launch calculator, but not “chrome” to launch Google Chrome. This variable is sometimes changed by applications when you install them, such as Java. Java adds itself to the PATH variable on installation, meaning you can use Java from any directory. This is useful to people using Java applications so the program does not have to attempt to hard code the Java location.

We will be modifying the PATH system variable to allow us to use adb or Fastboot anywhere on our Windows computer. PATH also exists on Linux and usually contains the bin and sbin directories. I will cover how to add the platform tools to the Linux PATH variable too.

Note: Both tutorials require administrator/sudo access. Adding to Windows has two methods. I strongly suggest the first, but both work fine and the second is better if you plan to use the PATH variable a lot.

Adding adb and Fastboot to the Windows PATH (Method 1)

This isn’t really adding it to the Windows PATH variable per se, but more adding it to a folder that is already in the PATH variable. Simply copy your adb.exe and your fastboot.exe to C:\Windows and you’re good to go. You should be able to run adb and fastboot from the command line now. This is by far the easiest, most fool proof method for setting this up. If for whatever reason it doesn’t work, follow method 2.

Adding adb and Fastboot to the Windows PATH (Method 2)

Step 1

Open Windows Explorer and right click “My PC”. Select “Properties” and you will be greeted with a screen showing some system information.

Step 2

Select “Advanced System Settings”.

Step 3

Select “Environment Variables”

Step 4

Look for the variable named “Path” and double click it.

Step 5

Click “Browse” and navigate to the folder where you extracted your adb files. Next “okay” out of all of the Windows you have open. Start a new PowerShell or command prompt and type “adb” to verify the location has been added. If not, reboot your PC and try again.


Adding adb and Fastboot to the Linux PATH

I will be using Ubuntu for this tutorial, via command line only. You can edit the .bashrc file via the GUI, but you will need to navigate to the root of your home directory and press Ctrl+H. Make sure you have the platform-tools downloaded and extracted.

Step 1

Note the path of the adb tools you extracted. For me, I extracted them to /home/adam/adb/platform-tools.

Step 2

You’ll need to edit your .bashrc file. Go back to your home directory and run the following command.


sudo nano .bashrc

If you prefer to use vi or gedit you can instead.

Step 3

Add the following line to the end of the .bashrc file. Be careful editing this file, do not add anything else or change anything else.


export PATH=${PATH}:/home/YOUR-USERNAME/path/to/adb

And type


adb

to check if it works. If it gives you an error (usually on 64-bit computers), install the packages glibc.i686 and libstdc++ and it should work.


Done!

You are now done, you should now be able to simply execute the adb or fastboot commands from anywhere on your Windows or Linux computer. As I said, this is incredibly useful and also allows for better organization so that you don’t need to put all of your flashable files in the same folders.

ads space
ADS SPACE

0 comments:

Post a Comment

Categories

Article How-to All Posts WordPress Android Web design Blogger Plugins CSS Google JQuery Plugins Programming Reviews Web Hosting Blogger Blogging Blogging Tips Tricks Web Development Facebook Git Internet Make Money Online Social Plugins Tips Tips and Tricks Tools Tutorials Windows WordPress Plugins Blogging Tips and Tricks Freebies GSM Google Analytics HTML How To's JavaScript Plugin Development S.E.O SEO SMS SmartPhone Social Media Tips amp; Tricks Top-Most Updates Webmaster Tools Whatsapp Applications Apps Blogger Basics Documentary Downloads Entertainment Gadgets Games Gmail Google AdSense Guest Post IPhone Make Money Blogging SVN Security Softwares Web Hosting Tips and Tricks Wordpress Tips Wordpress Tips and Tricks hostgator iOS Advertising Networks Advertising Technology Affiliates Antivirus Audience amp; Traffic Biography Blog post Blog post Blogger Blogger Errors Blogger Tips Blogger Tools Blogger Widget Blogosphere Bogger Widgets CSS selectors CSS symbols CSS3 Computer amp; Internet Content Writing Coupon Codes Data amp; Analytics Deleted blog Design DoubleClick for Publishers Email and newsletter marketting Email marketing Excel Tips Excel Tips and Tricks Facebook Tricks Feed Feedburner Feedburner subscribers Font Fun GitHub Giveaways Gmail primary inbox Gmail tabs Google sign-in Guides HTML amp; CSS HTML5 Infographics Inspirational Instagram Internet Marketing Internet Tips amp; Tricks Job Listings Knowledge Life Hacks Lists Make-Money Monetization amp; Conversion Monetize Navigation Online Marketing Other PHP Tutorials Passport Publishing amp; Content Quotes RSS Sidebar Smartphones Social Networking Status Tech Tech Blog Technology Telegram Themes UI / UX User Psychology amp; Research VB.Net Web Tools Web browser Widget Windows Tips Windows-10 ad viewability admin notice blogging tools bluehost cherry-pick clone cors custom scrollbar customizer dismissible notices duplicate post feed title git branch git clone gpg gpg2 hybridauth iPad icon font notice responsive wordpress theme same origin policy scrollbar signed git commit smartsvn theme customizer vcs wordpress theme wordpress themes

Blog Archive