如這篇文章所示 http://www.xiake.net/blog/archives/1 俠客的插件SDK能提供很強大的功能(所有官方使用的方法都有提供)
這篇文章是詳細介紹所有SDK可調用的方法
首先,SDK項目需要引用sdk的類庫,位置在 安裝目錄\xcontrol.core.dll 如 C:\Program Files\南寧俠客網絡科技有限公司\俠客手機群控引擎\xcontrol.core.dll
可用方法如下:
1
2
3
4
5
|
public void ShowLogConsole([string title = 插件調試日志])
AndroidControlSDK.AndroidScript 的成員
摘要
:
顯示日志控制台
|
1
2
3
4
5
6
7
8
9
10
11
|
public string Click(int x, int y)
AndroidControlSDK.AndroidScript 的成員
摘要
:
點擊
參數
:
x: x坐標
y: y坐標
返回結果
:
|
1
2
3
4
5
6
7
|
public abstract string Name()
AndroidControlSDK.AndroidScript 的成員
摘要
:
模塊名稱
返回結果
:
|
1
2
3
4
5
6
7
|
public abstract string Description()
AndroidControlSDK.AndroidScript 的成員
摘要
:
模塊描述
返回結果
:
|
1
2
3
4
5
6
7
|
public abstract void RunScript()
AndroidControlSDK.AndroidScript 的成員
摘要
:
模塊執行過程
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
public string Drag(int startx, int starty, int endx, int endy)
AndroidControlSDK.AndroidScript 的成員
摘要
:
拖動
參數
:
startx: 起始x坐標
starty: 起始y坐標
endx: 結束x坐標
endy: 結束y坐標
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
11
|
public string FindAndCLickAndClearObj(string text, [int index = 0])
AndroidControlSDK.AndroidScript 的成員
摘要
:
查找並點擊並清空(精確匹配模式)
參數
:
text: 資源id或類名或特征字符
index: 索引,表示作用於匹配的第幾個結果
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
11
|
public string FindAndCLickAndClearObjByRegex(string regex, [int index = 0])
AndroidControlSDK.AndroidScript 的成員
摘要
:
查找並點擊並清空(正則模式)
參數
:
regex: 資源id或類名或特征字符(支持正則表達式)
index: 索引,表示作用於匹配的第幾個結果
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
11
|
public string FindAndCLickObj(string text, [int index = 0])
AndroidControlSDK.AndroidScript 的成員
摘要
:
查找並點擊元素(精確匹配模式)
參數
:
text: 資源id或類名或特征字符
index: 索引,表示作用於匹配的第幾個結果
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
11
|
public string FindAndCLickObjByRegex(string regex, [int index = 0])
AndroidControlSDK.AndroidScript 的成員
摘要
:
查找並點擊元素(基於正則表達式)
參數
:
regex: 資源id或類名或特征字符(支持正則表達式)
index: 索引,表示作用於匹配的第幾個結果
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
11
12
|
public string FindAndInutText(string name, string text, [int index = 0])
AndroidControlSDK.AndroidScript 的成員
摘要
:
查找並賦值(一般用於文本框)
參數
:
name: 資源id或類名或特征字符(支持正則表達式)
text: 輸入的文本
index: 索引,表示作用於匹配的第幾個結果
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
|
public string FindObj(string text)
AndroidControlSDK.AndroidScript 的成員
摘要
:
精確匹配查找元素
參數
:
text: 資源id或類名或特征字符
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
|
public string FindObjByRegex(string regex)
AndroidControlSDK.AndroidScript 的成員
摘要
:
基於正則查找元素
參數
:
regex: 資源id或類名或特征字符(支持正則表達式)
返回結果
:
|
1
2
3
4
5
6
7
|
public string GetLoction()
AndroidControlSDK.AndroidScript 的成員
摘要
:
讀取手機的
GPS坐標
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
|
public System.Collections.Generic.List<string> GetUiTexts(string regex)
AndroidControlSDK.AndroidScript 的成員
摘要
:
獲取元素文本
參數
:
regex: 資源id或類名或特征字符(支持正則表達式)
返回結果
:
|
1
2
3
4
5
6
7
8
|
public void InputText(string text)
AndroidControlSDK.AndroidScript 的成員
摘要
:
通過輸入法輸入文本
參數
:
text: 要輸入的內容
|
1
2
3
4
5
6
7
8
|
public void OpenUserChat(string userid)
AndroidControlSDK.AndroidScript 的成員
摘要
:
打開用戶對話界面
參數
:
userid: 微信id,可以是真實id也可以是加密id,或者群id、公眾號id
|
1
2
3
4
5
6
7
8
9
10
|
public string PressKeyCode(int keycode)
AndroidControlSDK.AndroidScript 的成員
摘要
:
發送按鍵
參數
:
keycode: 按鍵代碼(可參考安卓keyevent)
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
|
public string RunAdb(string adbcmd)
AndroidControlSDK.AndroidScript 的成員
摘要
:
在手機上執行執行
ADB命令
參數
:
adbcmd: adb命令
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
|
public string SendIntent(System.Collections.Generic.Dictionary<string, string> dic)
AndroidControlSDK.AndroidScript 的成員
摘要
:
發送
Intnet
參數
:
dic: key value形式的intnet值
返回結果
:
|
1
2
3
4
5
6
7
8
|
public void SetAirPlane(bool ison)
AndroidControlSDK.AndroidScript 的成員
摘要
:
設置飛行模式
參數
:
ison: 是否開啟飛行模式
|
1
2
|
public void SetImei(string imei)
AndroidControlSDK.AndroidScript 的成員
|
1
2
3
4
5
6
7
8
|
public void SetLoction(string loction)
AndroidControlSDK.AndroidScript 的成員
摘要
:
設置手機的
GPS坐標
參數
:
loction:
|
1
2
|
public void SetMacAddress(string macaddress)
AndroidControlSDK.AndroidScript 的成員
|
1
2
|
public void SetSid(string sid)
AndroidControlSDK.AndroidScript 的成員
|
1
2
|
public void SetSim(string sim)
AndroidControlSDK.AndroidScript 的成員
|
1
2
3
4
5
6
7
8
|
public void ShowStatus(string status)
AndroidControlSDK.AndroidScript 的成員
摘要
:
顯示腳本狀態
參數
:
status: 狀態
|
1
2
3
4
5
6
7
8
9
|
public void ShowStatus(string status, System.Windows.Media.Color color)
AndroidControlSDK.AndroidScript 的成員
摘要
:
顯示腳本狀態
參數
:
status: 狀態
color: 文字顏色
|
如這篇文章所示 http://www.xiake.net/blog/archives/1 俠客的插件SDK能提供很強大的功能(所有官方使用的方法都有提供)
這篇文章是詳細介紹所有SDK可調用的方法
首先,SDK項目需要引用sdk的類庫,位置在 安裝目錄\xcontrol.core.dll 如 C:\Program Files\南寧俠客網絡科技有限公司\俠客手機群控引擎\xcontrol.core.dll
可用方法如下:
1
2
3
4
5
|
public void ShowLogConsole([string title = 插件調試日志])
AndroidControlSDK.AndroidScript 的成員
摘要
:
顯示日志控制台
|
1
2
3
4
5
6
7
8
9
10
11
|
public string Click(int x, int y)
AndroidControlSDK.AndroidScript 的成員
摘要
:
點擊
參數
:
x: x坐標
y: y坐標
返回結果
:
|
1
2
3
4
5
6
7
|
public abstract string Name()
AndroidControlSDK.AndroidScript 的成員
摘要
:
模塊名稱
返回結果
:
|
1
2
3
4
5
6
7
|
public abstract string Description()
AndroidControlSDK.AndroidScript 的成員
摘要
:
模塊描述
返回結果
:
|
1
2
3
4
5
6
7
|
public abstract void RunScript()
AndroidControlSDK.AndroidScript 的成員
摘要
:
模塊執行過程
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
11
12
13
|
public string Drag(int startx, int starty, int endx, int endy)
AndroidControlSDK.AndroidScript 的成員
摘要
:
拖動
參數
:
startx: 起始x坐標
starty: 起始y坐標
endx: 結束x坐標
endy: 結束y坐標
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
11
|
public string FindAndCLickAndClearObj(string text, [int index = 0])
AndroidControlSDK.AndroidScript 的成員
摘要
:
查找並點擊並清空(精確匹配模式)
參數
:
text: 資源id或類名或特征字符
index: 索引,表示作用於匹配的第幾個結果
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
11
|
public string FindAndCLickAndClearObjByRegex(string regex, [int index = 0])
AndroidControlSDK.AndroidScript 的成員
摘要
:
查找並點擊並清空(正則模式)
參數
:
regex: 資源id或類名或特征字符(支持正則表達式)
index: 索引,表示作用於匹配的第幾個結果
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
11
|
public string FindAndCLickObj(string text, [int index = 0])
AndroidControlSDK.AndroidScript 的成員
摘要
:
查找並點擊元素(精確匹配模式)
參數
:
text: 資源id或類名或特征字符
index: 索引,表示作用於匹配的第幾個結果
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
11
|
public string FindAndCLickObjByRegex(string regex, [int index = 0])
AndroidControlSDK.AndroidScript 的成員
摘要
:
查找並點擊元素(基於正則表達式)
參數
:
regex: 資源id或類名或特征字符(支持正則表達式)
index: 索引,表示作用於匹配的第幾個結果
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
11
12
|
public string FindAndInutText(string name, string text, [int index = 0])
AndroidControlSDK.AndroidScript 的成員
摘要
:
查找並賦值(一般用於文本框)
參數
:
name: 資源id或類名或特征字符(支持正則表達式)
text: 輸入的文本
index: 索引,表示作用於匹配的第幾個結果
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
|
public string FindObj(string text)
AndroidControlSDK.AndroidScript 的成員
摘要
:
精確匹配查找元素
參數
:
text: 資源id或類名或特征字符
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
|
public string FindObjByRegex(string regex)
AndroidControlSDK.AndroidScript 的成員
摘要
:
基於正則查找元素
參數
:
regex: 資源id或類名或特征字符(支持正則表達式)
返回結果
:
|
1
2
3
4
5
6
7
|
public string GetLoction()
AndroidControlSDK.AndroidScript 的成員
摘要
:
讀取手機的
GPS坐標
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
|
public System.Collections.Generic.List<string> GetUiTexts(string regex)
AndroidControlSDK.AndroidScript 的成員
摘要
:
獲取元素文本
參數
:
regex: 資源id或類名或特征字符(支持正則表達式)
返回結果
:
|
1
2
3
4
5
6
7
8
|
public void InputText(string text)
AndroidControlSDK.AndroidScript 的成員
摘要
:
通過輸入法輸入文本
參數
:
text: 要輸入的內容
|
1
2
3
4
5
6
7
8
|
public void OpenUserChat(string userid)
AndroidControlSDK.AndroidScript 的成員
摘要
:
打開用戶對話界面
參數
:
userid: 微信id,可以是真實id也可以是加密id,或者群id、公眾號id
|
1
2
3
4
5
6
7
8
9
10
|
public string PressKeyCode(int keycode)
AndroidControlSDK.AndroidScript 的成員
摘要
:
發送按鍵
參數
:
keycode: 按鍵代碼(可參考安卓keyevent)
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
|
public string RunAdb(string adbcmd)
AndroidControlSDK.AndroidScript 的成員
摘要
:
在手機上執行執行
ADB命令
參數
:
adbcmd: adb命令
返回結果
:
|
1
2
3
4
5
6
7
8
9
10
|
public string SendIntent(System.Collections.Generic.Dictionary<string, string> dic)
AndroidControlSDK.AndroidScript 的成員
摘要
:
發送
Intnet
參數
:
dic: key value形式的intnet值
返回結果
:
|
1
2
3
4
5
6
7
8
|
public void SetAirPlane(bool ison)
AndroidControlSDK.AndroidScript 的成員
摘要
:
設置飛行模式
參數
:
ison: 是否開啟飛行模式
|
1
2
|
public void SetImei(string imei)
AndroidControlSDK.AndroidScript 的成員
|
1
2
3
4
5
6
7
8
|
public void SetLoction(string loction)
AndroidControlSDK.AndroidScript 的成員
摘要
:
設置手機的
GPS坐標
參數
:
loction:
|
1
2
|
public void SetMacAddress(string macaddress)
AndroidControlSDK.AndroidScript 的成員
|
1
2
|
public void SetSid(string sid)
AndroidControlSDK.AndroidScript 的成員
|
1
2
|
public void SetSim(string sim)
AndroidControlSDK.AndroidScript 的成員
|
1
2
3
4
5
6
7
8
|
public void ShowStatus(string status)
AndroidControlSDK.AndroidScript 的成員
摘要
:
顯示腳本狀態
參數
:
status: 狀態
|
1
2
3
4
5
6
7
8
9
|
public void ShowStatus(string status, System.Windows.Media.Color color)
AndroidControlSDK.AndroidScript 的成員
摘要
:
顯示腳本狀態
參數
:
status: 狀態
color: 文字顏色
|
1
2
3
4
5
|
public void StartWeixin()
AndroidControlSDK.AndroidScript 的成員
摘要
:
進入微信
|
1
2
3
4
5
|
public void YaoYiXia()
AndroidControlSDK.AndroidScript 的成員
摘要
:
搖一搖
|
1
2
3
4
5
|
public void StartWeixin()
AndroidControlSDK.AndroidScript 的成員
摘要
:
進入微信
|
1
2
3
4
5
|
public void YaoYiXia()
AndroidControlSDK.AndroidScript 的成員
摘要
:
搖一搖
|