Ubuntu install android studio
1. 安装 openjdk8,并在配置文件 /etc/profile 中,追加如下内容:
sudo aptitude install openjdk-8-jdk
# openjdk env setting by bash export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64 export JRE_HOME=/usr/lib/jvm/java-8-openjdk-amd64/jre export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib/rt.jar:$CLASSPATH export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
2. 解压 android-studio-ide-191.5791312-linux.tar.gz 至 /opt/ 目录下。
资源下载地址 https://developer.android.google.cn/
sudo tar -zxvpf Downloads/android-studio-ide-191.5791312-linux.tar.gz -C /opt/
3. 配置文件 /etc/profile 中,追加如下内容:
# android studio env setting by bash export PATH=/opt/android-studio/bin/:$PATH
4. 启动快捷方式文件 /usr/share/applications/android-studio.desktop
[Desktop Entry] Name = android-studio Comment = android studio Exec = /opt/android-studio/bin/studio.sh Icon = /opt/android-studio/bin/studio.png Terminal = false Type = Application
5. 点击 android-studio 图标,启动程序。
6. 下载SDK和NDK,使用的安装默认路径,并在配置文件 /home/lsgx/.profile 中,追加如下内容:
# android sdk env setting by bash export ANDROID_HOME=$HOME/Android/Sdk export ANDROID_NDK_HOME=$ANDROID_HOME/ndk-bundle export PATH=$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools:$ANDROID_NDK_HOME:$PATH
7. 安装 swig 库
sudo aptitude install build-essential cmake perl libssl-dev swig
8. 配置 AVD Manager
AVD Name: Nexus 5X API 29 X86 AVD Id: Nexus_5X_API_29_X86 Nexus 5X 5.2 1080x1920 420dpi Q Android 10.0 x86 Startup orientation: Portrait Camera Front: Emulated Back: Emulated Network Speed: Full Latency: None Emulated Performance Graphics: Automatic (o) Boot option: Quick boot (o) Multi-Core CPU: 1 Memory and Storage RAM: 1536MB VM heap: 256MB Internal Storage: 800MB SD card: (o) Studio-managed 800MB Device Frame (o) Enable Device Frame Custom skin definition: nexus_5x Keyboard (o) Enable keyboard input
9. android studio 使用NDK和swig编译c++示例
https://blog.csdn.net/qq_16064871/article/details/78420968
====================== End