溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

Android模擬器應(yīng)用技巧有哪些

發(fā)布時間:2021-11-11 15:59:37 來源:億速云 閱讀:135 作者:柒染 欄目:移動開發(fā)

Android模擬器應(yīng)用技巧有哪些,相信很多沒有經(jīng)驗(yàn)的人對此束手無策,為此本文總結(jié)了問題出現(xiàn)的原因和解決方法,通過這篇文章希望你能解決這個問題。

如果我們想對Android操作系統(tǒng)進(jìn)行相應(yīng)改變的換,需要通過模擬器的應(yīng)用來進(jìn)行相關(guān)操作。在這里就先為大家介紹一下有關(guān)Android模擬器應(yīng)用技巧,讓大家對這一模擬器有一個初步的認(rèn)識。

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)  

安裝:

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鏡像文件:

  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

例如:

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

看完上述內(nèi)容,你們掌握Android模擬器應(yīng)用技巧有哪些的方法了嗎?如果還想學(xué)到更多技能或想了解更多相關(guān)內(nèi)容,歡迎關(guān)注億速云行業(yè)資訊頻道,感謝各位的閱讀!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI