JDK Android_SDK Android_Studio Genymotion VirtualBox搭建安卓开发环境

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zlf19910726/article/details/79953710




(一)JDK安装和配置
(二)Android SDK安装和配置
(三)Android Studio安装和配置
(四)genymotion安装和配置
(五)virtualbox安装和配置

#####################################################
在/hime/Softwares下新建Android_SDK  Android_Studio  Genymotion  JDK  VirtualBox文件夹
[xhh@localhost ~]$ su
Password:
[root@localhost xhh]# pwd
/home/xhh
[root@localhost xhh]# cd /home
[root@localhost home]# dir
xhh
[root@localhost home]# mkdir Softwares
[root@localhost home]# cd Softwares
[root@localhost Softwares]# mkdir JDK Android_SDK Android_Studio Genymotion VirtualBox
[root@localhost Softwares]# dir
Android_SDK  Android_Studio  Genymotion  JDK  VirtualBox
[root@localhost Softwares]#

#####################################################
[xhh@localhost Downloads]$ su
Password:
[root@localhost Downloads]# dir
android-sdk_r24.4.1-linux.tgz
android-studio-ide-171.4443003-linux.zip
genymotion-2.12.0-linux_x64.bin
jdk-8u161-linux-x64.tar.gz
VirtualBox-5.1-5.1.30_118389_el7-1.x86_64.rpm
[root@localhost Downloads]# mv jdk-8u161-linux-x64.tar.gz /home/Softwares/JDK
[root@localhost Downloads]# mv android-sdk_r24.4.1-linux.tgz /home/Softwares/Android_SDK
[root@localhost Downloads]# mv android-studio-ide-171.4443003-linux.zip /home/Softwares/Android_Studio
[root@localhost Downloads]# mv genymotion-2.12.0-linux_x64.bin /home/Softwares/Genymotion
[root@localhost Downloads]# mv VirtualBox-5.1-5.1.30_118389_el7-1.x86_64.rpm /home/Softwares/VirtualBox

#####################################################
#####################################################
(一)JDK安装和配置
下载链接:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html

[root@localhost Softwares]# cd JDK
[root@localhost JDK]# dir
jdk-8u161-linux-x64.tar.gz
[root@localhost JDK]# tar -xzvf jdk-8u161-linux-x64.tar.gz
[root@localhost JDK]# dir
jdk1.8.0_161  jdk-8u161-linux-x64.tar.gz
[root@localhost JDK]# cd jdk1.8.0_161
[root@localhost jdk1.8.0_161]# dir
bin       db        javafx-src.zip  lib      man      release  THIRDPARTYLICENSEREADME-JAVAFX.txt
COPYRIGHT  include  jre            LICENSE  README.html  src.zip  THIRDPARTYLICENSEREADME.txt
[root@localhost jdk1.8.0_161]# cd lib
[root@localhost lib]# dir
amd64        ct.sym    ir.idl           jconsole.jar  missioncontrol  packager.jar  tools.jar
ant-javafx.jar    dt.jar    javafx-mx.jar  jexec         orb.idl         sa-jdi.jar    visualvm
[root@localhost lib]# vim /etc/profile

export JAVA_HOME=/home/Softwares/JDK/jdk1.8.0_161
export PATH=$PATH:$JAVA_HOME/bin
export CLASSPATH=$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar

[root@localhost lib]# source /etc/profile
[root@localhost lib]# java -version
openjdk version "1.8.0_131"
OpenJDK Runtime Environment (build 1.8.0_131-b12)
OpenJDK 64-Bit Server VM (build 25.131-b12, mixed mode)
[root@localhost lib]#

#####################################################
(二)Android SDK安装和配置
下载链接:http://tools.android-studio.org/index.php/sdk
[xhh@localhost Android_SDK]$ dir
android-sdk_r24.4.1-linux.tgz
[xhh@localhost Android_SDK]$ su
Password:
[root@localhost Android_SDK]# tar -xvf android-sdk_r24.4.1-linux.tgz
[root@localhost Android_SDK]# dir
android-sdk-linux  android-sdk_r24.4.1-linux.tgz
[root@localhost Android_SDK]# cd android-sdk-linux
[root@localhost android-sdk-linux]# dir
add-ons  platforms  SDK\ Readme.txt  tools
[root@localhost android-sdk-linux]# cd tools
[root@localhost tools]# dir
android  ddms          emulator64-ranchu-arm64   emulator-ranchu-arm64   lib       monkeyrunner  source.properties
ant     draw9patch      emulator64-ranchu-mips64  emulator-ranchu-mips64  lib64     NOTICE.txt    support
apps     emulator      emulator64-x86        emulator-x86        lint      proguard        templates
bin     emulator64-arm   emulator-arm            hierarchyviewer        mksdcard  qemu        traceview
bin64     emulator64-mips  emulator-mips            jobb            monitor   screenshot2   uiautomatorviewer
[root@localhost tools]# ./android
在android sdk manager中载Tools、API Extras等

[root@localhost tools]# vim /etc/profile

export ANDROID_HOME=/home/Softwares/Android_SDK/android-sdk-linux
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools

[root@localhost tools]# source /etc/profile

#####################################################
(三)Android Studio安装和配置
下载链接:http://www.android-studio.org/

