Build the development environment android2.3/android4.2/12.04/4.1 In ubuntu 4.0 (64-bit)

Source: Internet
Author: User

Build the development environment android2.3/android4.2/12.04/4.1 In ubuntu 4.0 (64-bit)

This article describes how to build an android2.3/android4.2/android4.1/android4.0 compiling environment on Windows 7 through the virtual machines VMware and Ubuntu, including Linux installation and JDK installation, install the samba service and the SSH service. To download the patch, you need network support and must be able to access the Internet. The computer requires a 64-bit CPU, and the win7 operating system is installed.

Step 1: Download the Ubuntu address:
Linux has three versions: Server, desktop, and alternate.
The server version is not installed on the GUI server.
Alternate is suitable for professional and customized installation versions. This version is not recommended for beginners.
Desktop is a customized, silly installation, simple and convenient.

Http://releases.ubuntu.com/12.04/

Or

Http://mirrors.ustc.edu.cn/ubuntu-releases/

Select a 64-bit image:

Ubuntu-12.04-desktop-amd64.iso

Http://releases.ubuntu.com/12.04/ubuntu-12.04-desktop-amd64.iso

Or

Http://mirrors.ustc.edu.cn/ubuntu-releases//precise/ubuntu-12.04-desktop-amd64.iso

(This link is faster to download)


Step 2:

Download and install Ubuntu on Vmware. After the installation is complete, use update manager to update the latest Pach. Create user zhenwx and Samba user zhenwx and password

Install 64-bit ubuntu12.04 in 64-bit win7
1. Install vmware8.0.2

After installing vmware8.0.2, open vmware8.0.2, open the virtual network editor sub-menu in the edit menu, click the vmnet8 sub-item below, the subnet IP under the dialog box is 192.168.128.0, And the subnet mask is 255.255.255.0. if not, change it to this configuration. Click DHCP settings to enter IP settings. In the start IP address dialog box, enter 192.168.128.128. In the end
In the IP address dialog box, enter 192.168.128.129 and click OK to save the IP address. Then, the IP address is fixed to 192.168.128.128 to facilitate mutual access between windows and windows.

Configuration of the VM setting Option

Generally, the memory configuration is half of the physical memory, for example, 4 GB memory. Select 2 GB here. Too much will affect Windows performance.

For I5 processors, select 4 processor and 1 core per processor.

For the t7500 processor, select 2 processor and 1 core per processor.

The configuration here is incorrect, and the CPU cannot make full use of the best performance.

2. Install Ubuntu
Download ubuntu-ubuntu-12.04-desktop-amd64
File --> new Virtual Machine
Menu VM -- setting --> hardware -- CD/DVD --> use ISO image file select ubuntu-12.04-desktop-amd64
Step by step. During installation, enter the host name zhenwx, logon username zhenwx, and logon password. The installation is completed in about two hours.
3. Click dash home in the drop-down menu to open dash home. In the address bar, enter update. In the pop-up menu, update manager ----> install updates to download and install updates.
Download and install the M update package.
To enable terminal, press the shortcut key CTRL + ALT + T.

4. Install samba
Sudo apt-Get install samba-common
Click Ubuntu Software Center, enter Samba in the address bar, select Samba software, and click Install to install Samba,
After Samba is installed, there is a samba icon in the menu. Click the samba setting menu that appears. Samba -- add a Samba share (+) -- create Samba share
Basic -- directory browser -- File System -- home -- zhenwx/home/zhenwx folder shared to zhenwx users and set it to writable visable check)
Access -- "only allow access specific user" checked -- "checked in front of zhenwx
Sudo smbpasswd-A zhenwx
Set a password for the samba user. Otherwise, Windows 7 cannot be accessed.
5. Check the IP address 192.168.241.136 in ifconfig.
6. In the WINDOS address bar \ 192.168.241.136, The zhenwx directory is displayed. The Widows security dialog box is displayed. Enter the samba user name and password.
7. Install SSH
Sudo apt-Get install OpenSSH-server openssh-Client

Connect to Windows 7
Securecrt => quick connect, connect to Ubuntu, enter the Ubuntu ID and pwd
Hostname 192.168.241.136
Username zhenwx
After connection
Welcome to Ubuntu 12.04 lts (GNU/Linux 3.2.0-24-generic x86_64)

* Documentation: https://help.ubuntu.com/

