自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

Android使用SDK方法詳解

移動開發(fā) Android
Android使用SDK的實(shí)現(xiàn),在實(shí)際應(yīng)用中起到了非常大的作用。我們今天就會從這篇文章中介紹的內(nèi)容對這一應(yīng)用技巧進(jìn)行一個充分的掌握。

Android 手機(jī)操作系統(tǒng)可以在模擬器中進(jìn)行一些特定的修改以此滿足用戶的各種需求。那么如何能在模擬器中正確的應(yīng)用Android使用SDK呢?我們將會在這里對這一應(yīng)用技巧進(jìn)行一個詳細(xì)的介紹。

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 ListActivity應(yīng)用技巧全解 
  2. Android Timer編寫方式深解 
  3. Android SQLite數(shù)據(jù)庫應(yīng)用技巧分享 
  4. Android模擬器應(yīng)用技巧詳細(xì)介紹 
  5. Android畫圖技巧應(yīng)用方式分析 
責(zé)任編輯:曹凱 來源: javaeye.com
相關(guān)推薦

2011-09-14 10:11:35

Android 2.3

2013-12-25 09:34:26

Android SDKAndroid組件

2010-01-28 17:07:03

Android Gal

2013-12-04 16:27:52

2021-08-06 06:38:49

安卓應(yīng)用Android 性能測試

2011-02-13 11:37:45

Android 3.0

2011-07-18 14:39:53

iPhone SDK UIKit

2010-12-10 10:16:21

Android 2.3

2013-01-09 15:46:02

Android百度定位SDKGPS

2011-05-25 17:34:16

Android

2023-04-28 07:56:09

2010-01-28 15:49:17

Android判斷網(wǎng)絡(luò)

2009-12-22 16:36:38

WCF重載

2009-12-28 13:28:03

WPF視頻

2010-02-03 15:59:08

Android組件

2010-01-28 14:35:21

Android系統(tǒng)信息

2018-12-18 14:13:30

SDKAndroid開發(fā)

2011-03-24 09:03:13

Android SDKAndroid

2009-12-02 16:04:44

PHP fsockop

2010-10-09 10:30:03

JS event
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號