Ubuntu Configuration Android Compilation environment

Source: Internet
Author: User

1.Ubuntu Installation

After VMware installs Ubuntu, install VMware Tools:
1. After installing Ubuntu, VMware Workstation menu: Virtual machine--> install VMware Tools (T) ... (If the menu is not grayed out, the virtual machine---and settings are mounted on the Linux.iso CD/DVD in the post-installation directory of VMware);
2, extract the vmwaretools-*tar.gz files to a directory, such as the current user desktop;
3. Enter the directory and execute sudo directly./vmtools-install.pl, all questions are entered.

To replace the software source:
1, in the Shutdown menu drop down, select "System Settings", "Software and Updates";
2, "Update Manager" click the button "settings;
3, in the software source panel "Download from", click on the "Chinese server" drop-down list, select "Other sites ...";
4, in the list of servers out of the "China" drop-down list, select Mirrors.aliyun.com, then click on the bottom right corner of the "Select Server" button to return.

Create a System update script and run:
1, right-click on the terminal, enter "Gedit"
2. Create a System update script:
#!/bin/bash
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install Ubuntu-restricted-extras
sudo apt-get install aptitude
sudo apt-get install synaptic
sudo apt-get install Samba
sudo apt-get install Smbfs
sudo apt-get install gnome-session-fallback//When you log in, you can choose Gnome Classic.
sudo apt-get install StarDict
sudo apt-get install Gconf-editor
sudo apt install git
Save to Desktop file update
3. Run in Terminal: sudo sh./update
Description: If an interrupt occurs while sudo apt-get install XXX, you may be prompted to run this command again: E:could not get Lock/var/lib/apt/lists/lock-open (11:resource tempo rarily unavailable)
Enter the following command:
sudo killall apt-get
sudo rm/var/cache/apt/archives/lock
sudo rm/var/lib/dpkg/lock
4, clean the installation/unloading of the resulting pull rubbish
sudo apt-get autoremove//automatic removal of orphaned software that is no longer used by the system
sudo apt-get AutoClean//automatic cleanup, but does not remove temporary files for installation and download
sudo apt-get clean//cleanup of downloaded temp files
5, refer to Ubuntu under boot partition space insufficient solution, uninstall the kernel:
sudo apt-get remove--purge linux-image-2.6.24-19-generic
--purge indicates a complete removal.

2.Ubuntu Upgrade

Ubuntu source file is located in/etc/apt/sources.list, please refer to source list and Debian, Ubuntu source list description;
Command "sudo update-manager-d", then select the partial upgrade process there are a few that need to be manually set in "Terminal".

3. Configuring the Android development environment

First install OPENJDK 8 (Ubuntu >= 15.04):
sudo apt-get update
sudo apt-get install OPENJDK-8-JDK

Configure Java 8:
Once the installation is complete, if there are multiple Java versions in the system, first set the default Java program
sudo update-alternatives--config java
sudo update-alternatives--config javac
Specified as Java-8-openjdk-amd64

In order to compile Android build, require 64-bit version of Ubuntu, recommended Ubuntu 14.04 and need to install the package:
sudo apt-get install Git-core GnuPG Flex Bison gperf build-essential \
Zip Curl Zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 \
Lib32ncurses5-dev x11proto-core-dev libx11-dev Lib32z-dev ccache \
Libgl1-mesa-dev libxml2-utils Xsltproc Unzip Python-networkx
Among them, Python-networkx for selinux work strategy analysis.

Set up the Android system to access USB, download 51-android.rules first, and then operate.

After downloading the Linux version of the Android SDK to a path, set the Android SDK environment variable with reference to ANDROIDSDK and Ubuntu settings under the ADB environment variable:
sudo gedit ~/.BASHRC edit the. bashrc file, add
#AndroidDev PATH
Export Path=${path}:/home/test-build/desktop/android-sdk-linux/tools
Export Path=${path}:/home/test-build/desktop/android-sdk-linux/platform-tools
This allows Android SDK and AVD Manager to be used in the terminal input Android.

Download the NDK, then unzip to a path and set the environment variable to use the Ndk-build program:
sudo gedit ~/.BASHRC edit the. bashrc file, add
Export path=${path}:~/android-ndk-r8b

Download the Linux version of Eclipse, unzip it, install the plugin CDT and ADT.
Start Eclipse and set up the SDK and NDK paths in the menu preferences, Android.

4. From the Git replacement code NDK compilation example

Minitouch is a tool for simulating touch operations in the STF framework, developed with the NDK.

First configure your Git account information:
git config--global user.name "Your name"
git config--global user.email "[Email protected]"
To view git configuration information by command:
Git config–list

git clone https://github.com/openstf/minitouch.git cloning project, in the Minitouch directory according to Minitouch compilation instructions:
When the project with Submodule, the initial time, the content of submodule will not be downloaded automatically, you need to execute the following command to download the sub-module content after the project will not be missing the corresponding files.
git submodule update--init--recursive
Or
Git submodule init
git submodule update
Then the NDK compiles:
Ndk-build
The generated binaries are stored in the./libs directory.

Ubuntu Configuration Android Compilation environment

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.