GameAISDK
GameAISDK copied to clipboard
成功跑完demo,有需要的过来看一下
花了1天时间跑上demo了。
首先是windows环境(mac环境还行还不支持本地,Ubuntu又要去装一个系统麻烦); 操作系统是win10;
第一步骤: 在window下,使用git下载GameAISDK源码(避免与linux下的文件格式不一致导致编译问题),例如拉下来保存到D:\GameAISDK.
第二步骤: 安装VS2017 专业版(并激活),并配置到windows系统运行环境
第三步骤: 安装python 3.6.2(勾选pip,勾选for all user) ,并配置到windows系统运行环境 更新pip到最新(python -m pip install --upgrade pip) 安装 pip install PyQt5 安装 pip install opencv-python 安装 pip install QtPy(注意大小写) 安装 pip install psutil 安装 pip install msgpack 安装 pip install msgpack_numpy 安装 pip install protobuf 安装 pip install matplotlib 安装 pip install networkx 安装 pip install zmq 安装 pip install pypiwin32
第四步骤 下载android adb工具,并解压,例如D:\android_adb,并配置到windows系统环境
第五步骤 去D:\GameAISDK\src\ImgProc\Projects\Windows\UIRecognize 下用VS2017打开SDK.h,找到工程里面的GameReg 和UIrecognize 右键点击属性,匹配SDK版本为你当前VS2017带的SDK版本,直接下拉保存即可。
第六步骤: 命令行进入D:\GameAISDK\build,执行bulid.sh完成编译,要编译成功2个文件,不能有失败 出现问题直接看FQA https://github.com/Tencent/GameAISDK/blob/master/doc/opt/FAQ.md
第七步骤 命令行进入D:\GameAISDK\tools\SDKTool 执行python main.py,基本上就能看见SDKtool窗口了。 手机安装好TTPK和打开开发者模式,并授权链接计算机。 SDKtool窗口下加载demo TTPK工程,点击有变动手机序列号就能正常获取手机上的屏幕数据。
其他按照教程上的就可以操作了。
windows 环境需要更换行符
下载https://sourceforge.net/projects/dos2unix/ 命令行运行 for /R %G in (*.c *.cc *.h *.cpp *.inc) do unix2dos "%G"
protobuf 版本问题
我的是因为 vcpkg安装了protobuf ,删除就可以了 vcpkg remove protobuf[core]:x64-windows
大佬 命令行执行的是build.sh还是build.bat?
大佬,还有哪些需要注意的点吗?我是跟你这样子操作的,但是在连接手机时总是会出现连接,然后又断开连接,大概报错是这样子的 [2022-05-27 15:06:47,493][./phone_aiclientapi\WrappedDeviceAPI\deviceAPI\mobileDevice\android\plugin\Platform_plugin\PlatformWeTest\demo\TcpSocketHandler.py:279][DEBUG] : write packet:header { sequenceId: 9529 command: INPUT_HEARTBEAT_REQ }
[2022-05-27 15:06:47,493][./phone_aiclientapi\WrappedDeviceAPI\deviceAPI\mobileDevice\android\plugin\Platform_plugin\PlatformWeTest\demo\TcpSocketHandler.py:190][ERROR] : read packet exception Traceback (most recent call last): File "./phone_aiclientapi\WrappedDeviceAPI\deviceAPI\mobileDevice\android\plugin\Platform_plugin\PlatformWeTest\demo\TcpSocketHandler.py", line 160, in run File "./phone_aiclientapi\WrappedDeviceAPI\deviceAPI\mobileDevice\android\plugin\Platform_plugin\PlatformWeTest\demo\TcpSocketHandler.py", line 325, in read_packet File "./phone_aiclientapi\WrappedDeviceAPI\deviceAPI\mobileDevice\android\plugin\Platform_plugin\PlatformWeTest\demo\TcpSocketHandler.py", line 73, in read_packet_bytes File "./phone_aiclientapi\WrappedDeviceAPI\deviceAPI\mobileDevice\android\plugin\Platform_plugin\PlatformWeTest\demo\TcpSocketHandler.py", line 59, in __read_bytes ConnectionResetError: [WinError 10054] 远程主机强迫关闭了一个现有的连接。 [2022-05-27 15:06:47,493][./phone_aiclientapi\WrappedDeviceAPI\deviceAPI\mobileDevice\android\plugin\Platform_plugin\PlatformWeTest\demo\TcpSocketHandler.py:195][INFO] : reader: put packet MSG_CLOSE_SOCKET [2022-05-27 15:06:47,493][./phone_aiclientapi\WrappedDeviceAPI\deviceAPI\mobileDevice\android\plugin\Platform_plugin\PlatformWeTest\demo\TcpSocketHandler.py:155][DEBUG] : ---wait here [2022-05-27 15:06:47,493][./phone_aiclientapi\WrappedDeviceAPI\deviceAPI\mobileDevice\android\plugin\Platform_plugin\PlatformWeTest\demo\TcpSocketHandler.py:118][INFO] : close socket, clear event [2022-05-27 15:06:47,493][./phone_aiclientapi\WrappedDeviceAPI\deviceAPI\mobileDevice\android\plugin\Platform_plugin\PlatformWeTest\demo\TcpSocketHandler.py:286][INFO] : ############### break here, not flag=True [2022-05-27 15:06:47,513][./phone_aiclientapi\WrappedDeviceAPI\deviceAPI\mobileDevice\android\plugin\Platform_plugin\PlatformWeTest\demo\Initializer.py:132][ERROR] : inputserver run over, return value:1
如果又解决办法可以联系一下QQ:643429173
start service test_node failed, process python agentai.py --mode=test --cfgpath=D:/GameAISDK-master/tools/SDKTool/project/TTKP/TTKP.prj start failed, service_name: test_node error: [] 这个错了怎么办