The programs encoded with the Ubuntu system are free software;
The exact distribution terms for each program are described in
Individual files in/usr/share/doc/*/copyright.

Ubuntu comes with absolutely no warranty, to the extent permitted
Applicable law.

Zhenwx @ zhenwx-Virtual-machine :~ $

It indicates that securecrt can be used to log on to ubuntu12.04.
Note:
If SSH is not installed, a message is displayed in securecrt.

The remote system refused the connection.

To set the securecrt to support Chinese characters, select UTF-8 in Options --- session options -- appearance --- character encoding.

By default, the right-click function of securecrt is the paste function, which is different from the style in windows. If you want to change it to the right-click function, you can copy and edit the selected content. Do not tick the paste on right button option in the Options Menu ---- Global Options ------ terminal -------.

8. Install SVN
Sudo apt-Get install Subversion
9. Install JDK
Download JDK in windows and pass it to Ubuntu through samba
CD/usr
Sudo mkdir Java
CD Java
Sudo CP ../home/zhenwx/jdk-6u27-linux-x64.bin.
Sudo chmod 777 jdk-6u27-linux-x64.bin
Run JDK installation.
Sudo./jdk-6u27-linux-x64.bin
Configure Environment Variables
CD/etc
Sudo CP profiel profile-Bak
Sudo chmod 777 Profile
VI etc/profile
Add the following content in front, Press ESC, WQ!
Export java_home =/usr/Java/jdk1.6.0 _ 27
Export jre_home = $ java_home/JRE
Export classpath = $ java_home/lib: $ jre_home/lib: $ classpath
Export Path = $ java_home/bin: $ path: $ jre_home/bin
Check whether JDK is successfully installed.
Zhenwx @ zhenwx-desktop:/etc $ source./Profile
Zhenwx @ zhenwx-desktop:/etc $ Java-version
Java version "1.6.0 _ 27"
Java (TM) se Runtime Environment (build 1.6.0 _ 27-b07)
Java hotspot (TM) 64-bit server VM (build hotspot 2-b06, mixed mode)
Zhenwx @ zhenwx-desktop:/etc $
If the preceding information is displayed, the installation is successful.

10. Install the Toolkit required for Android compilation. This step is critical and must be installed. Otherwise, an inexplicable error will be reported during compilation !!!!!!!!!!!!!!!!
Sudo apt-Get install Git-core GnuPG flex bison gperf build-essential zip curl zlib1g-dev libc6-dev lib32ncurses5-dev ia32-libs x11proto-core-dev libx11-dev lib32readline-gplv2-dev lib32z1-dev gcc-multilib g ++-multilib mingw32 tofrodos
Python-markdown libxml2-utils extends tproc

Note:
A.64-bit system to install gcc-multilib g ++-multilib, 32-bit system does not need to install.
B. For Ubuntu 10.04, you must add additional sources to install Java 5.
Deb http://cn.archive.ubuntu.com/ubuntu/ jaunty multiverse
Deb http://cn.archive.ubuntu.com/ubu ..
If Bison is not installed, an error will be reported during compilation.
Sudo sudo apt-Get install bison
(/Bin/Bash: bison: Command not found)
(/Bin/Bash: prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/ARM-Eabi-GCC: no such file or directory)

The root account in Ubuntu is disabled by default. In this case, if you want to use the root permission to do something, you need the sudo command. If you need to activate the root account in Ubuntu, the process of activating the root account in Ubuntu is as follows:

A. Run
After sudo passwd root command, the system will prompt you to set a new root account password.

B. Click the system-> preferences-> login window menu, switch to the security option page, and select the "Allow local system administrator login" option.

After performing the preceding two steps, you can use the root account to log on to the Ubuntu system. You can use the su command to switch to the root user.

If you want to disable the root account again, you can execute
Sudo passwd-l root lock Root Account

11. In the menu system --> preferences --> monitors, select the displayed resolution of 1280x800.

12. ubuntu12.04 the basic android2.3/android4.0 development environment has been installed successfully.

If you think the host name is inappropriate, you can modify the configuration file. For example, change the host name zhenwx to Android.
Two files to be modified

1. Modify the host name under/etc/hostname; change the zhenwx string to Android

2. Modify the/etc/hosts file and replace the original host name. I replaced the host name after 127.0.1.1,

Change the zhenwx string to Android
3. Use hostname for testing


Step 3:

Create a bin directory under your working directory or a folder/

Make sure that you have installed git JDK Python and so on.


1. Create the bin directory and add it to the path

$ Mkdir ~ /Bin
$ Path = ~ /Bin: $ path

2. Download the repo to the bin directory just created, and set the permission to executable.

$ Curl https://dl-ssl.google.com/dl/googlesource/git-repo/repo> ~ /Bin/Repo
$ Chmod A + x ~ /Bin/Repo

3. Create a directory for storing Android source code and enter the directory.

$ Mkdir Android-4.0.0_r1

$ Android-4.0.0_r1 CD

4. initialize the GIT library of android4.0.1

$ Repo init-u https://android.googlesource.com/platform/manifest-B android-4.0.1_r1

Enter your username and email address with a Google account.


5. Start synchronous download.

$ Repo sync


Finally, compile.

Step 1:

In the folder where the code is stored (Android-4.0.0_r1), execute:

$ Source build/envsetup. Sh

Build is a folder in the source code directory.


Step 2:

Run:

$ Lunch full-Eng


Step 3:

$ Make-J4

Wait until the compilation is complete.


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.