Monkeyrunner’s Android development environment building tutorial (1)

Before learning monkeyrunner, let's build the eclipse Android development environment.

For program developers, eclipse is no stranger. It provides a very broad platform to develop programs. It can also be used to develop Android programs. However, Android programs cannot be developed directly in eclipse. We need to install an ADT plug-in.

Before ADT installation, there are several prerequisites:

1. JDK has been installed and environment variables have been configured. The JDK environment variable configuration will not be described here.

2. Eclipse has been downloaded and unzipped. Eclipse Official Website http://www.eclipse.org/downloads/ , Download eclipse, unzip it to your own directory, and double-click eclipse.exe to run it.

3. Download Android SDK. Official website: http://developer.android.com/sdk/index.html , Download adt-bundle-windows-x86-20140321.zip and unzip it as shown in the figure below.

1、 Online installation of ADT plug-in

1. ADT installation

Open eclipse, click Help in the eclipse working interface, select install new software... And enter the install page.

On the install page, click the Add button to enter the add repository page.

On the add repository page, enter the name and address of the plug-in you want to obtain. The address must be entered correctly. Since we want to obtain ADT, we enter here the download address with the name of ADT and the address of ADT: https://dl-ssl.google.com/android/eclipse/

Click OK to enter the ADT loading page (FQ is required here, otherwise ADT loading is unsuccessful). If the loading fails, first determine whether the network can access Google. If the network is normal, you can add again and load ADT.

After the ADT is loaded successfully, the page is as follows:

Then, follow the prompts on the page, click next, and finally finish.

Click Finish to enter the ADT plug-in installation interface. This interface needs to download some software, so the speed may be slower. Please wait patiently.

2. Development platform download

After the ADT plug-in is installed, an ADT manager will be added to the menu interface of eclipse, as shown in the figure below. Click to enter the Android API installation interface.

Because the SDK has been downloaded and decompressed before, the downloaded API will be pulled and displayed as installed, and the non downloaded API will be displayed as not installed. At this time, you only need to select the not installed system version you need to download.

After clicking install, the page will jump to the confirm installation page.

After confirming the installation, start downloading APIs according to the network conditions.

Finally, check that the installation is complete. Sometimes, although we click to select some plug-ins, there will be problems that can not be installed, so we need to check whether there are plug-ins that have not been successfully installed. If you want to install these uninstalled, check again and repeat the previous step.

3. SDK path configuration

After ADT installation is completed, you need to configure SDK location in window preference Android, that is, configure the directory path of tools in the SDK.

Two. Simulator creation and startup

1. Simulator creation

After the Android development environment is configured, we can create a simulator. On the eclipse menu page, select the simulator icon and create the simulator according to the following steps.

2. Simulator startup

After the simulator is created, you can start the simulator. There are two startup methods. One is to open the Android simulator with eclipse; The other is to open the simulator with Android command in CMD window.

Let's start in eclipse.

The following describes how to start the simulator in the CMD window.

Open CMD and enter the command emulator - AVD AVD_ Test (this is the name of the simulator you just created), you can start it.

The above describes the construction and configuration of Android development environment in eclipse.

3、 Problems and Solutions

In the process of building the Android development environment, there will inevitably be various problems. Here is a review and summary of the problems I have encountered.

1. Modify the path of default debug.keystore:

First of all, it should be clear that if you do not configure the path of default debug.keystore in the system variable, that is, Android_ SDK_ Home path, the system will default to an address C: \ users \ admin, which is where the. Android folder is stored. Therefore, if you want to modify the path of default debug.keystore, you need to do the following:

1) Configure Android in the system variable_ SDK_ Home (must be this name)

In the system variable, create a new Android_ SDK_ Home, and configure the address. For example, the path I configured here is D: \ ADT bundle windows x86 20140321. After saving, check whether the path of default debug.keystore in Android build in eclipse window preference is modified to the configured path.

As shown in the above figure, although adroid is configured in the environment variable_ SDK_ The path to home, but the original default path is still displayed in eclipse. This is because eclipse will first find the default file. If there is one, it will select it. If not, it will find Android_ SDK_ AVD path under home directory. So we delete the default. Android file.

Restart eclipse again, and the default has been changed to the path configured in the environment variable.

2. Simulator startup failed

Error: the user data image is used by another emulator. Aborting appears when the emulator starts.

Error cause: the system judges that you have started another emulator, which may be caused by some normal operation or abnormal exit.

Solution: enter your AVD directory, such as:

D:\adt-bundle-windows-x86-20140321\.android\avd\AVD_ Test.avd, delete the folder ending in lock. (. Lock is locked. This problem occurs if the folders ending in. Lock cannot be cleared due to program crash and other reasons, that is, the lock of the AVD is not released, causing the AVD manager to think that the AVD is in use.)

3. Solve the difficulty of accessing Google server in China

When loading the Android API, if the not installed API cannot be loaded, the following settings can be made:

In the main interface of Android SDK manager, select tools options, and in the setting pop-up box, set the HTTP proxy server and HTTP proxy port as mirrors.neusoft.edu.cn and 80 respectively, and check F orcehttps://...sources to be fetched usinghttp://... Check box.

After setting, click close, close the setting window, return to the main interface, select packages reload, and then reload.

@H_ 502_ 248@

The above is the whole content of this article. I hope it will be helpful to your study, and I hope you can support programming tips.

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>