[root@localhost Android_Studio]# dir
android-studio-ide-171.4443003-linux.zip
[root@localhost Android_Studio]# unzip android-studio-ide-171.4443003-linux.zip
[root@localhost Android_Studio]# dir
android-studio    android-studio-ide-171.4443003-linux.zip
[root@localhost Android_Studio]# cd android-studio
[root@localhost android-studio]# dir
bin  build.txt    gradle    Install-Linux-tar.txt  jre  lib  license  LICENSE.txt  NOTICE.txt  plugins
[root@localhost android-studio]# cd bin
[root@localhost bin]# dir
appletviewer.policy  fsnotifier    idea.properties  lldb     printenv.py  studio64.vmoptions  studio.sh
format.sh         fsnotifier64  inspect.sh        log.xml  restart.py   studio.png          studio.vmoptions
[root@localhost bin]# ./studio.sh

#####################################################
(四)genymotion安装和配置
下载链接:https://www.genymotion.com/download/

[xhh@localhost Genymotion]$ su
Password:
[root@localhost Genymotion]# dir
genymotion-2.12.0-linux_x64.bin
[root@localhost Genymotion]# ./genymotion-2.12.0-linux_x64.bin
bash: ./genymotion-2.12.0-linux_x64.bin: Permission denied
[root@localhost Genymotion]# chmod +X genymotion-2.12.0-linux_x64.bin
[root@localhost Genymotion]# ./genymotion-2.12.0-linux_x64.bin
bash: ./genymotion-2.12.0-linux_x64.bin: Permission denied
[root@localhost Genymotion]# bash ./genymotion-2.12.0-linux_x64.bin
Installing for all users.

Installing to folder [/opt/genymobile/genymotion]. Are you sure [y/n] ? y


- Trying to find VirtualBox toolset .................... WARNING (Virtualbox was not found in you PATH. Please install it manually)
- Extracting files ..................................... OK (Extract into: [/opt/genymobile/genymotion])
- Installing launcher icon ............................. OK

Installation done successfully.

You can now use these tools from [/opt/genymobile/genymotion]:
 - genymotion
 - genymotion-shell
 - gmtool

[root@localhost Genymotion]#

#####################################################
(五)virtualbox安装和配置
下载链接:https://www.virtualbox.org/wiki/Download_Old_Builds_5_1

[xhh@localhost VirtualBox]$ su
Password:
[root@localhost VirtualBox]# dir
VirtualBox-5.1-5.1.30_118389_el7-1.x86_64.rpm
[root@localhost VirtualBox]# rpm -ivh VirtualBox-5.1-5.1.30_118389_el7-1.x86_64.rpm
warning: VirtualBox-5.1-5.1.30_118389_el7-1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 98ab5139: NOKEY
error: Failed dependencies:
    libSDL-1.2.so.0()(64bit) is needed by VirtualBox-5.1-5.1.30_118389_el7-1.x86_64

[root@localhost VirtualBox]# yum search libSDL
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: mirrors.cn99.com
 * extras: mirrors.aliyun.com
 * updates: mirrors.163.com
====================================================== Matched: libSDL =======================================================
SDL.i686 : A cross-platform multimedia library
SDL.x86_64 : A cross-platform multimedia library
SDL-devel.i686 : Files needed to develop Simple DirectMedia Layer applications
SDL-devel.x86_64 : Files needed to develop Simple DirectMedia Layer applications
SDL-static.i686 : Files needed to develop static Simple DirectMedia Layer applications
SDL-static.x86_64 : Files needed to develop static Simple DirectMedia Layer applications

[root@localhost VirtualBox]# yum install SDL-devel.x86_64
[root@localhost VirtualBox]# rpm -ivh VirtualBox-5.1-5.1.30_118389_el7-1.x86_64.rpm
warning: VirtualBox-5.1-5.1.30_118389_el7-1.x86_64.rpm: Header V4 DSA/SHA1 Signature, key ID 98ab5139: NOKEY
Preparing...                          ################################# [100%]
Updating / installing...
   1:VirtualBox-5.1-5.1.30_118389_el7-################################# [100%]

Creating group 'vboxusers'. VM users must be member of that group!


vboxdrv.sh: failed: Look at /var/log/vbox-install.log to find out what went wrong.
This system is not currently set up to build kernel modules (system extensions).
Running the following commands should set the system up correctly:

  yum install gcc make
  yum install kernel-devel-3.10.0-693.el7.x86_64
(The last command may fail if your system is not fully updated.)
  yum install kernel-devel

There were problems setting up VirtualBox.  To re-start the set-up process, run
  /sbin/vboxconfig
as root.
[root@localhost VirtualBox]# yum install gcc make
[root@localhost VirtualBox]# yum install kernel-devel-3.10.0-693.el7.x86_64

[root@localhost VirtualBox]# /sbin/vboxconfig
vboxdrv.sh: Stopping VirtualBox services.
vboxdrv.sh: Building VirtualBox kernel modules.
vboxdrv.sh: Starting VirtualBox services.
[root@localhost VirtualBox]# locate VirtualBox
[root@localhost VirtualBox]# find / -name VirtualBox
/home/Softwares/VirtualBox
find: ‘/run/user/1000/gvfs’: Permission denied
/usr/bin/VirtualBox
/usr/lib/virtualbox/VirtualBox
^Z
[1]+  Stopped                 find / -name VirtualBox
[root@localhost VirtualBox]# cd /usr/bin
[root@localhost bin]# ./VirtualBox














阅读更多
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页