【问题标题】:How can I open Android Studio from any directory in Ubuntu?如何从 Ubuntu 中的任何目录打开 Android Studio?
【发布时间】:2021-05-30 18:57:10
【问题描述】:

此指令已列出:

[可选] 将“{installation home}/bin”添加到您的 PATH 环境变量中,以便您可以从任何目录启动 Android Studio。

所以我做了以下步骤:

第一次打开的.profile

gedit ~/.profile

编辑了这一行:

if [ -d "$HOME/bin" ] ; then
    PATH="$HOME/bin:$PATH:/home/username/android-studio/bin/"
fi

之后我在主目录中输入了这个:

studio.sh    //didn't work

再次,

./studio.sh  //still not working

请帮帮我。谢谢!

【问题讨论】:

  • 你的用户名是username,还是你为stackoverflow混淆了这个? /home/username/android-studio/bin/studio.sh 有效吗?
  • 试试export PATH=/home/<uername>/path/to/android-studio/bin:$PATH
  • @Michiel 混淆:D
  • @GayanWeerakutti # set PATH so it includes user's private bin if it exists if [ -d "$HOME/bin" ] ; then # PATH="$HOME/bin:$PATH:/home/scarface/android-studio/bin/" export PATH="$HOME:/home/scarface/android-studio/bin:$PATH" fi 我是新来的。请帮帮我!

标签: android linux android-studio ubuntu


【解决方案1】:

这是人们面临的一个非常普遍的问题。 仅编辑您的 .bashrc.profile 将不起作用。 您要么必须重新启动,要么重新获取您的 .bashrc.profile 文件。 (在您的情况下,.profile 文件)。为此,请运行以下命令:-

source ~/.profile

所以编辑你的.profile 文件,就像你对你的问题所做的那样,然后这样做。之后,您应该可以通过studio.sh在任何地方启动

【讨论】:

  • alias android-studio='/home/username/android-studio/bin/studio.sh 怎么样?
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2022-06-30
  • 2013-05-05
  • 1970-01-01
  • 1970-01-01
  • 2015-04-28
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多