Android simulator and development environment establishment documentary

Source: Internet
Author: User

I recently studied mobile web development, but mobile devices are not all complete. So I tried to build an android simulator. There are a lot of related resources on the Internet, but it seems that everyone's installation process is not the same. During the installation and use process, I also checked some information. Here I will record it and make it a piece of information.

First of all, my computer is a 32-bit win7 with JDK and eclipse installed. This process is not recorded. If you have not installed JDK or eclipse on your computer, you can download and install it at the following address, the process is very simple and will not be detailed in detail (you do not need to develop the environment, you can not install eclipse ).

JDK: http://www.oracle.com/technetwork/java/javase/downloads/index.html

Eclipse: http://www.eclipse.org/

Step 2: Install the development environment. skip this step if you are just playing with the simulator. Download the relevant development environment in eclipse, open eclipse, select help-> install new software, and type

Https://dl-ssl.google.com/android/eclipse/

Select "all", "Next", and "Next". The update starts when the task is finished.

After the installation is complete, there will be one more item in the Windows bar of Eclipse: Android SDK and AVD manager, but do not use it now, because the simulator has not been installed yet.

Step 3: Install the simulator. This will also download the android SDK. Google's official SDK download site is not easy to open (I don't know if it is blocked). You can find a version and download it from the Chinese download site, because the installation will be automatically updated to the latest version, I am using the android-sdk_r04-windows version. After the download is complete, find a place to decompress the package. Do not use Chinese characters in the decompressed path.

After decompression, open the SDK setup.exe and installProgramThe system automatically finds available update packages,

If you see an SSL error message, click the settings tab (on the left of the SDK and AVD manager window ). Remove the force https: // check box, click OK, and click installed packages again.

Now the package installer will open. You can select the update package you want to install and click Install to install the android simulator on your computer. The latest Android versions are 2.3.3 and 3.0, and 2.3.3 are used to simulate the latest mobile phone system. 3.0 can be used for Android tablets. This is enough.

Step 4: Configure environment variables. This step is not found in many tutorials, but I am stuck here. After research, I found that most people may use the Administrator account to log on to win7 AND THE C disk is sufficient, this step may not be required. I am not using the Administrator account, and the C disk is very small. I need to configure this one when everything is installed on the E disk. Configuration method:

Right-click my computer,

-> Select system protection on the left of the control panel)

-> Advanced)

-> Environment variables (environment variables ...),

In the system variables column, create an android_sdk_home item. The value of the variable points to the path of the final simulator file. For example, my path is E: \ android.

Step 5: Customize the simulation environment. In AVD manager, select virtual devices from the menu on the left and click New on the right,

Enter your virtual Android name and select the desired Android version from the target drop-down menu. The version you installed earlier is displayed here, so you may only see one version listed, depending on the version you installed earlier.

Enter the size in the SD card, and the simulator will create an imgfile on your hard disk. Then, Android will store your settings and files. Then select the screen size from skin.

Now you can run Android on your computer! Select the new virtual Android, and click the start button on the right.

The simulator is about to load android. At this time, several command line windows will pop out, and you can just look at the android simulator window. Note that by default, in addition to the large screen, the keyboard and virtual buttons will appear on the right of the simulated device.

Other settings: Read and Write SD card files

① Send a file from a computer to a device
ADB push <local path> <remote path>
② Download files from the device to the computer
ADB pull <remote path> <local path>
In this step, you need to run the simulator. Start-run-cmd. The command is as follows:
(D:/musicloud is the local path and sdcard/musicloud is the remote path)

Now, the simulator environment and development environment have been set up successfully. Slow startup. The following figure is displayed after I start it:

If you do not like the English interface, you can set the system to Chinese in system settings.

 

Create a simulator shortcut

However, every time you start the simulator, you have to start it from AVD manager. This is troublesome. Here is a tip:

Right-click emulator.exe (in the SDK tools directory) and click "create shortcut ".

 

This shortcut only runs the simulator on the command line and does not load any virtual devices. We need to change this shortcut. Right-click the shortcut and click Properties ). Select the "shortcut" tab and see the "target" box. Then, add your virtual Android name, as shown in the previous figure.@ Your_androidAnd click OK.

 

Now you can run your android directly from the desktop or the Start Menu.

 

Install the APK file on the simulator

Note: This section is copied from the network. I have not installed it successfully. Finally, I used a mobile phone to connect to the assistant to complete the installation of the program.

1. First run the android simulator, start the Android mobile phone system you just installed, and prepare the APK software you need to install.

For example, I downloaded the APK from my mobile phone QQ and put it on the desktop. The file name is qq.apk.

2. Open the command line cmd window (Enter cmd and press enter from the Start menu)

Enter ADB install desktop \ qq.apk and press Enter.

Note: Do not insert other Android phones while enabling the simulator. Otherwise, the installation cannot be identified.

 

 

Click "enter" or see the content as shown in Figure

If you see success, the installation is successful. If the installation fails, the cause of the problem is also given.

Here is a tip: After Entering ADB install, drag the APK installation file to the command line window with the mouse, and it will automatically fill in the address, without entering the file path.

Go back to the android simulator and check if there is an additional QQ icon.

Note: There are multiple images and some texts in this article directly from various tutorials. I am too lazy to find them when using them. Thank you for the author of the tutorials.

Related Article

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.