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

adb install [-l] [-r] <file> - push this package file to the device and install it
('-l' means forward-lock the app) ('-r' means reinstall the app, keeping its data)


adb uninstall [-k] <package> - remove this app package from the device
('-k' means keep the data and cache directories)


安装:

adb install filename.apk

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

卸载:

adb uninstall filename.apk

或者

adb shell rm data/app/filename.apk


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

生成sdcard镜像文件:

mksdcard: create a blank FAT32 image to be used with the Android emulator
usage: mksdcard [-l label] <size> <file>

if <size> is a simple integer, it specifies a size in bytes
if <size> is an integer followed by 'K', it specifies a size in KiB
if <size> is an integer followed by 'M', it specifies a size in MiB

D:\android-sdk\tools>mksdcard.exe -l sdcard 2048M sdcard.img


启动模拟器:emulator -sdcard sdcard镜像文件
例如: emulator -sdcard sdcard.img

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

例如:

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


使用命令adb shell 查看sdcard目录:
D:\android-sdk\tools>adb shell
# ls sdcard
NOTICE.txt

更多相关文章

  1. GitHub 标星 2.5K+!教你通过玩游戏的方式学习 VIM!
  2. 如何在后台运行Linux命令?
  3. No.11 使用firewall配置的防火墙策略的生效模式
  4. mac 下真机调试 android 手机
  5. 客户端按下登陆键后无反应
  6. Android(安卓)使用 adb命令 远程安装apk
  7. Android中使用am命令实现在命令行启动程序详解
  8. android java获得root权限调用linux命令
  9. Ubuntu 将adb加入环境变量 及adb shell 无法启动

随机推荐

  1. 探探Android
  2. Android 安全 —— 本地拒绝服务漏洞
  3. Android 虚拟键盘弹出把底部view顶上去的
  4. Android SDK 安装过程 与 安装失败的处理
  5. Android无法真正睡眠:服务广播插件等仍激
  6. Android aapt 资源打包工具
  7. Android Camera 五 Camera HAL v1
  8. 初学Android,使用菜单资源(十九)
  9. android如何判断服务是否正在运行状态
  10. Android Studio报错:ClassLoader referenc