ATX [已解决] 求助贴,使用 atx 后报错 Command 'adb -s G2W7N15510006993 forward --list' returned non-zero exit status 1,困扰好久了,无力解决,求各位大佬帮忙看看

Lemon · 2018年03月13日 · 最后由 Lemon 回复于 2018年03月27日 · 2702 次阅读

#!/usr/bin/python

coding: utf-8

import atx

d = atx.connect()
print('CellPhone serial number:',d.serial)

运行结果

已经解决了,结果是因为自己电脑上有安装了 ansicon 工具,这个工具会影响 utf-8 的编码,删掉之后就正常了

共收到 11 条回复 时间 点赞

init 一下就好了

可能 adb 太多

kukaka 回复

使用 python -m uiautomator2 init init 的时候出现:subprocess.CalledProcessError: Command 'adb -s 127.0.0.1:7555 shell getprop ro.build.version.sdk' returned non-zero exit status 1
但是单独使用 adb -s 127.0.0.1:7555 shell getprop ro.build.version.sdk 可以正常获取系统 api 版本,这个又是怎么回事呢?

codeskyblue 回复

确定只有一个 adb.exe,还是这样

Lemon 回复

你这是模拟器呀,换个真机试试?

codeskyblue 回复

真机也试过,一样的,用的华为 mate7

codeskyblue 回复

大佬,我手动 init 了,但是 weditor 还是连接不上设备,请问这个报错又是什么意思呢?

Lemon 回复

你是不是忘记点 connect 了

codeskyblue 回复

connect 连接不上,提示 Device(192.168.4.157:7912) not attached。
手动 init 使用的这种方法,是对的吗?
 用手机下载 app-uiautomator.apk 和 app-uiautomator-test.apk
 下载对应架构 atx-agent 包(https://github.com/openatx/atx-agent/releases
下载的是:atx-agent_0.2.1_linux_armv7.tar.gz
 可以终端运行 adb shell cat /proc/cpuinfo 查看手机架构

 解压后,在 atx-agent 文件目录运行下面的代码
adb push atx-agent /data/local/tmp
adb shell chmod 755 /data/local/tmp/atx-agent
adb shell /data/local/tmp/atx-agent -d

以上运行完之后手机屏幕闪了一下 “hello world”,这样是成功了吗?

Lemon 回复

你加下 qq 群问吧 497460177

Lemon #11 · 2018年03月27日 Author

已经解决了,结果是因为自己电脑上有安装了 ansicon 工具,这个工具会影响 utf-8 的编码,删掉之后就正常了

需要 登录 后方可回复, 如果你还没有账号请点击这里 注册