Android模拟器安装 with windows xp

上一篇 / 下一篇  2010-03-04 15:12:55 / 个人分类:手机

参见:

http://androidandme.com/2009/10/news/how-to-install-android-sdk-and-play-with-android-2-0-in-the-emulator/

Google has released the Android 2.0 SDK as of October 27th, 2009. We know how eager everyone has been to get their hands on Android 2.0, so we have decided to write up instructions so that anyone may download and install the SDK, then create and run an emulator instance.

Note, the emulator is not intended to duplicate any particular device, so treat this more as a look at some of the core new features of Android 2.0 than an emulation of any current or future device. Also, things that require hardware features are not available in the emulator. No multi-touch in here guys (unless you manage to get two mice to work?).

Enough of the talk, let’s get down to business.

1)      Download appropriate file for your system fromhttp://developer.android.com/sdk/index.html

http://code.google.com/android/download.html

2)      Extract to desired location

3)      Run “SDK Setup.exe” (or the equivalent for your system)

Launch sdksetup.ext

Launch sdksetup.ext

a.       If you receive an error message stating “Failed to fetch url…” then you will have to force the Setup program to use http in lieu of https.

Got this error? Follow the steps.

Got this error? Follow the steps.

i.      Close the “Refresh Sources” window

ii.      Cancel the “Choose Packages to Install” window

iii.      Select “Settings” from the left side of the “Android SDK and AVD Manager” window

iv.      Check the box labeled “Force https://… sources to be fetched using http://…”

v.      Click “Save and Apply”

vi.      Close and restart the SDK Setup program

4)      Choose the packages that you wish install

Select only the packages you need.

Select only the packages you need.

a.       If you are only interested in trying out the Android 2.0 Emulator

i.      Reject everything except “SDK Platform. Android 2.0. API 5, revision 1” by selecting each item then selecting the Reject option

b.      If you plan to develop Android applications and Games, you may wish to Accept All

c.       Click “Install Selected”

5)      Allow the selected packages to download and install then close the “Installing Archives” window

6)      Create a new Android Virtual Device (AVD)

These are the settings to emulate the Moto Droid.

These are the settings to emulate the Moto Droid.

a.       Select “Virtual Devices” from the left side of the “Android SDK and AVD Manager” window

i.      Click “New”

ii.      Enter a Name

iii.      Choose a Target

iv.      Enter a size for the emulated SD Card

v.      Choose a Skin

1.      To emulate current hardware such as the G1, MyTouch 3G, Hero, etc…

a.       Leave the default value

2.      To emulate the Motorola Droid

a.       Choose WVGA 854

3.      To emulate other devices

a.       Choose anything else

vi.      Click “Create AVD”

7)      Start your newly created Virtual Device

A successfully created AVD.

A successfully created AVD.

a.       Choose the Virtual Device from the list

b.      Click “Start…”

c.       Click “Launch”

Just click launch.

Just click launch.

8)      Allow copious time for Emulator to start up

First startup will take a few minutes.

First startup will take a few minutes.

9)      Enjoy!

Android 2.0

TAG:

Quality Trackers 引用 删除 liyun100   /   2010-09-01 17:00:37
MAC 下的安装过程: http://techolics.com/Android/development/2010/0602/7.html
Quality Trackers 引用 删除 liyun100   /   2010-03-04 15:19:13
(ZT)Android模拟器入门
Android, 入门, 模拟


要玩GPhone的模拟器,当然需要先去google上面下载Android的SDK,解压出来后在SDK的根目录下有一个tools文件夹,里面就是模拟器和一些非常有用的工具。

双击“emulator.exe”,直接启动模拟器,简单吧。当然,如果要对模拟器进行一些定制,还是要从命令行调用,带上参数启动。下面就来介绍一下启动是常用的几个参数:

1.模拟器外观的定制:
480x320, landscape: emulator -skin HVGA-L
320x480, portrait : emulator -skin HVGA-P (default)
320x240, landscape: emulator -skin QVGA-L
240x320, portrait : emulator -skin QVGA-P

2.为模拟器加上SD卡:
emulator -sdcard D:\sdcard.img

