• Download the Android Package of Linux from Android Studio,
  • android-studio-bundle-130.737825-linux.tgz  for Linux platform
  • Copy to /usr/locate
  • Unpackage to intall

  • Android-studio's startup script --- "studio.sh"
 #!/bin/sh
#
# ---------------------------------------------------------------------
# Android Studio startup script.
# ---------------------------------------------------------------------
#
message()
{
TITLE="Cannot start Android Studio" //[ -t FD ] 如果文件描述符 FD 打开且指向一个终端则为真。
//[-n string] 如果 string长度非零,则为真 [ -n "$myvar" ] if [ -t ]; then
echo "ERROR: $TITLE\n$1"
elif [ -n `which zenity` ]; then
zenity --error --title="$TITLE" --text="$1"
elif [ -n `which kdialog` ]; then
kdialog --error --title "$TITLE" "$1"
elif [ -n `which xmessage` ]; then
xmessage -center "ERROR: $TITLE: $1"
elif [ -n `which notify-send` ]; then
notify-send "ERROR: $TITLE: $1"
else
echo "ERROR: $TITLE\n$1"
fi
}
UNAME=`which uname`
GREP=`which egrep`
GREP_OPTIONS=""
CUT=`which cut`
READLINK=`which readlink`
MKTEMP=`which mktemp`
RM=`which rm`
CAT=`which cat`
TR=`which tr` #[ -o OPTIONNAME ] 如果 shell选项 “OPTIONNAME” 开启则为真。
#[ -z STRING ] “STRING” 的长度为零则为真。 if [ -z "$UNAME" -o -z "$GREP" -o -z "$CUT" -o -z "$MKTEMP" -o -z "$RM" -o -z "$CAT" -o -z "$TR" ]; then
message "Required tools are missing - check beginning of \"$0\" file for details."
exit
fi OS_TYPE=`"$UNAME" -s` # ---------------------------------------------------------------------
# Locate a JDK installation directory which will be used to run the IDE.
# Try (in order): STUDIO_JDK, JDK_HOME, JAVA_HOME, "java" in PATH.
# --------------------------------------------------------------------- #[ -x FILE ] 如果 FILE 存在且是可执行的则为真。
#[ -a FILE ] 如果 FILE 存在则为真。 if [ -n "$STUDIO_JDK" -a -x "$STUDIO_JDK/bin/java" ]; then
JDK="$STUDIO_JDK"
elif [ -n "$JDK_HOME" -a -x "$JDK_HOME/bin/java" ]; then
JDK="$JDK_HOME"
elif [ -n "$JAVA_HOME" -a -x "$JAVA_HOME/bin/java" ]; then
JDK="$JAVA_HOME"
else
JAVA_BIN_PATH=`which java`
if [ -n "$JAVA_BIN_PATH" ]; then
if [ "$OS_TYPE" = "FreeBSD" ]; then
JAVA_LOCATION=`JAVAVM_DRYRUN=yes java | "$GREP" '^JAVA_HOME' | "$CUT" -c11-`
if [ -x "$JAVA_LOCATION/bin/java" ]; then
JDK="$JAVA_LOCATION"
fi
elif [ "$OS_TYPE" = "SunOS" ]; then
JAVA_LOCATION="/usr/jdk/latest"
if [ -x "$JAVA_LOCATION/bin/java" ]; then
JDK="$JAVA_LOCATION"
fi
elif [ "$OS_TYPE" = "Darwin" ]; then
JAVA_LOCATION=`/usr/libexec/java_home`
if [ -x "$JAVA_LOCATION/bin/java" ]; then
JDK="$JAVA_LOCATION"
fi
fi if [ -z "$JDK" -a -x "$READLINK" ]; then
JAVA_LOCATION=`"$READLINK" -f "$JAVA_BIN_PATH"`
case "$JAVA_LOCATION" in
*/jre/bin/java)
JAVA_LOCATION=`echo "$JAVA_LOCATION" | xargs dirname | xargs dirname | xargs dirname` ;;
*)
JAVA_LOCATION=`echo "$JAVA_LOCATION" | xargs dirname | xargs dirname` ;;
esac
if [ -x "$JAVA_LOCATION/bin/java" ]; then
JDK="$JAVA_LOCATION"
fi
fi
fi
fi #[ -z STRING ] “STRING” 的长度为零则为真。 if [ -z "$JDK" ]; then
message "No JDK found. Please validate either STUDIO_JDK, JDK_HOME or JAVA_HOME environment variable points to valid JDK installation."
exit
fi VERSION_LOG=`"$MKTEMP" -t java.version.log.XXXXXX`
"$JDK/bin/java" -version > "$VERSION_LOG"
"$GREP" 'OpenJDK' "$VERSION_LOG" > /dev/null
OPEN_JDK=$?
"$GREP" "64-Bit|x86_64" "$VERSION_LOG" > /dev/null
BITS=$?
"$RM" -f "$VERSION_LOG"
if [ $OPEN_JDK -eq ]; then
echo "WARNING: You are launching the IDE using OpenJDK Java runtime."
echo
echo " ITS KNOWN TO HAVE PERFORMANCE AND GRAPHICS ISSUES!"
echo " SWITCH TO THE ORACLE(SUN) JDK BEFORE REPORTING PROBLEMS!"
echo
echo "NOTE: If you have both Oracle (Sun) JDK and OpenJDK installed"
echo " please validate either STUDIO_JDK, JDK_HOME, or JAVA_HOME environment variable points to valid Oracle (Sun) JDK installation."
echo " See http://ow.ly/6TuKQ for more info on switching default JDK."
echo
echo "Press Enter to continue."
# ---------------------------------------------------------------------
# COMMENT LINE BELOW TO REMOVE PAUSE AFTER OPEN JDK WARNING
# ---------------------------------------------------------------------
read IGNORE
fi
if [ $BITS -eq ]; then
BITS=""
else
BITS=""
fi # ---------------------------------------------------------------------
# Ensure IDE_HOME points to the directory where the IDE is installed.
# --------------------------------------------------------------------- #[ -L FILE ] 如果 FILE 存在且是一个符号连接则为真。 SCRIPT_LOCATION=$
if [ -x "$READLINK" ]; then
while [ -L "$SCRIPT_LOCATION" ]; do
SCRIPT_LOCATION=`"$READLINK" -e "$SCRIPT_LOCATION"`
done
fi IDE_HOME=`dirname "$SCRIPT_LOCATION"`/..
IDE_BIN_HOME=`dirname "$SCRIPT_LOCATION"` # ---------------------------------------------------------------------
# Collect JVM options and properties.
# ---------------------------------------------------------------------
if [ -n "$STUDIO_PROPERTIES" ]; then
IDE_PROPERTIES_PROPERTY="-Didea.properties.file=\"$STUDIO_PROPERTIES\""
fi MAIN_CLASS_NAME="$STUDIO_MAIN_CLASS_NAME"
if [ -z "$MAIN_CLASS_NAME" ]; then
MAIN_CLASS_NAME="com.intellij.idea.Main"
fi VM_OPTIONS_FILE="$STUDIO_VM_OPTIONS"
if [ -z "$VM_OPTIONS_FILE" ]; then
VM_OPTIONS_FILE="$IDE_BIN_HOME/studio$BITS.vmoptions"
fi if [ -r "$VM_OPTIONS_FILE" ]; then
VM_OPTIONS=`"$CAT" "$VM_OPTIONS_FILE" | "$GREP" -v "^#.*" | "$TR" '\n' ' '`
VM_OPTIONS="$VM_OPTIONS -Djb.vmOptionsFile=\"$VM_OPTIONS_FILE\""
fi IS_EAP="true"
if [ "$IS_EAP" = "true" ]; then
OS_NAME=`echo $OS_TYPE | "$TR" '[:upper:]' '[:lower:]'`
AGENT_LIB="yjpagent-$OS_NAME$BITS"
if [ -r "$IDE_BIN_HOME/lib$AGENT_LIB.so" ]; then
AGENT="-agentlib:$AGENT_LIB=disablej2ee,disablealloc,delay=10000,sessionname=AndroidStudioPreview"
fi
fi COMMON_JVM_ARGS="\"-Xbootclasspath/a:$IDE_HOME/lib/boot.jar\" -Didea.paths.selector=AndroidStudioPreview $IDE_PROPERTIES_PROPERTY"
IDE_JVM_ARGS="-Didea.platform.prefix=AndroidStudio"
ALL_JVM_ARGS="$VM_OPTIONS $COMMON_JVM_ARGS $IDE_JVM_ARGS $AGENT $REQUIRED_JVM_ARGS" CLASSPATH="$IDE_HOME/lib/bootstrap.jar"
CLASSPATH="$CLASSPATH:$IDE_HOME/lib/extensions.jar"
CLASSPATH="$CLASSPATH:$IDE_HOME/lib/util.jar"
CLASSPATH="$CLASSPATH:$IDE_HOME/lib/jdom.jar"
CLASSPATH="$CLASSPATH:$IDE_HOME/lib/log4j.jar"
CLASSPATH="$CLASSPATH:$IDE_HOME/lib/trove4j.jar"
CLASSPATH="$CLASSPATH:$IDE_HOME/lib/jna.jar"
CLASSPATH="$CLASSPATH:$JDK/lib/tools.jar"
if [ -n "$STUDIO_CLASSPATH" ]; then
CLASSPATH="$CLASSPATH:$STUDIO_CLASSPATH"
fi
export CLASSPATH LD_LIBRARY_PATH="$IDE_BIN_HOME:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH # ---------------------------------------------------------------------
# Run the IDE.
# ---------------------------------------------------------------------
while true ; do
eval "$JDK/bin/java" $ALL_JVM_ARGS -Djb.restart.code= $MAIN_CLASS_NAME $*
test $? -ne && break
done
  • Startup android-studio, JDK version is not qualified for studio

  • Need to redownload the latest JDK
  • reintall JDK, studio runs up.

  • On my Linux, (for permission of  network) failed to download gradle from http://services.gradle.org/distributions/gradle-1.6-bin.zip
  • Create a folder and manualy copy the zip file to the folder as following png. After doing so, restart android studio to create a project,the studio will recognize that it has downloaded the gradle.
  • The temporary folder is: /root/.gradle/wrapper/dists/gradle-1.6-bin/72srdo3a5eb3bic159kar72vok/

