ANDROID4 environment operation on CentOS 7 64-bit virtual machine

Source: Internet
Author: User

Scene

Most of today's development is done on Linux virtual machines, and now some work is related to Android, so it's a preliminary attempt to unify the current scenario.

The system is on a 64-bit version of the CentOS 7 virtual machine on the VMware workstaion

Sdk/studio

Http://yun.baidu.com/share/home?uk=67915989&view=share#category/type=0

A mirror in the country, downloadable SDK and studio

Jdk

The openjdk of the CentOS default band needs to be replaced by the Oracle Standard JDK, which is a sample of several versions of the script below

#!/bin/bash

jdk= (jdk1.7.0_25 jdk1.8.0_25 jdk1.7.0_51)

Jdk_tar= (server-jre-7u25-linux-x64.tar.gz jdk-8u25-linux-x64.tar.gz jdk-7u51-linux-x64.gz)

appdir=/home/csbit/

#if [!-S jdk/jdk-7u51-linux-x64.gz]; Then

# ln-s. /.. /.. /.. /.. /ide/share/jdk-7u51-linux-x64.gz jdk/jdk-7u51-linux-x64.gz

#fi

#param: Index of $JDK ' s array

function Instjdk ()

{

#old JDK Version

For j in ${jdk[@]}

Do

If [-d/usr/lib/jvm/$j]; Then

echo "rm Old $j"

sudo rm-r-f/usr/lib/jvm/$j

Fi

Done

sudo rm-f/usr/bin/java

sudo rm-f/usr/bin/javac

# # #update JDK

sudo mkdir-p/USR/LIB/JVM

sudo tar-xzf jdk/${jdk_tar[$1]}-C/USR/LIB/JVM

Echo ' JDK install done '

#ENV

#set binary

sudo update-alternatives--install/usr/bin/java Java/usr/lib/jvm/${jdk[$1]}/bin/java 300

sudo update-alternatives--install/usr/bin/javac Javac/usr/lib/jvm/${jdk[$1]}/bin/javac 300

Echo ' JDK env done '

sudo update-alternatives--set Java/usr/lib/jvm/${jdk[$1]}/bin/java

sudo update-alternatives--set Javac/usr/lib/jvm/${jdk[$1]}/bin/javac

}

INSTJDK 0

When set, the JAVA_HOME environment variable is set

32-bit Package

sudo yum install-y glibc.i686

sudo yum install-y glibc-devel.i686

sudo yum install-y libstdc++.i686

sudo yum install-y zlib.i686

Centos7 still have a problem, running Android Studio will prompt Mksdcard to not run the situation by viewing LDD Mksdcard, missing relevant library files

By looking, you can copy the package libgcc_s.so libstdc++.so to the/USR/LIB/GCC/X86_64-REDHAT-LINUX/4/8.2/32 directory in VMware Tools.

Add/usr/lib/gcc/x86_64-redhat-linux/4/8.2/32 to the/etc/ld.so.conf, execute the ldconfig-v update the library path, and then execute the./mksdcard to work

Run

/studio will be able to build and compile the project, due to the use of gradle to build, so need to copy the environment to other offline machines, the current user needs to copy the. Gradle directory.

~/ANDROID/SDK is the installed SDK

Simulator run

After compiling, the runtime prompts

ANDROID/SDK/TOOLS/EMULATOR-AVD Nexus_5_api_21_x86-netspeed Full-netdelay None
EMULATOR:ERROR:X86 emulation currently requires hardware acceleration!
Ensure KVM is properly installed and usable.
CPU Acceleration STATUS:KVM is not installed on this machine (/DEV/KVM is missing).

Refer to this

Http://www.111cn.net/sys/CentOS/66219.htm

[Email protected] ~]# yum-y install QEMU-KVM libvirt virt-install bridge-utils

[Email protected] ~]# Lsmod | grep KVM # Make sure modules is loaded

KVM 441119 0

[Email protected] ~]# systemctl start LIBVIRTD

[Email protected] ~]# Systemctl enable LIBVIRTD

Note: The management of CENTOS7 service is replaced by Systemctl

Not installed on VMware virtual machines.

By searching for visible issues involving Intel HAXM, the estimate on the virtual machine is not running

By seeing an Android x86 project, the following attempt was made

Android X86

Android X86 is the Android operating system running on the x86 PC and is currently supported for most Android applications. The Android X86 platform was designed by Beyounn and Cwhuang. The main purpose of the project is to provide a complete set of Android system solutions for the X86 platform.

Http://baike.baidu.com/link?url=Uw1vMI5RKZluaaGBajP8zBynMdblupV8BXJQCGI37RO10KaVVLgvQv2OmPqLnu3HGSDrDuJ1W7-w11xYtWYg3K

Http://www.android-x86.org official was wall, can see the address of Chinese http://www.x86android.com/forum-2-1.html

http://www.x86android.com/thread-57744-1-1.html version 4.4 Download

Installation detailed steps for installing ANDROID4 in VMware

Http://wenku.baidu.com/link?url=0ch26cweCjqyNySsWENK0Pn8ukCwhc85pjmbgeZnB6jjbEXxGGnV97ALg1EYs_ j1n8jhprszaqwm0wsglznuhbgutmbeflksdt52linzy7g

Attention:

? When the first boot, the virtual machine's network card is closed, otherwise the wall of the Google site access, into the system desktop

Conclusion

Android can be developed and compiled on a virtual machine, but it needs to be installed in a Windows version of the Android environment or Linux version under a physical machine.

Android x86 is a choice, but it's a little bit more complicated to explore

ANDROID4 environment operation on CentOS 7 64-bit virtual machine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.