How to install the Android Emulator with SDK in Windows 7 Operating System
Tools Needed
- JDK 1.6 or JRE
- Eclipse IDE for Java Developers or Eclipse RDP/Plugin Developers
- Android SDK for Windows
- ADT plugin for Eclipse
Step 1:
Install JDK and Eclipse
Step 2:
- Unzip or untar the Android SDK and extract it into a folder namely C:/android-sdk-windows
- Set the path for the tools/ under the android SDK, ie. C:/android-sdk-windows/tools
- Right click My Computer-> properties –> Advanced System Settings –> Environmental Variables and edit the PATH Variable
Step 3:
- Once you have ADT plugin with you, we need to add the ADT to Eclipse. Open Eclipse-> Help –> Install New Software
- There will be a link called Add Site, you can either download using the site https://dl-ssl.google.com/android/eclipse/ (if any errors, then use http instead of https). If you have downloaded archive with you, click Add Site and click the archive, select your downloaded file and proceed and restart eclipse
Step 4:
- Now you can see eclipse to start a new project with android also shown. But selecting a new project needs a target.
- Open Eclipse –> Window –> preferences –> Select Android and the set the path of android SDK C:/android-sdk-windows
- Open eclipse –> Window –> Android SDK and AVD Manager (A new window will pop up, indicating you to select some packages)
then select any one SDK platform (I selected Android Platform SDK 1.5), it will take some time to be downloaded.
Step 5:
- Once the package are downloaded you can see C:/android-sdk-windows/platforms/ under this folder the SDK platform is created, indicates the successful installation of Android on the machine.
- Inside the platform/ folder there are some sample applications like gaming, hello world. etc.
Step 6:
- Open eclipse and create a new project-> Android Project
- Create project from existing workspace and select the application you want to test.
- Once the project is created and opened. Run it by pressing CTL+F11 or Click Run Menu
- An Emulator showing the android phone will be opened.
Create Android Virtual Device
- Creating a Android Virtual Device (AVD) is mandatory to display the actual emulator. It specifies the VGA capabilities of the system and size of the memory, etc.
- Open eclipse –> Window –> Android SDK and AVD Manager (A new window will pop up, indicating you to select some packages)
- AVD select and create the AVD by specifying the Target id. (open command prompt, go to c:/android-sdk-windows/tools and execute the following android.bat list target). This command will specify a target id.
To add an SDCARD
- SDCARD support FAT32 partition, so we need to create a image file (.iso or .img) file to create space for the sdcard.
- go to the command prompt (c:/android-sdk-windows/tools and execute mksdcard.exe sizeK/M <file>)
- Eg. mksdcard 1024M tsp.iso (means a sdcard of 1GB is preferred)
Opening the emulator through the command prompt
- emulator.exe –avd <name of AVD> (Emulator will be opened for the concerned AVD)
- emulator.exe –avd <name of AVD> –sdcard tsp.iso (Emulator will be opened for the AVD as well as the 1GB SDCARD)
In Linux,
Only difference is the path setting done at /home/<username>/.bash_profile or .bashrc file and then set the path
export PATH=$PATH: /home/pradeep/android-sdk/
Source: http://developer.android.com