Linux 下, 安装Android Studio的更多相关文章

  1. Linux下安装Android Studio (Centos 7)

    首先去下载一个android studio的包. http://www.android-studio.org/ (友情一个) http://www.cnblogs.com/gssl/p/4963668 ...

  2. Linux下安装Android Studio(ubuntu)

    一. 安装Android Studio 1. 添加源,按回车键继续 sudo apt-add-repository ppa:paolorotolo/android-studio 2. 更新源 sudo ...

  3. [Android Studio 权威教程]Windows下安装Android Studio

    从AS 0.5版本号開始使用.也是AS的推行者,在ApkBus公布的第一篇Android Studio Perview 2 获得了50K的浏览,1800多条回复下载. 在我的[Android Stud ...

  4. 在Mac OS X下安装Android Studio

    在Mac OS X下安装Android Studio只需要几步. 1. 下载Android Studio安装包(.dmg). 2. 打开Terminal输入java -version命令查看是否已安装 ...

  5. Linux下安装Android的adb驱动-解决不能识别的问题

    Linux下安装Android的adb驱动-解决不能识别的问题 20141011更新:      老方法对我当时使用的一款设备一直都没有出现问题,最后遇到小米手机还有Android4.4版本的系统都会 ...

  6. 【转载】菜鸟Ubuntu下安装Android Studio

    原文:http://forum.android-studio.org/forum.php?mod=viewthread&tid=236&extra=page%3D1%26filter% ...

  7. Ubuntu下安装Android studio【转】

    本文转载自:http://blog.csdn.net/walleit/article/details/65696712 版权声明:本文为博主原创文章,未经博主允许不得转载. 一,软件准备 1. Lin ...

  8. mac 下安装android studio(转)

    1)下载最新jdk8,下载android studio 2)安装jdk8,双击jdk8的安装包,将jdk8的安装包拖到Application,可能会出现这种问题:要求Mac OS X10.7.3或更高 ...

  9. linux下使用Android studio启动模拟器时提示 waiting for target device to come online 的问题

    方法来自:http://stackoverflow.com/questions/42612468/how-can-i-get-more-information-about-waiting-for-ta ...

  10. Linux 下升级Android Studio失败

    在Linux下进行升级的时候,会弹出一个窗口,有一个表格,从表中发现在进行某些更新某些包是没有权限,解决方法很简单,将Android Studio安装文件夹改成当前Linux登陆用户即可. 1.找到A ...

