Set adb environment variables in Ubuntu

Source: Internet
Author: User
Like Windows, the UbuntuLinux system contains two types of environment variables: System environment variables and user environment variables. System environment variables are valid for all system users. user environment variables are only valid for current users. Except tulinux environment variables user environment variables are usually stored below... like Windows, Ubuntu Linux contains two types of environment variables: System environment variables and user environment variables. System environment variables are valid for all system users. user environment variables are only valid for current users.
Ubuntu Linux environment variables
User Environment variables are usually stored in the following files:
~ /. Profile
~ /. Bash_profile or ~. /Bash_login
~ /. Bashrc
The above files are not recommended in versions earlier than Ubuntu 10.0.
System environment variables are generally stored in the following files:
/Etc/environment
/Etc/profile
/Etc/bash. bashrc
/Etc/profile and/etc/bash. bashrc are not recommended in Ubuntu 10.0.
Priorities of environment variables in Ubuntu Linux
/Etc/profile: the first file used by the operating system to customize the user environment during login. this file sets environment information for each user in the system. when the user logs on for the first time, the file is automatically executed.
/Etc/environment: the second file used by the operating system during logon. before the system reads your own profile, it sets the environment variable of the environment file.
~ /. Bash_profile: The third file used for logon is. profile file. each user can use this file to input shell Information dedicated to their own use. when a user logs on, this file is only executed once! By default, it sets some environment variables to execute the user's. bashrc file. /Etc/bashrc: execute this file for every user running bash shell. When bash shell is opened, the file is read.
~ /. Bashrc: This file contains bash information dedicated to your bash shell. This file is read when you log on and every time you open a new shell.
/Etc/bash. bashrc: script automatically executed when a user enters the shell or desktop system
Priorities of several environment variables: 1> 2> 3
Set adb environment variables in Ubuntu Linux
Current user
Sudo vi. bashrc
Add:
Export PATH = "$ PATH:/home/[username]/android-sdk-linux_86/platform-tools /"
It takes effect after restarting or logging on again. if you want to take effect immediately, run the following command:
Sudo source. bashrc
Global Settings
Sudo vi/etc/profile
Add:
Export PATH = "$ PATH:/home/[username]/android-sdk-linux_86/platform-tools /"
It takes effect after restarting or logging on again. if you want to take effect immediately, run the following command:
Sudo source/etc/profile
System Settings
Sudo vi/etc/enviroment
Add:
Export PATH = "$ PATH:/home/[username]/android-sdk-linux_86/platform-tools /"
It takes effect after restarting or logging on again. if you want to take effect immediately, run the following command:
Sudo source/etc/enviroment



From the wanghao_happy column
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.