顯示具有 Andriod 開發 標籤的文章。 顯示所有文章
顯示具有 Andriod 開發 標籤的文章。 顯示所有文章

2011年11月19日 星期六

轉載:如何安裝market app 到 android 2.3 emulator

模擬器沒有 market app 總是有種空洞感, 茲感謝國外能人, 已能安裝在最新的Android 2.3 SDK.
真期待3.0 honeybomb 版~ 可惜還沒看到.
以下為安裝 market app 到 android 2.2/2.3 的安裝說明

1. Download and install Android SDK. 下載安裝 android SDK. (設定android emulator 教學如後 how to set up an Android Emulator)

2. 到目錄 …….\android-sdk_r08-windows\android-sdk-windows\platforms\android-9\images (預設資料夾, 多會在我的文件, downloads 資料夾內 SDK Platform Android 2.3, API 9, revision 1), 複製 system.img, 貼到 C:\Users\Username\.android\avd\Emulator’s name.avd





3. 下載以下三個檔案: Vending.apk, GoogleServicesFramework.apk and ADB.zip ;下載完解壓縮後將三個檔案放到 …….\android-sdk_r08-windows\android-sdk-windows\tools. (在 Android 2.3 SDK, adb files 被移到其他的目錄, anyway, 懶的深究, 照做可行就是了)

3. 按 Winkey+R, 鍵入 cmd 按 Enter. 叫出 command prompt DOS 視窗, 接著到以下目錄 …….\android-sdk_r08-windows\android-sdk-windows\tools (提醒, 按 cc .. (回上層目錄) 或 cd 目錄名稱 來移動).



4. 鍵入: emulator –avd tech-recipes –partition-size 100 and hit Enter ( tech-recipes 指的是你的 emulator 的名稱). 這個指令是叫出 android emulator. (請不要用SDK manager 來叫出android emulator, 會無法完成安裝.)



5. 再叫出另一個command prompt window (DOS 視窗), 到以下目錄 …….\android-sdk_r08-windows\android-sdk-windows\tools , 鍵入 adb -s emulator-5554 shell 並按 Enter

(模擬器emulator 要完全啓動完成, 並注意模擬器的編號 (多為5554) 鍵入 mount 按 Enter. 以下畫面會出現, 請找 /dev/block/mtdblock0 /system yaffs2 ro 00.



6. 鍵入 mount -o remount,rw -t yaffs2 /dev/block/mtdblock0 /system 按 Enter. 會重啓系統並進入 read-write 模式. (因為我們將要複製一些檔案到 /system/app ) 鍵入 chmod 777 /system/app 按 Enter. 接著離開, 鍵入 exit, 按 Enter. 流程會像以下圖示:



7. 此步驟, 我們將複製 Vending.apk 與 GoogleServicesFramework.apk 到 /system/app. 在第二個 command prompt window(DOS 視窗), 鍵入 adb -s emulator-5554 push Vending.apk /system/app/ 按 Enter. 同樣地, 另一個檔案也用同樣方式鍵入 adb -s emulator-5554 push GoogleServicesFramework.apk /system/app/. 按 Enter. 流程如下圖:



8. 現在,自 /system/app 移除 SdkSetup.apk (如果不移除, 下次SDK重啓會還原設定). 在第二個 command prompt window(DOS 視窗), 鍵入 adb shell rm /system/app/SdkSetup.apk , 按 Enter.



9. 關掉模擬器

10. 到 C:\Users\Username\.android\avd\Emulator’s name.avd 目錄並刪除下面二個檔案: userdata-qemu.img and cache.img. 啓動你的android emulator, 你會發現 Android Market 已經安裝成功了 ^^

轉載:http://dontung.wordpress.com/2011/03/14/hello-world/