随机推荐

  1. P4213 【模板】杜教筛(Sum)

    \(\color{#0066ff}{题 目 描 述}\) 给定一个正整数\(N(N\le2^{31}-1)\) 求 \(\begin{aligned} ans_1=\sum_{i=1}^n\varph ...

  2. bashrc 与 profile 环境变量

    profile 和 bashrc profile只在登陆的时候使用一次(当我们使用远程登陆上),而bashrc在每次新打开一个bash的时候都会执行(相当于path环境(登陆上了每次打开终端)) pr ...

  3. 设置linux服务器文件夹权限

    最近搞的网站一上传图片,就报500错误.经排查是服务器文件夹权限设置问题. 使用命令: chmod o+rwx avatar 即可改变文件夹权限设置.

  4. [Maven]How do I tell Maven to use the latest version of a dependency?

    Link: http://stackoverflow.com/questions/30571/how-do-i-tell-maven-to-use-the-latest-version-of-a-de ...

  5. form组件之modelForm

    modelForm的使用及参数设置 从modelForm这个名字就能看出来,这个form是和模型类model有知己诶关联的,还是以数和出版社的模型来说明: models.py(模型) from dja ...

  6. Jenkins自动化CI CD流水线之2--用户权限管理

    一. 背景 针对开发.运维.测试针对不同角色进行不同权限划分, 基于插件: Role-based Authorization Strategy来实现. 一. 安装 安装该插件: 系统管理->管理 ...

  7. ZPL JS 调用共享打印机

    <script type="text/javascript"> function printZpl(zpl) {var printWindow = window.ope ...

  8. 3.Servlet(二)

    1.Servlet应用开发接口 对Servlet应用开发接口及功能的掌握,决定了是否能做好Servlet开发工作. GenericServlet抽象类 HttpServlet抽象类 2.Servlet ...

  9. ettercap局域网DNS欺骗实现过程

    转载:https://www.cnblogs.com/hkleak/p/5043063.html 笔记一:ettercap是什么? 我们在对WEB安全检测的时候都会用到Cain和netfuke这两款工 ...

  10. AVplayer搭建ftp共享PC端

    1.安装FTP服务 2.关闭防火墙 3.添加FTP站点 设置ip时,需要查询本机的ip 本机测试 4.iphone安装AVPlayer,并设置