• 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. Leetcode 91. Decode Ways 解码方法(动态规划,字符串处理)

    Leetcode 91. Decode Ways 解码方法(动态规划,字符串处理) 题目描述 一条报文包含字母A-Z,使用下面的字母-数字映射进行解码 'A' -> 1 'B' -> 2 ...

  2. kuangbin专题十六 KMP&&扩展KMP POJ2406 Power Strings

    Given two strings a and b we define a*b to be their concatenation. For example, if a = "abc&quo ...

  3. nginx 安装第三方 模块

    查看nginx在安装时开启了哪些模块 如果你nginx是rpm包安装的,直接用如下命令nginx -V 如果你是源码包编译安装,假如你的安装路径是/usr/local/nginx,那么你可以使用: / ...

  4. python 文件与异常

    ####文件### r: -只能读 不能写 -读取文件不存在,是会报错 r+: - 可以执行读写操作; - 文件不存在, 报错: w: -只能写,不能读 -会清空文件内容 -文件不存在,会新建文件 w ...

  5. hive 全表全字段对比

    select * from ( select max(t1.source) as source ,t1.c1 ,t1.c2 ,t1.c3 ,count(*) as cnt from ( as sour ...

  6. C# 利用ITextSharp导出PDF文件

    最近项目中需要导出PDF文件,最后上网搜索了一下,发现ITextSharp比较好用,所以做了一个例子: public string ExportPDF() { //ITextSharp Usage / ...

  7. 为什么 c++中函数模板和类模板的 声明与定义需要放到一起?

    将模板的声明与定义写在一起实在很不优雅.尝试用“传统”方法,及在.h文件里声明,在.cpp文件里定义, 然后在main函数里包含.h头文件,这样会报链接错误.why!!!!!!!!!!!!! 这是因为 ...

  8. android Firebase中配置 Crashlytics

    首先登陆Google账号 https://firebase.google.com/ 创建项目 配置Android 1.注册应用 2.下载配置文件 3.添加firebaseSDk 配置后台分析的Cras ...

  9. Ranking relevance in yahoo search (2016)论文阅读

    文章链接 https://www.kdd.org/kdd2016/papers/files/adf0361-yinA.pdf abstract 点击特征在长尾query上的稀疏性问题 基础相关性三大技 ...

  10. 登陆jq表单验证及jqcookie记住密码实例

    <p><%@ page contentType="text/html; charset=utf-8"%> <%@taglib prefix=" ...