爱黑武论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 3070|回复: 2

[安卓技术] Android使用SDK方法详解

[复制链接]
发表于 2011-4-28 07:41 | 显示全部楼层 |阅读模式

立即注册,加入爱黑武论坛的大家庭!爱黑武,爱上搞机生活!

您需要 登录 才可以下载或查看,没有账号?注册

x
Android 手机操作系统可以在模拟器中进行一些特定的修改以此满足用户的各种需求。那么如何能在模拟器中正确的应用Android使用SDK呢?我们将会在这里对这一应用技巧进行一个详细的介绍。

  一. 在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

  二. 在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

 楼主| 发表于 2011-4-28 07:41 | 显示全部楼层
学习了         [s:57]
发表于 2011-4-28 09:21 | 显示全部楼层
了解一下~~~~~
 Hello,黑武的好机友!回复想偷个懒?点这里: 
您需要登录后才可以回帖 登录 | 注册

本版积分规则

关闭

站长推荐上一条 /1 下一条

QQ|小黑屋|Archiver|手机版|爱黑武论坛 ( 京ICP备2023028323号 | 京公网安备11011202000270号 )

GMT+8, 2024-4-28 21:53 , Processed in 0.049454 second(s), 20 queries .

Powered by Discuz! X3.4

Copyright © 2001-2024, ihei5.com

快速回复 返回顶部 返回列表