android模拟器 sdcard上安装apk

打开DDMS
Eclipse -> Window -> open perspective ->DDMS
if want push file to Emulator then you can use 
DDMS->select the emulator ->then open file explorer ->select SDcard(mnt/sdcard)->
then click push button on right top to browse the file.

[2013-04-24 16:25:28 - ddms] transfer error: Read-only file system
[2013-04-24 16:25:28] Failed to push selection: Read-only file system


just go to


C:\Documents and Settings\<adminstrator>\.android\avd
take 'properties' of your avd folder(there is a folder for each of the avds)..uncheck 'Read only'->ok

D:\adt-bundle-windows-x86-20130219\sdk\platform-tools>adb devices
List of devices attached
emulator-5554   device
查看sdcard目录权限
D:\adt-bundle-windows-x86-20130219\sdk\platform-tools>adb shell
root@android:/ # cd /sdcard/
cd /sdcard/
root@android:/sdcard # ls -al
ls -al
d--------- root     root              2013-04-24 09:08 .android_secure
d---rwxr-x system   sdcard_rw          2013-04-24 08:59 LOST.DIR
----rwxr-x system   sdcard_rw   467531 2013-02-12 23:34 foo.txt
d---rwxr-x system   sdcard_rw          2013-04-24 08:59 myfolder
root@android:/sdcard # mkdir myfolder
mkdir myfolder
mkdir failed for myfolder, File exists

1|root@android:/sdcard # exit
exit

向emulator sdcard中push文件
D:\adt-bundle-windows-x86-20130219\sdk\platform-tools>adb push myapp.apk  /sdcard/
myfolder/myapp.apk
195 KB/s (1654639 bytes in 8.278s)
D:\adt-bundle-windows-x86-20130219\sdk\platform-tools>

安装emulator sdcard卡下的apk文件
D:\adt-bundle-windows-x86-20130219\sdk\platform-tools>adb shell
root@android:/ # adb install /sdcard/myfolder/myapp.apk
adb install /sdcard/myfolder/myapp.apk
1492 KB/s (1654639 bytes in 1.082s)
        pkg: /data/local/tmp/myapp.apk
Success
root@android:/ #

猜你喜欢

转载自jialisoft126.iteye.com/blog/1859039