How Do I Install the Android Market on Android SDK

转自: http://www.tech-recipes.com/rx/10004/accessing-android-market-from-android-sdk/

====================================================

我在Android SDK4.0.3上按照步骤走一遍的结果是安装成功,但是下载失败,不知何故。

另外,如需安装成功,需要在第8步后将临时文件C:\Users\UserName\AppData\Local\Temp\AndroidEmulator\xxx.tmp  替换原有的system.img,并给它命名为system.img。

碰到的几个问题:

1. 运行emulator –avd tech-recipes –partition-size 100 时有out of memory错误

方法:把partition-size 改成250以上

2.  market可以显示,但是下载失败



===========================================


Contributor Icon Contributed by Lê Hoàng Date Icon December 9, 2010  
Tag IconTagged: Internet  
Although the Android SDK is useful for developers, it lacks one important feature–the Android Market. Following these intructions, you can install Android Market. This will allow you to download and test free applications or games with the latest Android 2.3 SDK.

1. Download and install Android SDK. After that, set up a new emulator. (You may want to learnhow to set up an Android Emulator

2. Go to …….\android-sdk_r08-windows\android-sdk-windows\platforms\android-9\images(this is the default folder for SDK Platform Android 2.3, API 9, revision 1), copysystem.img and paste it to C:\Users\Username\.android\avd\Emulator’s name.avd

3. Download three files: Vending.apk, GoogleServicesFramework.apk and ADB.zip (unzip the file after downloaded). After that, put all these files into…….\android-sdk_r08-windows\android-sdk-windows\tools, we will need them later. (In Android 2.3 SDK, adb files have been removed so that’s why we need them. If you use Android 2.2 SDK, you may not need to download the file)

3. Press Winkey+R, type cmd and press Enter. In command prompt, change the directory to …….\android-sdk_r08-windows\android-sdk-windows\tools(I kept the default folder structure but it is recommended that you change it).

4. Type the following: emulator –avd tech-recipes –partition-size 100 and hit Enter (please replace tech-recipes with your emulator’s name). This command will launch your emulator. Please don’t try to launch it from SDK manager, otherwise, it won’t work.

5. Launch another command prompt window, switch to …….\android-sdk_r08-windows\android-sdk-windows\tools , type in:adb -s emulator-5554 shell and hit Enter

(Please make sure that the emulator is fully loaded, and replace 5554 with your emulator’s serial code which you can find at the top of emulator’s window.) After that, typemount and hit Enter again. You will see something like below, and look for the line:/dev/block/mtdblock0 /system yaffs2 ro 00.


6. Now, type in:  mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system and hitEnter. This will remount the /system in read-write mode. Because we will copy some files to/system/app later, we must set read-write permission to that directory. To do it, type the following:chmod 777 /system/app , hit Enter. After that, you need to exit. Typeexit, hit Enter again. The whole step will look like this:

7. In this step, we will copy two files: Vending.apk and GoogleServicesFramework.apk into /system/app. To do this, from the second command prompt window, type:adb -s emulator-5554 push Vending.apk /system/app/. and hit Enter. Similar to that, to copy the next file, type: adb -s emulator-5554 push GoogleServicesFramework.apk /system/app/. ,hit Enter again. If sucess, it will look like this:

8. Now, you need to remove SdkSetup.apk from /system/app (if it is not removed, the SDK will be restore in next session). In the second command prompt window, type:adb shell rm /system/app/SdkSetup.apk , hit Enter.

9. Close your emulator.

10. Go to C:\Users\Username\.android\avd\Emulator’s name.avd and delete these two files: userdata-qemu.img and cache.img.Launch your emulator in the normal way and then, you will see Android Market from the list.


Using Facebook:


Note: Some applications and games may not work because they need real hardware. Angry Birds and Youtube are such examples. With these you can hear the sounds but not see any video.

Click here to find out more!

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Android 调试桥 (adb) Android 调试桥 (adb) 是一种功能多样的命令行工具,可让您与设备进行通信。adb 命令便于执行各种设备操作(例如安装和调试应用),并提供对 Unix shell(可用来在设备上运行各种命令)的访问权限。它是一种客户端-服务器程序,包括以下三个组件: 客户端:用于发送命令。客户端在开发计算机上运行。您可以通过发出 adb 命令从命令行终端调用客户端。 守护进程 (adbd):在设备上运行命令。守护进程在每个设备上作为后台进程运行。 服务器:管理客户端和守护进程之间的通信。服务器在开发计算机上作为后台进程运行。 adb 包含在 Android SDK 平台工具软件包中。您可以使用 SDK 管理器下载此软件包,管理器会将此软件包安装在 android_sdk/platform-tools/。或者,如果您需要独立的 Android SDK 平台工具软件包,可以点击此处进行下载。 要了解如何连接设备以进行 adb 通信,包括如何使用 Connection Assistant 对常见问题进行排查,请参阅在硬件设备上运行应用。 adb 的工作原理 当您启动某个 adb 客户端时,客户端会先检查是否有 adb 服务器进程正在运行。如果没有,它将启动服务器进程。服务器在启动后会与本地 TCP 端口 5037 绑定,并监听 adb 客户端发出的命令 - 所有 adb 客户端均通过端口 5037 与 adb 服务器通信。 然后,服务器会与所有正在运行的设备建立连接。它通过扫描 5555 到 5585 之间(该范围供前 16 个模拟器使用)的奇数号端口查找模拟器。服务器一旦发现 adb 守护进程 (adbd),便会与相应的端口建立连接。请注意,每个模拟器都使用一对按顺序排列的端口 - 用于控制台连接的偶数号端口和用于 adb 连接的奇数号端口。例如: 模拟器 1,控制台:5554 模拟器 1,adb:5555 模拟器 2,控制台:5556 模拟器 2,adb:5557 依此类推… 如上所示,在端口 5555 处与 adb 连接的模拟器与控制台监听端口为 5554 的模拟器是同一个。 服务器与所有设备均建立连接后,您便可以使用 adb 命令访问这些设备。由于服务器管理与设备的连接,并处理来自多个 adb 客户端的命令,因此您可以从任意客户端(或从某个脚本)控制任意设备。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值