Android 手机操作系统可以在模拟器中进行一些特定的修改以此满足用户的各种需求。那么如何能在模拟器中正确的应用Android使用SDK呢?我们将会在这里对这一应用技巧进行一个详细的介绍。
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
卸载:
adb uninstall filename.apk
或者
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
分享到:
相关推荐
Android学习指南:Android_SDK简介,1. 在Android模拟器上安装和卸载APK包,2. 在Android模拟器上使用sd card生成sdcard镜像文件,启动模拟器,将资源放入到sdcard里面,使用命令adb shell 查看sdcard目录
Android4.0 SDK新功能详解Android4.0 SDK新功能详解Android4.0 SDK新功能详解Android4.0 SDK新功能详解
AndroidSDK2.2开发环境详解
Android SDK 中各目录名称和作用详细介绍
Android 3.0 SDK中新增API详解,对了解ANDROID的动向,及开发,很有帮助!
Android开发环境搭建图解(jdk+eclip+android_sdk)
优博讯最新Android安卓SDK资源包V3,含详细API文档,据说适用优博讯所有型号设备
android SDK 下 NotePad例子详解 自己结合博客对例子进行了分析
Android SDK中tools详解 Android SDK包含了各种各样的定制工具,简介如下:Android模拟器(Android Emulator )它是在你的计算机上运行的一个虚拟移动设备。你可以使用模拟器来在一个实际的Android运行环境下设计,...
Xamarin 开发Android应用Android_SDK详解,c#移动开发开发,通过 Xamarin 在 Visual Studio 中构建移动应用 。
android sdk 详解 一张图让你读懂android sdk 。
Android SDK 开发环境 详解
Android SDK2.2开发环境详解
Android SDK failed to fetch URL http dl-ssl.google.comandroidrepositoryaddons_list-2.xml
Android_SDK2.2开发环境详解,最菜的菜鸟都可以很轻松的搞定
Android_SDK2.2__开发环境详解
android-sdk详解,包含最新4.1系统