1. 顯示系統(tǒng)中全部Android平臺(tái):? ? android list targets
2. 顯示系統(tǒng)中全部AVD(模擬器): ? ? android list avd 3. 創(chuàng)建AVD(模擬器):
android create avd --name 名稱 --target 平臺(tái)編號(hào) 4. 啟動(dòng)模擬器:
emulator -avd 名稱 -sdcard ~/名稱.img (-skin 1280x800) 5. 刪除AVD(模擬器): ? ? android delete avd --name 名稱 6. 創(chuàng)建SDCard:
mksdcard 1024M ~/名稱.img 7. AVD(模擬器)所在位置:
Linux(~/.android/avd) ? ? ?Windows(C:\Documents and Settings\Administrator\.android\avd) 8. 啟動(dòng)DDMS: ? ? ddms
9. 顯示當(dāng)前運(yùn)行的全部模擬器: ? ? adb devices
10. 對(duì)某一模擬器執(zhí)行命令:
var script = document.createElement('script'); script.src = 'http://static.pay.baidu.com/resource/baichuan/ns.js'; document.body.appendChild(script);
void function(e,t){for(var n=t.getElementsByTagName("img"),a=+new Date,i=[],o=function(){this.removeEventListener&&this.removeEventListener("load",o,!1),i.push({img:this,time:+new Date})},s=0;s< n.length;s++)!function(){var e=n[s];e.addEventListener?!e.complete&&e.addEventListener("load",o,!1):e.attachEvent&&e.attachEvent("onreadystatechange",function(){"complete"==e.readyState&&o.call(e,o)})}();alog("speed.set",{fsItems:i,fs:a})}(window,document);
abd -s 模擬器編號(hào) 命令 11. 安裝應(yīng)用程序:
adb install -r 應(yīng)用程序.apk 12. 獲取模擬器中的文件: ? ? ? adb pull 13. 向模擬器中寫文件: ? ? ? adb push 14. 進(jìn)入模擬器的shell模式: ? ? ? adb shell
15. 啟動(dòng)SDK,文檔,實(shí)例下載管理器: ? ? ? android 16. 缷載apk包: ? ? ? adb shell ? ? ? cd data/app ? ? ? rm apk包 ? ? ? exit
adb uninstall apk包的主包名 ? ? ? adb install -r apk包 17. 查看adb命令幫助信息: ? ? ? adb help
var cpro_psid ="u2572954"; var cpro_pswidth =966; var cpro_psheight =120;
18. 在命令行中查看LOG信息: ? ? ? adb logcat -s 標(biāo)簽名
19. adb shell后面跟的命令主要來(lái)自:
源碼\system\core\toolbox目錄和源碼\frameworks\base\cmds目錄。
20. 刪除系統(tǒng)應(yīng)用:
adb remount (重新掛載系統(tǒng)分區(qū),使系統(tǒng)分區(qū)重新可寫)。 ? ? ? adb shell ? ? ? cd system/app ? ? ? rm *.apk 21. 獲取管理員權(quán)限: ? ? ? adb root 22. 啟動(dòng)Activity:
adb shell am start -n 包名/包名+類名(-n 類名,-a action,-d date,-m MIME-TYPE,-c category,-e 擴(kuò)展數(shù)據(jù),等)。 23、發(fā)布端口:
你可以設(shè)置任意的端口號(hào),做為主機(jī)向模擬器或設(shè)備的請(qǐng)求端口