Android模拟器应用技巧详细介绍

移动开发 Android
我们在这里通过对安装和卸载APL包以及使用sd card这两个方面来充分了解Android模拟器应用技巧,希望大家能从中获得些帮助。

如果我们想对Android操作系统进行相应改变的换,需要通过模拟器的应用来进行相关操作。在这里就先为大家介绍一下有关Android模拟器应用技巧,让大家对这一模拟器有一个初步的认识。

1. 在Android模拟器上安装和卸载APK包 

  1. adb install [-l] [-r] < file> - push this package 
    file to the device and install it   
  2. ('-l' means forward-lock the app) ('-r' means 
    reinstall the app, keeping its data)   
  3. adb uninstall [-k] < package> - remove this 
    app package from the device   
  4. ('-k' means keep the data and cache directories)  

安装:

  1. adb install filename.apk   
  2. D:\android-sdk\tools>adb install filename.apk   
  3. * daemon not running. starting it now *   
  4. * daemon started successfully *   
  5. 347 KB/s (111196 bytes in 0.312s)   
  6. pkg: /data/local/tmp/filename.apk   
  7. Success  

卸载:

  1. adb uninstall filename.apk  

或者

  1. adb shell rm data/app/filename.apk  

2. 在Android模拟器上使用sd card 

生成sdcard镜像文件:

  1. mksdcard: create a blank FAT32 image to be 
    used with the Android emulator   
  2. usage: mksdcard [-l label] < size> < file>   
  3. if < size> is a simple integer, 
    it specifies a size in bytes   
  4. if < size> is an integer followed by 'K', 
    it specifies a size in KiB   
  5. if < size> is an integer followed by 'M', 
    it specifies a size in MiB   
  6. D:\android-sdk\tools>mksdcard.exe -l 
    sdcard 2048M sdcard.img  

启动模拟器:emulator -sdcard sdcard镜像文件

例如: emulator -sdcard sdcard.img

将资源放入到sdcard里面: adb push source-file /sdcard

例如:

  1. D:\android-sdk\tools>adb push NOTICE.txt /sdcard   
  2. 1088 KB/s (156733 bytes in 0.140s)  

使用命令adb shell 查看sdcard目录:

  1. D:\android-sdk\tools>adb shell   
  2. # ls sdcard   
  3. NOTICE.txt  

【编辑推荐】

  1. Android画图技巧应用方式分析 
  2. Android dialog应用经验总结 
  3. Android短信发送功能实现技巧分享 
  4. Android开机自启动具体操作方法简介 
  5. Android显示网络图片相关实现方法浅谈 
责任编辑:曹凯 来源: javaeye.com
相关推荐

2010-03-03 17:11:08

2014-11-17 10:34:15

2009-09-14 09:59:19

CCNA模拟器介绍CCNA

2009-09-17 09:11:59

CCNA实验模拟器CCNA

2010-01-25 09:28:54

Android模拟器

2013-07-11 15:55:30

Genymotion模拟器

2010-01-27 13:37:15

2017-05-03 14:57:34

2013-07-24 16:08:01

Android模拟器Genymotion

2010-01-28 17:18:08

Android模拟器s

2024-04-08 08:26:54

2015-07-27 10:38:14

微软android模拟器

2013-07-25 14:35:27

2013-05-14 10:41:31

2012-04-10 09:38:57

2011-06-07 16:58:42

Android 模拟器

2012-12-31 14:07:23

Android模拟器快捷键

2012-12-25 12:26:39

2013-07-04 13:29:40

Androidgenymotion

2011-05-26 09:40:11

Android模拟器
点赞
收藏

51CTO技术栈公众号