下面我们再来说说如何创建"sdcard.img"文件:
“tools”目录下还有另外一个很好用的工具“mksdcard.exe”,一看名字就知道——make sdcard。对,就用它来创建一个“SD卡”。

命令为:
mksdcard 1024M D:\sdcard.img

OK,这样一个容量为1G的SD卡就创建完毕了。

使用SDCard:

创建: mksdcard <1024M> <sdcard.img>
(bytes(default),K,M)

连接到模拟器: emulator -sdcard <目录/sdcard.img>

传文件到SDCard: adb push <目录/audio.mp3> </sdcard/audio.mp3>

玩过手机模拟器的人一般最感兴趣的当然是模拟器能做什么呢?下面一一道来:

GPhone的模拟器有个特有的号码:15555218135,这个就类似我们实体手机的SIM卡号码啦。要实现拨号,用手机?当然不行!

更简单,三步:
1.运行 cmd
2.连接: telnet localhost 5554
3.命令:gsm call 15555218135

look!是不是模拟器上显示来电了?接听/挂断和实体手机一样。

发短信也一样简单,重复上面1,2两步,第三部命令改一下:
sms send 15555218135 Hello,this is a Message.

来说说PC与模拟器文件传输的方法吧。这里需要用到另一个重要工具,也在“tools”目录下,“adb.exe”。

adb:

adb(Android Debug Bridge)是Android
提供的一个通用的调试工具,借助这个工具,我们可以管理设备或手机
模拟器
的状态
。还可以进行以下的操作:
1、快速更新设备或手机模拟器中的代码,如应用或Android系统升级;
2、在设备上运行shell命令;
3、管理设备或手机模拟器上的预定端口;
4、在设备或手机模拟器上复制或粘贴文件

一些常用的操作:

进入Shell: adb shell

通过上面的命令,就可以进入设备或模拟器的shell环境中,在这个Linux Shell中,你可以执行各种Linux
的命令,另外如果只想执行一条shell命令,可以采用以下的方式:
adb shell [command]
如:adb shell dmesg会打印出内核的调试信息。
(Android的linux shell做了大量精简,很多linux常用指令都不支持)

上传文件: adb push <C文件> </tmp/...>
下载文件: adb pull </tmp/...> <C文件>

安装程序: adb install <*.apk>
卸载软件: adb shell rm /data/app/<*.apk>

补充一点,通过adb安装的软件(*.apk)都在"/data/app/"目录下,所以安装时不必制定路径,卸载只需要简单的执行"rm"就行。

结束adb: adb kill-server

显示android模拟器状态:
adb devices (端口信息)
adb get-product (设备型号)
adb get-serialno (序列号)

等待正在运行的设备: adb wait-for-device

端口转发: adb forward adb forward tcp:5555 tcp:1234
(将默认端口TCP 5555转发到1234端口上)

查看bug报告: adb bugreport

adb shell sqlite3 访问数据库SQLite3
adb shell logcat -b radio 记录无线通讯日志:
一般来说,无线通讯的日志非常多,在运行时没必要去记录,但我们还是可以通过命令,设置记录:

应用程序配置文件:
"AndroidManifest.xml"中
"<category android:name="android.intent.category.LAUNCHER" />"
决定是否应用程序是否显示在Panel上

-----------------------------------------------------------------------------------

am指令(在shell内使用am来加载android应用):
am [start|instrument]   
   
am start [-a <ACTION>]
  [-d <DATA_URI>]
  [-t <MIME_TYPE>]                 
  [-c <CATEGORY> [-c <CATEGORY>] ...]  
  [-e <EXTRA_KEY> <EXTRA_VALUE> [-e <EXTRA_KEY> <EXTRA_VALUE> ...]
  [-n <COMPONENT>] [-D] [<URI>]        

am instrument [-e <ARG_NAME> <ARG_VALUE>]
  [-p <ROF_FILE>]                 
  [-w] <COMPONENT>

启动浏览器:
am start -a android.intent.action.VIEW -d http://www.google.cn/

拨打电话:
am start -a android.intent.action.CALL -d tel:10086

启动google map直接定位到北京:
am start -a android.intent.action.VIEW geo:0,0?q=
 

评分:0

我来说两句

Open Toolbar