Stand-alone Android development Environment (II)

Source: Internet
Author: User

The previous article describes how to optimize SSD and memory to maximize the performance of the development host, while also mentioning the creation of virtual machines on SSDs. Why not install a dual system? Dual system performance should be better! The use of windows+ virtual machine, mainly considering the Android Development and daily office two aspects, Ubuntu office is really not accustomed to, and Ubuntu installed in the virtual machine migration is also very convenient. As mentioned earlier, the original laptop is not equipped with an SSD, the virtual machine is created on the HDD, after the replacement of the SSD, the virtual machine files directly copied to the SSD, with a short time to complete the migration, if the dual system will have to reinstall Ubuntu and development tools. Virtual machine Software recommends the use of VMware Workstation Pro, proven that its performance is good enough, feel that the only drawback is disk performance, but the difference is not very obvious, CPU and memory performance should not lose much. Lao Deng's first installation of the dual system, look at the document code, burning and daily office are very inconvenient, and later switched to windows+ virtual machine way. He did a careful comparison, compiling the Android system in a virtual machine is only a bit slower than a dual system. If you are modifying the code of the Linux underlying driver section, compiling and generating the firmware in the virtual machine will probably only take about 5 minutes, and in the case of a dual system it would be about 4 minutes. Compilation is a little bit slower, but the productivity has improved a lot, worth it!

Ubuntu version selection is also stable and reliable, not necessarily with the new version, MTK official recommendation is 12.04 64-bit version, then use this version good. The practice proves that RK3188 's Android4.4 and MT8735 's Android5.1 compilation are no problem. Ubuntu version is critical, we initially built a development environment on the server encountered n problems, such as Git super slow, do not support disk array RAID5, must use CD-ROM installation and so on, now say like 421 light, at that time can feel a heavy weight, a step a pit. "The only source of knowledge is experience", it is classic brilliantly! Ubuntu version It's all right, and it's recommended to use 12.04 64-bit server versions.

VMware is powerful and supports the automatic installation of Ubuntu, but it is best to manually install it, and you can customize the size of the swap partition and the root partition. Swap partition best still have, if the physical memory is very big, can do less, I divide 4GB to it. Old Deng SSD, no swap partition, generally no problem, only occasionally compiled Android system will be wrong, and then add a root 8GB memory bar is good.

After installing Ubuntu on the virtual machine, first configure the network, it is recommended to use NAT mode + static IP, better than bridge mode, no dependence on the network environment, set static IP to facilitate host access. I used the first bridge mode, often out of condition, not too stable. Later Gyp said you can use NAT mode, sure enough, after using NAT, network connectivity has never had a problem. Experience Ah!

The preparation is basically done, followed by dry goods. It is necessary to note that these methods and procedures are summary of experience, not necessarily universally applicable, for informational purposes only. This explanation itself is actually also experience, because I see a lot of other people write articles are no problem, but their own operation but not, later found that because of Linux and Android version, change fast, the environment is complex and changeable, so there is no absolutely correct universal solution, but can learn from its ideas. So the following, I can only guarantee as correct as possible, if there is discomfort, please point out.

1. Install SSH

View SSH Services

Ps-e | grep ssh

If there is only one service ssh-agent and no sshd service, execute the following two lines of command

sudo apt-get update

sudo apt-get install SSH

Added sshd service after installation

Verifying the SSH service

SSH [email protected]

Exit Login

Exit

At this point, you can telnet to Ubuntu via Xshell.

Xshell is a very intimate and useful tool software, Android development must!

All subsequent operations are performed in the Xshell, and VMware minimization is put aside.

2.sudo no password execution, remove sudo input password

 Execute command

 sudo visudo

 The end of the file is added as

 HJB all= (All) Nopasswd:all

 Description: You need to replace HJB with a specific user name

 Ctrl-o Save

 Ctrl-x exit

At this point, there is no need to enter a password to execute sudo.

3. Install Vim

 sudo apt-get install-y vim

 Vim is very simple and powerful, shortcut key usage Please refer to the programmer's vim quick Check Card

4. Install Samba and configure

 sudo apt-get install-y Samba Samba-common

Set a password for Samba users

sudo smbpasswd-a HJB

Description: If you do not set a password, you can only view the directory, cannot write to the file

Edit a Samba configuration file/etc/samba/smb.conf

sudo vim/etc/samba/smb.conf

Add a configuration item at the end of the file

The reference settings are as follows:

[Ubuntu]

Path =/home/

Available=yes

Public=no

Browseable=yes

Writeable=yes

Read Only=no

Restart Samba Services

sudo service smbd restart

Native Installation Smbclient

sudo apt-get install smbclient

Native test

Smbclient-l//localhost/

Note: You can view files and code directly with \\192.168.81.129\UBUNTU\HJB in the WINDOWS7 system of the development host, as well as in source insight, without having to map the directory to a network drive. Otherwise the Windows7 boot will have a long time black screen, experience is not good.

The above mainly introduces the benefits of installing Ubuntu based on VMware, which is one of the most important things to build an Android development environment. SSH, vim, and samba are basic services and tools, and no password execution sudo can effectively improve productivity.

Because Xshell is very commonly used, it is assigned a shortcut key, so it can be very convenient to exhale at any time. To do this, click the Desktop Xshell icon-right--Properties--Shortcuts--shortcut--ctrl+alt+x--OK, as shown in the same way Android studio can assign Ctrl+alt+a. This method is suitable for the daily use of high-frequency software, avoid frequent back to the desktop or from the Start menu click Start, with the press, convenient and efficient.

Stand-alone Android development Environment (II)

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.