What if we wrote an Android app and wanted to show it to people in a machine that didn't have an Android SDK or build environment? Typically, when we develop an Android application, we use an emulator to run the program, either in the SDK environment or in the source code build environment. In the SDK environment, combined with Eclipse and ADT, it is convenient to use the simulator, and in the build environment, it is easy to use the emulator command, you can refer to download, compile and install the latest Android source code in Ubuntu. This article introduces another way to use the Android emulator in Windows environment, which is independent of the SDK or build environment and can be distributed and used independently.
To run the Android emulator emulator, as long as you have 4 system mirrors on it, respectively, System.img, Userdata.img, Ramdisk.img and Kernel-qemu, these 4 files can be obtained from the SDK environment, and it is also best to add the emulator skin and ADB tools so that the functionality is complete. The following describes the specific method.
First, download the Android SDK. official Download http://dl.google.com/android/android-sdk_rXX-windows.zip, XX refers to the version number you want to download, for example, I downloaded 08. This link may have been harmonized, and can be searched on the Internet and downloaded in other ways. After downloading, run the SDK Manager tool and download the full SDK. Suppose the SDK is placed in the D:\android-sdk-windows directory.
two. Create a new directory, for example, under D disk, create a new directory D:\AndroidEmulator. Enter into the D:\android-sdk-windows\tools directory, copy the Emulator.exe to the D:\AndroidEmulator, and enter the D:\android-sdk-windows\ Platform-tools directory, copy adb.exe and AdbWinApi.dll two files into D:\AndroidEmulator. Note that some SDK places Adb.exe and AdbWinApi.dll in the D:\android-sdk-windows\tools directory.
three. Create a new directory images in D:\AndroidEmulator to store the 4 system mirrors mentioned above. For example, to make a Android2.1 simulator, then go to the D:\android-sdk-windows\platforms\android-7\images directory, copy all the files inside to D:\AndroidEmulator\ In the images directory, the D:\android-sdk-windows\platforms\android-7\images directory contains system.img, USERDATA.IMG, Ramdisk.img and Kernel-qemu these 4 documents.
Four. Create a new directory skins in D:\AndroidEmulator to store the emulator skin files. continue to make the Android2.1 simulator for example, to the D:\android-sdk-windows\platforms\android-7\skins directory, all the folders inside copy to D:\AndroidEmulator\ Skins directory, the D:\android-sdk-windows\platforms\android-7\skins directory contains the emulator skin files.
Five. Start the command Line window, go to the D:\AndroidEmulator directory, and execute the following command:
D:\androidemulator>start/b emulator.exe-sysdir d:\AndroidEmulator-system images\system.img
-data images\ Userdata.img-ramdisk images\ramdisk.img-kernel images\kernel-qemu-skindir
D:\AndroidEmulator\skins-skin HVGA
Start/b indicates running emulator in the background, other emulator command options please perform emulator-help view. In this way, the simulator is shipped.
Six. If you want to install the APK program on the emulator, execute the ADB install xxx.apk command and run the ADB install command if you encounter the following output:
D:\ANDROIDEMULATOR>ADB Install renju.apk
* Daemon not running. Starting it now on port 5037 *
* Daemon started Successfully *
error:device offline
Don't bother, rerun until the tip is successful.
So, if we write an Android application and want to show it to someone on a machine that doesn't have the Android SDK and the Android build environment, we can pack D:\AndroidEmulator this folder, With your Android app, you can show it, isn't it convenient.
The above is to make their own Android simulator implementation process Introduction, thank you for your support of this site!