欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  移动技术

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

程序员文章站 2022-06-01 20:31:22
jdk android_sdk android_studio genymotion virtualbox搭建安卓开发环境。 (一)jdk安装和配置 (二)android sdk安装和配置 (三)an...

jdk android_sdk android_studio genymotion virtualbox搭建安卓开发环境。

(一)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安装和配置

下载链接:https://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安装和配置

下载链接:https://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安装和配置

下载链接:https://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