Cara Menggunakan ADB atau Fastboot Dari Direktori apapun di PC Windows / Linux Anda

Jika Anda telah mengikuti tutorial tentang cara menyiapkan tool adb dan fastboot di komputer Anda, mungkin akan mengganggu untuk menavigasi ke folder setiap saat, terutama jika Anda sering menggunakan.

Setelah menyalin file ke folder tool adb juga menyebalkan kapan pun Anda ingin flash stuff pada perangkat Anda. Bagi saya itu membuat frustrasi karena saya menggunakan SSD dan saya tidak suka menyalin file saya ke folder tool adb saya, dan kemudian menghapusnya setelah itu. Namun, mungkin untuk menjalankan tool adb atau fastboot dari direktori mana pun di PC Windows atau Linux Anda sehingga Anda tidak perlu mengubah direktori untuk menjalankan perintah apa pun.

Apa Yang Dimaksud variabel sistem PATH?

PATH digunakan oleh Windows untuk menentukan lokasi executable penting. Biasanya, ini adalah file yang berada di direktori sistem, seperti C: \ Windows dan C: \ Windows \ system32. Inilah sebabnya mengapa Anda bisa mengetik “calc” di command prompt untuk meluncurkan kalkulator, tapi tidak “chrome” untuk meluncurkan Google Chrome. Variabel ini terkadang diubah oleh aplikasi saat Anda menginstalnya, seperti Java. Java menambahkan dirinya pada variabel PATH pada instalasi, yang berarti Anda dapat menggunakan Java dari direktori manapun. Hal ini berguna untuk orang yang menggunakan aplikasi Java sehingga program tidak harus berusaha keras untuk mengode lokasi Java.

Kami akan memodifikasi variabel sistem PATH agar kami dapat menggunakan adb atau Fastboot di manapun di komputer Windows kami. PATH juga ada di Linux dan biasanya berisi direktori bin dan sbin. Saya akan membahas cara menambahkan alat platform ke variabel PATH Linux juga.

Catatan: Kedua tutorial membutuhkan akses administrator / sudo.

Read:  5 Cara Masuk Mode Download ( Edl Mode ) All Xiaomi

Menambahkan ke Windows memiliki dua metode. Saya sangat menyarankan yang pertama, tapi keduanya bekerja dengan baik dan yang kedua lebih baik jika Anda berencana untuk menggunakan variabel PATH.

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.

Please ensure before you click “Browse” that no field is highlighted. If a field is highlighted you will end up replacing it. Click somewhere in the list that doesn’t contain an entry to ensure that you do not replace a field.

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.

You May Also Like