x625802392 发表于 2017-7-7 18:31:25

MAC 上找不到.bash_profile或者ect/profile该怎么办?





  开发Android的环境要重新在Mac上搭建,结果在配置环境变量时找不到.bash_profile文件。查过很多资料解决方案都很笼统,结果还是在英文网站上找到解决方法。
  1. 启动终端Terminal
  2. 进入当前用户的home目录
  输入cd ~
  3. 创建.bash_profile
  输入touch .bash_profile
  4. 编辑.bash_profile文件
  输入open -e .bash_profile
  因为是为了搭建Android开发环境,输入Android SDK下的tools目录:export PATH=${PATH}:/eclipse/android_sdk/tools
  5. 保存文件,关闭.bash_profile
  6. 更新刚配置的环境变量
  输入source .bash_profile
  7. 验证配置是否成功
  输入android启动Android SDK and AVD Manager
  8.ect/profile文件如何编辑? 在terminal终端中输入vi ect/profile 然后就可以在前往文件夹中写路径找到文件
页: [1]
查看完整版本: MAC 上找不到.bash_profile或者ect/profile该怎么办?