手機端測試--準備

Appium環境搭建html

1.安裝Oracle VirtualBox >= 4.1(版本越高越好)android

下載地址:https://www.virtualbox.org/wiki/Downloads官方下載安裝,shell

以及打上相應的補丁,如VirtualBox 4.2.16 Oracle VM VirtualBox Extension Packwindows

 

2.安裝Android開發環境:SDK,Eclipse+ADT緩存

下載地址:http://www.android-doc.com/sdk/index.htmleclipse

 

3.安裝genymotionspa

下載地址:https://www.genymotion.com插件

按圖形界面提示,一直點擊下一步就能夠完成安裝了code

須要注意幾點:htm

a.genymotion和VirtualBox版本要一致

b.genymotion中adb設置,不能使用默認sdk,不然會報錯

c.虛擬器都安裝成功後,須要在虛擬器中安裝Genymotion-ARM-Translation插件,全部關於  arm報錯都是由於插件沒有安裝

下載地址:資源不少,本身搜吧

adb基本命令

 

adb shell dumpsys activity | grep Focuse >/Libary/log.txt                      查詢當前打開的活動名稱並輸出到/Libary/log.txt目錄

adb shell dumpsys activity | findstr Focuse                                           查詢當前打開的活動名稱(windows cmd下執行)

adb shell pm list package                                                                    列出全部已安裝的包名

adb shell am start -W -n p(包名)/p(包名)+a(活動名)                      強行用adb啓動一個活動

adb shell am force-stop                                                                      強制退出

adb shell pm clear                                                                              清除緩存

install                                   安裝卸載

unstall                                  卸載

push

pull

adb shell getprop ro.serialno                                                                查詢設備串號

 

eclipse封裝adb命令

1.執行adb命令的類及方法調用

 

Runtime.getRuntime().exec("adb devices");
相關文章
相關標籤/搜索