Coder Social home page Coder Social logo

web-editor's Introduction

Because it is difficult to reconstruct this project, I wrote a new one. Visit https://uiauto.dev and have a try

WEditor

image image image

中文文档

This project is subproject for smart phone test framework openatx for easily use web browser to edit UI scripts.

Screenshot

screenshot

Installation

Dependencies

Only tested in Google Chrome, IE seems not working well.

pip3 install -U weditor

For developers

git clone https://github.com/openatx/weditor
pip3 install -e weditor

Usage

Create Shortcut in Desktop (Only windows)

weditor --shortcut

By click shortcut or run in command line

weditor

This command will start a local server with port 17310, and then open a browser tab for you to editor you code.

Port 17310 is to memorize the created day -- 2017/03/10

To see more usage run weditor -h

Hotkeys(Both Mac and Win)

  • Right click screen: Dump Hierarchy

Hotkeys(only Mac)

  • Command+Enter: Run the whole code
  • Command+Shift+Enter: Run selected code or current line if not selected

Hotkeys(only Win)

  • Ctrl+Enter: Run the whole code
  • Ctrl+Shift+Enter: Run selected code or current line if not selected

For Developers

See DEVELOP.md

LICENSE

MIT

web-editor's People

Contributors

codeskyblue avatar elseif avatar pinnnkman avatar zeros2619 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

web-editor's Issues

在weditor点击android控件,自动生成的代码不够精准。

weditor版本:0.23
uiautomator2版本:0.33

问题描述:
weditor生成的代码为d.xpath('//android.widget.RelativeLayout/android.widget.LinearLayout[1]'),并且resourceId为空。此控件只是显示文字,使用d.xpath似乎没有get_text()方法,结果一直为空。
之后通过查询页面xml,使用self.d(resourceId="com.XXX.h.XX06:id/tv_devid").get_text()可以获取到控件的文字。此情况需要优化,建议优先使用resourceId。
使用self.d.dump_hierarchy()查询页面情况,对应控件的描述如下:
<node index="0" text="OS&#9;1-1-1" resource-id="com.XXX.h.XX06:id/tv_devid" class="android.widget.TextView" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[204,90][396,157]" />
self.d.dump_hierarchy()页面详细的xml如下
`

<node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,0][600,1024]">

  <node index="0" text="" resource-id="android:id/content" class="android.widget.FrameLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,0][600,1024]">

    <node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,0][600,1024]">

      <node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,0][600,414]">

        <node index="0" text="" resource-id="" class="android.widget.RelativeLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,0][600,248]">

          <node index="0" text="" resource-id="com.XXX.h.XX06:id/iv_netstate" class="android.widget.ImageView" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[20,8][55,43]" />

          <node index="1" text="17:51" resource-id="com.XXX.h.XX06:id/tv_time" class="android.widget.TextView" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[269,5][331,45]" />

          <node index="2" text="2019/08/05" resource-id="com.XXX.h.XX06:id/tv_date" class="android.widget.TextView" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[438,5][570,45]" />

          <node index="3" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[204,90][396,157]">

            <node index="0" text="OS&#9;1-1-1" resource-id="com.XXX.h.XX06:id/tv_devid" class="android.widget.TextView" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[204,90][396,157]" />

          </node>

        </node>

        <node index="1" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,248][600,414]">

          <node index="0" text="" resource-id="com.XXX.h.XX06:id/tv_room_number" class="android.widget.EditText" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="false" focusable="true" focused="true" scrollable="false" long-clickable="true" password="false" selected="false" visible-to-user="true" bounds="[0,277][500,384]" />

          <node index="1" text="" resource-id="com.XXX.h.XX06:id/ll_delete" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[500,248][600,414]" />

        </node>

      </node>

      <node index="1" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,414][600,1024]">

        <node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,414][600,536]">

          <node NAF="true" index="0" text="" resource-id="com.XXX.h.XX06:id/btn_home" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,414][300,536]" />

          <node NAF="true" index="1" text="" resource-id="com.XXX.h.XX06:id/btn_unlock" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[300,414][600,536]" />

        </node>

        <node index="1" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,536][600,902]">

          <node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,536][600,658]">

            <node NAF="true" index="0" text="" resource-id="com.XXX.h.XX06:id/btn_1" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,536][200,658]" />

            <node NAF="true" index="1" text="" resource-id="com.XXX.h.XX06:id/btn_2" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[200,536][400,658]" />

            <node NAF="true" index="2" text="" resource-id="com.XXX.h.XX06:id/btn_3" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[400,536][600,658]" />

          </node>

          <node index="1" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,658][600,780]">

            <node NAF="true" index="0" text="" resource-id="com.XXX.h.XX06:id/btn_4" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,658][200,780]" />

            <node NAF="true" index="1" text="" resource-id="com.XXX.h.XX06:id/btn_5" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[200,658][400,780]" />

            <node NAF="true" index="2" text="" resource-id="com.XXX.h.XX06:id/btn_6" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[400,658][600,780]" />

          </node>

          <node index="2" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,780][600,902]">

            <node NAF="true" index="0" text="" resource-id="com.XXX.h.XX06:id/btn_7" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,780][200,902]" />

            <node NAF="true" index="1" text="" resource-id="com.XXX.h.XX06:id/btn_8" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[200,780][400,902]" />

            <node NAF="true" index="2" text="" resource-id="com.XXX.h.XX06:id/btn_9" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[400,780][600,902]" />

          </node>

        </node>

        <node index="2" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,902][600,1024]">

          <node NAF="true" index="0" text="" resource-id="com.XXX.h.XX06:id/btn_delete" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,902][200,1024]" />

          <node NAF="true" index="1" text="" resource-id="com.XXX.h.XX06:id/btn_0" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[200,902][400,1024]" />

          <node NAF="true" index="2" text="" resource-id="com.XXX.h.XX06:id/btn_call_main" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[400,902][600,1024]" />

        </node>

      </node>

    </node>

  </node>

</node>

`

chrome浏览器界面展示存在问题

image
如图所示,获取后,手机界面会展示在下方。当点击一次后会恢复正常。
环境:mac 10.13.6 chrome 73.0.3683.86
其中使用Safari正常

点击刷新获取页面元素失败

WebDriverAgentRunner-Runner[597:202930] Enqueue Failure: Application local.pid.53 is not running /Users/holysor/Desktop/WebDriverAgent/WebDriverAgentRunner/UITestingUITests.m 37 1

在weditor查看华为Mate20,黑屏,screenshot接口返回304

  • 手机型号: HUAWEI Mate 20, EMUI版本: 9.1.0, Android版本: 9
  • weditor的版本号: 0.2.4
  • 截图:
    image

screenshot接口返回304,如下:
[I 190820 19:27:25 web:2162] 200 POST /api/v1/connect (::1) 24.51ms
[I 190820 19:27:25 page:176] Serial: android:
[I 190820 19:27:25 web:2162] 304 GET /api/v1/devices/android%3A/screenshot (::1) 429.98ms
[I 190820 19:27:25 web:2162] 200 GET /api/v1/devices/android%3A/hierarchy (::1) 298.51ms

termux上安装weditor报错,找不到zlib

报错日志如下:
Collecting pillow
Using cached https://files.pythonhosted.org/packages/51/fe/18125dc680720e4c3086dd3f5f95d80057c41ab98326877fc7d3ff6d0ee5/Pillow-6.1.0.tar.gz
Installing collected packages: pillow
Running setup.py install for pillow: started
Running setup.py install for pillow: finished with status 'error'
ERROR: Complete output from command /data/data/com.termux/files/usr/bin/python -u -c 'import setuptools, tokenize;file='"'"'/data/data/com.termux/files/usr/tmp/pip-install-kpheppxu/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /data/data/com.termux/files/usr/tmp/pip-record-ozp8h9k_/install-record.txt --single-version-externally-managed --compile:
ERROR: running install
running build
running build_py
creating build
creating build/lib.linux-aarch64-3.7
creating build/lib.linux-aarch64-3.7/PIL
copying src/PIL/MpoImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageMode.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PngImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/XbmImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PcxImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/SunImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageFile.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/SpiderImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/TarIO.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/FitsStubImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/MpegImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/BdfFontFile.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/GribStubImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageStat.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PixarImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/GimpPaletteFile.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageColor.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ContainerIO.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/MspImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/MicImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/_version.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImtImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/GifImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PalmImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageQt.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageMath.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PaletteFile.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/FontFile.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PdfParser.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ExifTags.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageCms.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/FpxImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageChops.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/BufrStubImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PSDraw.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PcdImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageFilter.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageDraw2.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImagePath.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/DcxImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/init.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/JpegPresets.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/Hdf5StubImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/features.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageDraw.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/GimpGradientFile.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageWin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/IcoImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/_tkinter_finder.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/EpsImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/TgaImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageMorph.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/Jpeg2KImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/WalImageFile.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PcfFontFile.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/BlpImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageTk.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/GbrImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageOps.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PdfImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageShow.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageEnhance.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/WmfImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageGrab.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/WebPImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/FliImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/TiffTags.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/CurImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/_util.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/GdImageFile.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/TiffImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/IptcImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImagePalette.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/BmpImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageTransform.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/IcnsImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/McIdasImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/XpmImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/DdsImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageSequence.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PyAccess.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/_binary.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/Image.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/main.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/XVThumbImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/SgiImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PsdImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/JpegImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/ImageFont.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/PpmImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
copying src/PIL/FtexImagePlugin.py -> build/lib.linux-aarch64-3.7/PIL
running egg_info
writing src/Pillow.egg-info/PKG-INFO
writing dependency_links to src/Pillow.egg-info/dependency_links.txt
writing top-level names to src/Pillow.egg-info/top_level.txt
reading manifest file 'src/Pillow.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching '.c'
warning: no files found matching '
.h'
warning: no files found matching '.sh'
no previously-included directories found matching 'docs/_static'
warning: no previously-included files found matching '.appveyor.yml'
warning: no previously-included files found matching '.coveragerc'
warning: no previously-included files found matching '.codecov.yml'
warning: no previously-included files found matching '.editorconfig'
warning: no previously-included files found matching '.landscape.yaml'
warning: no previously-included files found matching '.readthedocs.yml'
warning: no previously-included files found matching 'azure-pipelines.yml'
warning: no previously-included files found matching 'tox.ini'
warning: no previously-included files matching '.git
' found anywhere in distribution
warning: no previously-included files matching '.pyc' found anywhere in distribution
warning: no previously-included files matching '
.so' found anywhere in distribution
no previously-included directories found matching '.azure-pipelines'
no previously-included directories found matching '.travis'
writing manifest file 'src/Pillow.egg-info/SOURCES.txt'
running build_ext

The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html

Traceback (most recent call last):
  File "/data/data/com.termux/files/usr/tmp/pip-install-kpheppxu/pillow/setup.py", line 873, in <module>
    zip_safe=not (debug_build() or PLATFORM_MINGW),
  File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/setuptools/__init__.py", line 145, in setup
    return distutils.core.setup(**attrs)
  File "/data/data/com.termux/files/usr/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/data/data/com.termux/files/usr/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/data/data/com.termux/files/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/data/data/com.termux/files/usr/lib/python3.7/site-packages/setuptools/command/install.py", line 61, in run
    return orig.install.run(self)
  File "/data/data/com.termux/files/usr/lib/python3.7/distutils/command/install.py", line 545, in run
    self.run_command('build')
  File "/data/data/com.termux/files/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/data/data/com.termux/files/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/data/data/com.termux/files/usr/lib/python3.7/distutils/command/build.py", line 135, in run
    self.run_command(cmd_name)
  File "/data/data/com.termux/files/usr/lib/python3.7/distutils/cmd.py", line 313, in run_command
    self.distribution.run_command(command)
  File "/data/data/com.termux/files/usr/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/data/data/com.termux/files/usr/lib/python3.7/distutils/command/build_ext.py", line 340, in run
    self.build_extensions()
  File "/data/data/com.termux/files/usr/tmp/pip-install-kpheppxu/pillow/setup.py", line 674, in build_extensions
    raise RequiredDependencyException(f)
__main__.RequiredDependencyException: zlib

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/data/data/com.termux/files/usr/tmp/pip-install-kpheppxu/pillow/setup.py", line 888, in <module>
    raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:

The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.

Please see the install instructions at:
   https://pillow.readthedocs.io/en/latest/installation.html


----------------------------------------

ERROR: Command "/data/data/com.termux/files/usr/bin/python -u -c 'import setuptools, tokenize;file='"'"'/data/data/com.termux/files/usr/tmp/pip-install-kpheppxu/pillow/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' install --record /data/data/com.termux/files/usr/tmp/pip-record-ozp8h9k_/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /data/data/com.termux/files/usr/tmp/pip-install-kpheppxu/pillow/

我使用adb转发7912端口到本机的8803端口

我使用adb转发7912端口到本机的8803端口,但使用浏览器能正常访问127.0.0.1:8803端口,我使用weditor尝试连接127.0.0.1:8803端口,但提示连接不上,请问我该如何解决这个问题....

我在用安卓手机测试 当页面出现跳转时就报这个错,求解

C:\Users\qinghua>python -m weditor
listen port 17310
[W 170610 12:14:31 web:1946] 404 GET /api/v1/contents/main.py (::1) 1.00ms
[I 170610 12:14:31 web:1946] 304 GET /api/v1/version (::1) 1.00ms
SN default
[I 170610 12:14:43 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:14:44 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:14:45 web:1946] 200 GET /api/v1/devices/default/screenshot (::1) 2232.00ms
[I 170610 12:14:45 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:14:46 web:1946] 200 GET /api/v1/devices/default/uiview (::1) 151.00ms
SN default
[I 170610 12:17:18 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:17:18 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:17:20 web:1946] 200 GET /api/v1/devices/default/screenshot (::1) 2257.00ms
[I 170610 12:17:20 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:17:20 web:1946] 200 GET /api/v1/devices/default/uiview (::1) 138.00ms
[W 170610 12:31:26 web:1946] 404 GET /api/v1/contents/main.py (::1) 1.00ms
[I 170610 12:31:26 web:1946] 304 GET /api/v1/version (::1) 1.00ms
SN default
[I 170610 12:31:27 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:31:27 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
2017-06-10 12:31:27.946 WARN [atx.drivers.mixin: 390] warning, screenshot failed [2/1], retry again
[I 170610 12:31:28 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:31:28 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\weditor_main_.py", line 123, in get
d.screenshot().save(buffer, format='JPEG')
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 62, in _inner
_retval = fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 391, in screenshot
screen = self._take_screenshot()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 282, in _take_screenshot
screen = self._screenshot_uiauto()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 254, in screenshot_uiauto
raise IOError("Screenshot use uiautomator failed.")
IOError: Screenshot use uiautomator failed.
[W 170610 12:31:28 web:1946] 430 GET /api/v1/devices/default/screenshot (::1) 1147.00ms
SN default
[I 170610 12:31:32 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:31:33 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
2017-06-10 12:31:33.202 WARN [atx.drivers.mixin: 390] warning, screenshot failed [2/1], retry again
[I 170610 12:31:33 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:31:33 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\weditor_main
.py", line 123, in get
d.screenshot().save(buffer, format='JPEG')
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 62, in _inner
_retval = fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 391, in screenshot
screen = self._take_screenshot()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 282, in _take_screenshot
screen = self._screenshot_uiauto()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 254, in screenshot_uiauto
raise IOError("Screenshot use uiautomator failed.")
IOError: Screenshot use uiautomator failed.
[W 170610 12:31:33 web:1946] 430 GET /api/v1/devices/default/screenshot (::1) 989.00ms
SN default
[I 170610 12:31:38 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:31:38 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
2017-06-10 12:31:38.652 WARN [atx.drivers.mixin: 390] warning, screenshot failed [2/1], retry again
[I 170610 12:31:38 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:31:39 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\weditor_main
.py", line 123, in get
d.screenshot().save(buffer, format='JPEG')
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 62, in _inner
_retval = fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 391, in screenshot
screen = self._take_screenshot()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 282, in _take_screenshot
screen = self._screenshot_uiauto()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 254, in screenshot_uiauto
raise IOError("Screenshot use uiautomator failed.")
IOError: Screenshot use uiautomator failed.
[W 170610 12:31:39 web:1946] 430 GET /api/v1/devices/default/screenshot (::1) 1106.00ms
[W 170610 12:31:55 web:1946] 404 GET /api/v1/contents/main.py (::1) 0.00ms
[I 170610 12:31:55 web:1946] 304 GET /api/v1/version (::1) 1.00ms
SN default
[I 170610 12:32:05 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:06 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
2017-06-10 12:32:06.059 WARN [atx.drivers.mixin: 390] warning, screenshot failed [2/1], retry again
[I 170610 12:32:06 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:06 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\weditor_main
.py", line 123, in get
d.screenshot().save(buffer, format='JPEG')
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 62, in _inner
_retval = fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 391, in screenshot
screen = self._take_screenshot()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 282, in _take_screenshot
screen = self._screenshot_uiauto()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 254, in screenshot_uiauto
raise IOError("Screenshot use uiautomator failed.")
IOError: Screenshot use uiautomator failed.
[W 170610 12:32:06 web:1946] 430 GET /api/v1/devices/default/screenshot (::1) 1113.00ms
[W 170610 12:32:29 web:1946] 404 GET /api/v1/contents/main.py (::1) 1.00ms
[I 170610 12:32:29 web:1946] 304 GET /api/v1/version (::1) 0.00ms
SN default
[I 170610 12:32:33 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:33 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
2017-06-10 12:32:33.700 WARN [atx.drivers.mixin: 390] warning, screenshot failed [2/1], retry again
[I 170610 12:32:33 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:34 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\weditor_main
.py", line 123, in get
d.screenshot().save(buffer, format='JPEG')
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 62, in _inner
_retval = fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 391, in screenshot
screen = self._take_screenshot()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 282, in _take_screenshot
screen = self._screenshot_uiauto()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 254, in screenshot_uiauto
raise IOError("Screenshot use uiautomator failed.")
IOError: Screenshot use uiautomator failed.
[W 170610 12:32:34 web:1946] 430 GET /api/v1/devices/default/screenshot (::1) 1110.00ms
SN default
[I 170610 12:32:50 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:50 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:51 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:51 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:51 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:51 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:51 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:51 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:51 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:52 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:52 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
2017-06-10 12:32:52.403 WARN [atx.drivers.mixin: 390] warning, screenshot failed [2/1], retry again
[I 170610 12:32:52 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:32:52 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\weditor_main
.py", line 123, in get
d.screenshot().save(buffer, format='JPEG')
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 62, in _inner
_retval = fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 391, in screenshot
screen = self._take_screenshot()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 282, in _take_screenshot
screen = self._screenshot_uiauto()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 254, in screenshot_uiauto
raise IOError("Screenshot use uiautomator failed.")
IOError: Screenshot use uiautomator failed.
[W 170610 12:32:52 web:1946] 430 GET /api/v1/devices/default/screenshot (::1) 3699.00ms
[W 170610 12:38:30 web:1946] 404 GET /api/v1/contents/main.py (::1) 1.00ms
[I 170610 12:38:30 web:1946] 304 GET /api/v1/version (::1) 0.00ms
SN default
[I 170610 12:38:32 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:38:32 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
2017-06-10 12:38:32.951 WARN [atx.drivers.mixin: 390] warning, screenshot failed [2/1], retry again
[I 170610 12:38:33 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
[I 170610 12:38:33 connectionpool:203] Starting new HTTP connection (1): 127.0.0.1
Traceback (most recent call last):
File "C:\Python27\lib\site-packages\weditor_main
.py", line 123, in get
d.screenshot().save(buffer, format='JPEG')
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 62, in _inner
_retval = fn(*args, **kwargs)
File "C:\Python27\lib\site-packages\atx\drivers\mixin.py", line 391, in screenshot
screen = self._take_screenshot()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 282, in _take_screenshot
screen = self._screenshot_uiauto()
File "C:\Python27\lib\site-packages\atx\drivers\android.py", line 254, in _screenshot_uiauto
raise IOError("Screenshot use uiautomator failed.")
IOError: Screenshot use uiautomator failed.
[W 170610 12:38:33 web:1946] 430 GET /api/v1/devices/default/screenshot (::1) 1114.00ms

image

android4.4.2 模拟器上无法正常联接使用

1.启动模拟器android4.4.2
2.打开WEditor,选择android,输入emulator-5554,点击connect连接模拟器
3.点击reload ,等一段时间后,报错显示“HTTPConnectionPool(host='127.0.0.1', port=50385): Read timed out. (read timeout=10)” ‘cannot identify image file <_io.BytesIO object at 0x0A4859F0>’
4.模拟器会自动重启

在weditor点击android控件,自动生成的代码不够精准。

weditor版本:0.23
uiautomator2版本:0.33

问题描述:
weditor生成的代码为d.xpath('//android.widget.RelativeLayout/android.widget.LinearLayout[1]'),并且resourceId为空。此控件只是显示文字,使用d.xpath似乎没有get_text()方法,结果一直为空。
之后通过查询页面xml,使用self.d(resourceId="com.XXX.h.XX06:id/tv_devid").get_text()可以获取到控件的文字。此情况需要优化,建议优先使用resourceId。
使用self.d.dump_hierarchy()查询页面情况,对应控件的描述如下:
<node index="0" text="OS&#9;1-1-1" resource-id="com.XXX.h.XX06:id/tv_devid" class="android.widget.TextView" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[204,90][396,157]" />
self.d.dump_hierarchy()页面详细的xml如下
`

<node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,0][600,1024]">

  <node index="0" text="" resource-id="android:id/content" class="android.widget.FrameLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,0][600,1024]">

    <node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,0][600,1024]">

      <node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,0][600,414]">

        <node index="0" text="" resource-id="" class="android.widget.RelativeLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,0][600,248]">

          <node index="0" text="" resource-id="com.XXX.h.XX06:id/iv_netstate" class="android.widget.ImageView" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[20,8][55,43]" />

          <node index="1" text="17:51" resource-id="com.XXX.h.XX06:id/tv_time" class="android.widget.TextView" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[269,5][331,45]" />

          <node index="2" text="2019/08/05" resource-id="com.XXX.h.XX06:id/tv_date" class="android.widget.TextView" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[438,5][570,45]" />

          <node index="3" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[204,90][396,157]">

            <node index="0" text="OS&#9;1-1-1" resource-id="com.XXX.h.XX06:id/tv_devid" class="android.widget.TextView" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[204,90][396,157]" />

          </node>

        </node>

        <node index="1" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,248][600,414]">

          <node index="0" text="" resource-id="com.XXX.h.XX06:id/tv_room_number" class="android.widget.EditText" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="false" focusable="true" focused="true" scrollable="false" long-clickable="true" password="false" selected="false" visible-to-user="true" bounds="[0,277][500,384]" />

          <node index="1" text="" resource-id="com.XXX.h.XX06:id/ll_delete" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[500,248][600,414]" />

        </node>

      </node>

      <node index="1" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,414][600,1024]">

        <node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,414][600,536]">

          <node NAF="true" index="0" text="" resource-id="com.XXX.h.XX06:id/btn_home" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,414][300,536]" />

          <node NAF="true" index="1" text="" resource-id="com.XXX.h.XX06:id/btn_unlock" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[300,414][600,536]" />

        </node>

        <node index="1" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,536][600,902]">

          <node index="0" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,536][600,658]">

            <node NAF="true" index="0" text="" resource-id="com.XXX.h.XX06:id/btn_1" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,536][200,658]" />

            <node NAF="true" index="1" text="" resource-id="com.XXX.h.XX06:id/btn_2" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[200,536][400,658]" />

            <node NAF="true" index="2" text="" resource-id="com.XXX.h.XX06:id/btn_3" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[400,536][600,658]" />

          </node>

          <node index="1" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,658][600,780]">

            <node NAF="true" index="0" text="" resource-id="com.XXX.h.XX06:id/btn_4" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,658][200,780]" />

            <node NAF="true" index="1" text="" resource-id="com.XXX.h.XX06:id/btn_5" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[200,658][400,780]" />

            <node NAF="true" index="2" text="" resource-id="com.XXX.h.XX06:id/btn_6" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[400,658][600,780]" />

          </node>

          <node index="2" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,780][600,902]">

            <node NAF="true" index="0" text="" resource-id="com.XXX.h.XX06:id/btn_7" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,780][200,902]" />

            <node NAF="true" index="1" text="" resource-id="com.XXX.h.XX06:id/btn_8" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[200,780][400,902]" />

            <node NAF="true" index="2" text="" resource-id="com.XXX.h.XX06:id/btn_9" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[400,780][600,902]" />

          </node>

        </node>

        <node index="2" text="" resource-id="" class="android.widget.LinearLayout" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="false" enabled="true" focusable="false" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,902][600,1024]">

          <node NAF="true" index="0" text="" resource-id="com.XXX.h.XX06:id/btn_delete" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[0,902][200,1024]" />

          <node NAF="true" index="1" text="" resource-id="com.XXX.h.XX06:id/btn_0" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[200,902][400,1024]" />

          <node NAF="true" index="2" text="" resource-id="com.XXX.h.XX06:id/btn_call_main" class="android.widget.Button" package="com.XXX.h.XX06" content-desc="" checkable="false" checked="false" clickable="true" enabled="true" focusable="true" focused="false" scrollable="false" long-clickable="false" password="false" selected="false" visible-to-user="true" bounds="[400,902][600,1024]" />

        </node>

      </node>

    </node>

  </node>

</node>

`

Connection reset by peer

当尝试连接设备时报错:

('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

dump hierarchy error

连接mumu模拟器时,connect后,点击dump hierarchy,出现提示:
local server not started, start with python -m weditor
weditor并未退出,命令行提示:
`[I 190701 17:00:45 web:2246] 200 GET /api/v1/devices/android%3A127.0.0.1%3A7555/screenshot (::1) 4677.18ms
[W 190701 17:00:45 session:477] request error: 404 page not found

[E 190701 17:00:45 web:1788] Uncaught exception GET /api/v1/devices/android%3A127.0.0.1%3A7555/hierarchy (::1)
HTTPServerRequest(protocol='http', host='localhost:17310', method='GET', uri='/api/v1/devices/android%3A127.0.0.1%3A7555/hierarchy', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "C:\Users\hg\AppData\Local\Programs\Python\Python37\lib\site-packages\tornado\web.py", line 1697, in _execute
result = method(*self.path_args, **self.path_kwargs)
File "C:\Users\hg\AppData\Local\Programs\Python\Python37\lib\site-packages\weditor\web\handlers\page.py", line 171, in get
self.write(d.dump_hierarchy())
File "C:\Users\hg\AppData\Local\Programs\Python\Python37\lib\site-packages\weditor\web\device.py", line 17, in dump_hierarchy
return uidumplib.get_android_hierarchy(self._d)
File "C:\Users\hg\AppData\Local\Programs\Python\Python37\lib\site-packages\weditor\web\uidumplib.py", line 107, in get_android_hierarchy
page_xml = d.dump_hierarchy(compressed=False, pretty=False).encode('utf-8')
File "C:\Users\hg\AppData\Local\Programs\Python\Python37\lib\site-packages\uiautomator2\session.py", line 475, in dump_hierarchy
res.raise_for_status()
File "C:\Users\hg\AppData\Local\Programs\Python\Python37\lib\site-packages\requests\models.py", line 940, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 404 Client Error: Not Found for url: http://127.0.0.1:58622/dump/hierarchy
[E 190701 17:00:45 web:2246] 500 GET /api/v1/devices/android%3A127.0.0.1%3A7555/hierarchy (::1) 25.38ms`

Uncaught exception GET /api/v1/devices/9bbce60b-648e-406d-a521-e87b959e0f57/hierarchy

[E 180511 13:04:43 web:1590] Uncaught exception GET /api/v1/devices/9bbce60b-648e-406d-a521-e87b959e0f57/hierarchy (::1)
    HTTPServerRequest(protocol='http', host='localhost:17310', method='GET', uri='/api/v1/devices/9bbce60b-648e-406d-a521-e87b959e0f57/hierarchy', version='HTTP/1.1', remote_ip='::1', headers={'Origin': 'http://atx.open.netease.com', 'Accept-Language': 'zh-cn', 'Accept-Encoding': 'gzip, deflate', 'Host': 'localhost:17310', 'Accept': 'application/json, text/javascript, */*; q=0.01', 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/604.5.6 (KHTML, like Gecko) Version/11.0.3 Safari/604.5.6', 'Connection': 'keep-alive', 'Referer': 'http://atx.open.netease.com/'})
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/site-packages/tornado/web.py", line 1509, in _execute
        result = method(*self.path_args, **self.path_kwargs)
      File "/usr/local/lib/python2.7/site-packages/weditor/__main__.py", line 271, in get
        self.write(uidumplib.get_ios_hierarchy(d))
      File "/usr/local/lib/python2.7/site-packages/weditor/uidumplib.py", line 126, in get_ios_hierarchy
        sourcejson = d._wda.source(format='json')
    TypeError: source() got an unexpected keyword argument 'format'

WDA的source方法是这样的

def source(self, accessible=False):
        if accessible:
            return self._request('/wda/accessibleSource', 'GET').value
        return self._request('source', 'GET').value

貌似不能接收format啊?

def get_ios_hierarchy(d):
    sourcejson = d._wda.source()
    def travel(node):
        node['id'] = str(uuid.uuid4())
        if node.get('rect'):
            rect = node['rect']
            nrect = {}
            for k, v in rect.items():
                nrect[k] = v*d.scale
            node['rect'] = nrect
            
        for child in node.get('children', []):
            travel(child)
        return node

    return travel(sourcejson)

而且这里的node我获得的是一个unicode格式对象,并不是字典?

pip install --pre --upgrade weditor安装失败

您好:
我升级weditor之后,安装失败就无法再打开weditor了,如下,请指导,谢谢!

pip install --pre --upgrade weditor
Collecting weditor
Requirement already up-to-date: six in d:\python27\lib\site-packages (from weditor)
Requirement already up-to-date: futures==3.0.5 in d:\python27\lib\site-packages (from weditor)
Requirement already up-to-date: tornado>=4.3 in d:\python27\lib\site-packages (from weditor)
Collecting atx>=1.1.1.dev47 (from weditor)
Using cached atx-1.2.1.dev1-py2-none-any.whl
Requirement already up-to-date: singledispatch in d:\python27\lib\site-packages (from tornado>=4.3->weditor)
Requirement already up-to-date: backports-abc>=0.4 in d:\python27\lib\site-packages (from tornado>=4.3->weditor)
Requirement already up-to-date: facebook-wda>=0.2.0 in d:\python27\lib\site-packages (from atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: tqdm==4.5.0 in d:\python27\lib\site-packages (from atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: uiautomator2 in d:\python27\lib\site-packages (from atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: aircv==1.4.6 in d:\python27\lib\site-packages (from atx>=1.1.1.dev47->weditor)
Collecting imageio>=1.5 (from atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: maproxy==0.0.12 in d:\python27\lib\site-packages (from atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: PyYAML==3.11 in d:\python27\lib\site-packages (from atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: subprocess32==3.2.7; python_version <= "2.7" in d:\python27\lib\site-packages (from atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: AxmlParserPY==0.0.3 in d:\python27\lib\site-packages (from atx>=1.1.1.dev47->weditor)
Collecting numpy>=1.11.0 (from atx>=1.1.1.dev47->weditor)
Using cached numpy-1.14.0-cp27-none-win_amd64.whl
Requirement already up-to-date: requests>=2.9.1 in d:\python27\lib\site-packages (from atx>=1.1.1.dev47->weditor)
Collecting colorama>=0.3.7 (from atx>=1.1.1.dev47->weditor)
Using cached colorama-0.3.9-py2.py3-none-any.whl
Collecting Pillow>=2.7.0 (from atx>=1.1.1.dev47->weditor)
Using cached Pillow-5.0.0-cp27-cp27m-win_amd64.whl
Requirement already up-to-date: humanize in d:\python27\lib\site-packages (from uiautomator2->atx>=1.1.1.dev47->weditor)

Requirement already up-to-date: progress>=1.3 in d:\python27\lib\site-packages (from uiautomator2->atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: retry>=0.9.2 in d:\python27\lib\site-packages (from uiautomator2->atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: fire in d:\python27\lib\site-packages (from uiautomator2->atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: urllib3<1.23,>=1.21.1 in d:\python27\lib\site-packages (from requests>=2.9.1->atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: idna<2.7,>=2.5 in d:\python27\lib\site-packages (from requests>=2.9.1->atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: chardet<3.1.0,>=3.0.2 in d:\python27\lib\site-packages (from requests>=2.9.1->atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: certifi>=2017.4.17 in d:\python27\lib\site-packages (from requests>=2.9.1->atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: decorator>=3.4.2 in d:\python27\lib\site-packages (from retry>=0.9.2->uiautomator2->atx>=1.1.1.dev47->weditor)
Requirement already up-to-date: py<2.0.0,>=1.4.26 in d:\python27\lib\site-packages (from retry>=0.9.2->uiautomator2->atx>=1.1.1.dev47->weditor)
Installing collected packages: numpy, Pillow, imageio, colorama, atx, weditor
Found existing installation: numpy 1.13.0
Uninstalling numpy-1.13.0:
Successfully uninstalled numpy-1.13.0
Rolling back uninstall of numpy
Exception:
Traceback (most recent call last):
File "d:\python27\lib\site-packages\pip\basecommand.py", line 215, in main
status = self.run(options, args)
File "d:\python27\lib\site-packages\pip\commands\install.py", line 342, in run
prefix=options.prefix_path,
File "d:\python27\lib\site-packages\pip\req\req_set.py", line 790, in install
requirement.rollback_uninstall()
File "d:\python27\lib\site-packages\pip\req\req_install.py", line 759, in rollback_uninstall
self.uninstalled.rollback()
File "d:\python27\lib\site-packages\pip\req\req_uninstall.py", line 135, in rollback
renames(tmp_path, path)
File "d:\python27\lib\site-packages\pip\utils_init_.py", line 267, in renames
shutil.move(old, new)
File "d:\python27\lib\shutil.py", line 302, in move
copy2(src, real_dst)
File "d:\python27\lib\shutil.py", line 130, in copy2
copyfile(src, dst)
File "d:\python27\lib\shutil.py", line 83, in copyfile
with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: 'd:\python27\lib\site-packages\numpy\core\multiarray.pyd'

你好,我录制的时候连上手机录制,但是无法run,会报这个错

d = atx.connect()
d(text="登录/注册").click()
recv subprocess: 'Traceback (most recent call last):\n'
recv subprocess: ' File "", line 3, in \n'
recv subprocess: ' File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/atx/init.py", line 77, in connect\n'
recv subprocess: ' c = cls(connect_url, **kwargs)\n'
recv subprocess: ' File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/atx/drivers/android.py", line 87, in init\n'
recv subprocess: ' self._adb_device = self._adb_client.device(serialno)\n'
recv subprocess: ' File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/atx/adbkit/client.py", line 130, in device\n'
recv subprocess: ' raise EnvironmentError("Device(%s) not attached." % serial)\n'
recv subprocess: 'EnvironmentError: Device(default) not attached.\n'
Websocket closed

WIN10 64位,无法启动

python -m weditor
Traceback (most recent call last):
File "D:\Python\Python35\lib\runpy.py", line 170, in _run_module_as_main
"main", mod_spec)
File "D:\Python\Python35\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "D:\Python\Python35\lib\site-packages\weditor_main
.py", line 22, in
import tornado.ioloop
File "D:\Python\Python35\lib\site-packages\tornado\ioloop.py", line 44, in
from tornado.concurrent import (
File "D:\Python\Python35\lib\site-packages\tornado\concurrent.py", line 34, in
from tornado.log import app_log
File "D:\Python\Python35\lib\site-packages\tornado\log.py", line 34, in
from tornado.escape import _unicode
File "D:\Python\Python35\lib\site-packages\tornado\escape.py", line 27, in
from tornado.util import unicode_type
File "D:\Python\Python35\lib\site-packages\tornado\util.py", line 21, in
from typing import (
ImportError: cannot import name 'Type'

api/v1/devices/aafcfc06-b0d1-430c-808a-ec834d13532c/screenshot 430 error

python:2.7.15
PIL:1.1.7
Pillow:5.2.0
weditor:0.0.4.dev17
错误信息:

Request URL: http://localhost:17310/api/v1/devices/aafcfc06-b0d1-430c-808a-ec834d13532c/screenshot
Request Method: GET

Status Code: 430 Environment Error

错误堆栈信息:

Traceback (most recent call last):
  File "D:\Program Files\Python2.7.5\lib\site-packages\weditor\__main__.py", lin
e 137, in get
    d.screenshot().convert("RGB").save(buffer, format='JPEG')
  File "D:\Program Files\Python2.7.5\lib\site-packages\PIL\Image.py", line 1439,
 in save
    save_handler(self, fp, filename)
  File "D:\Program Files\Python2.7.5\lib\site-packages\PIL\JpegImagePlugin.py",
line 471, in _save
    ImageFile._save(im, fp, [("jpeg", (0,0)+im.size, 0, rawmode)])
  File "D:\Program Files\Python2.7.5\lib\site-packages\PIL\ImageFile.py", line 4
76, in _save
    fh = fp.fileno()
UnsupportedOperation: fileno

描述:
点击connect连接上设备后,再点击reload出错

Python2.7.12使用weditor报SyntaxError: invalid syntax

cmd执行python -m weditor报错SyntaxError: invalid syntax
C:\Python27\Scripts>python -m weditor
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in run_code
exec code in run_globals
File "C:\Python27\lib\site-packages\weditor_main
.py", line 22, in

import tornado.ioloop

File "C:\Python27\lib\site-packages\tornado\ioloop.py", line 67
def fileno(self) -> int:
^
SyntaxError: invalid syntax

启动不了 出错

E:\PythonWorkSpace>python -m weditor
Traceback (most recent call last):
File "E:\Python\lib\runpy.py", line 193, in run_module_as_main
"main", mod_spec)
File "E:\Python\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "E:\Python\Lib\site-packages\weditor_main
.py", line 23, in
from concurrent.futures import ThreadPoolExecutor
File "E:\Python\Lib\site-packages\concurrent\futures_init
.py", line 8, in
from concurrent.futures._base import (FIRST_COMPLETED,
File "E:\Python\Lib\site-packages\concurrent\futures_base.py", line 357
raise type(self._exception), self._exception, self._traceback
^
SyntaxError: invalid syntax

win7 64为,python34 安装失败

使用win7 64位系统,python版本为:3.4.3 PIP版本为:19.1
执行pip install --pre --upgrade weditor失败,不能成功安装,是因为不支持python3.4版本吗?
错误如下:
DEPRECATION: Python 3.4 support has been deprecated. pip 19.1 will be the last o
ne supporting it. Please upgrade your Python as Python 3.4 won't be maintained a
fter March 2019 (cf PEP 429).
Collecting weditor
Using cached https://files.pythonhosted.org/packages/3c/a4/ada9d143126fec45b54
e745eb26631d9b87c0342251e1190bafa977718dc/weditor-0.1.1.tar.gz
ERROR: Complete output from command python setup.py egg_info:
ERROR:
Installed c:\users\s10575\appdata\local\temp\pip-install-g856rq6f\weditor.e
ggs\pbr-5.1.3-py3.4.egg
E:\Python34\Lib\site-packages\pkg_resources_init_.py:2510: PEP440Warning:
'pbr (0.5.2.5.g5b3e942)' is being parsed as a legacy, non PEP 440, version. You
may find odd behavior and sort order. In particular it will be sorted as less t
han 0.0. It is recommend to migrate to PEP 440 compatible versions.
PEP440Warning,
E:\Python34\Lib\distutils\dist.py:260: UserWarning: Unknown distribution opt
ion: 'project_urls'
warnings.warn(msg)
E:\Python34\Lib\distutils\dist.py:260: UserWarning: Unknown distribution opt
ion: 'long_description_content_type'
warnings.warn(msg)
Marker evaluation failed, see the following error. For more information see
: http://docs.openstack.org/pbr/latest/user/using.html#environment-markers
ERROR:root:Error parsing
Traceback (most recent call last):
File "E:\Python34\Lib\site-packages\pkg_resources_init_.py", line 1447,
in comparison
cop = cls.get_op(cop)
File "E:\Python34\Lib\site-packages\pkg_resources_init_.py", line 1467,
in get_op
return ops[op]
KeyError: '<='

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "c:\users\s10575\appdata\local\temp\pip-install-g856rq6f\weditor\.egg

s\pbr-5.1.3-py3.4.egg\pbr\core.py", line 96, in pbr
attrs = util.cfg_to_args(path, dist.script_args)
File "c:\users\s10575\appdata\local\temp\pip-install-g856rq6f\weditor.egg
s\pbr-5.1.3-py3.4.egg\pbr\util.py", line 258, in cfg_to_args
kwargs = setup_cfg_to_setup_kwargs(config, script_args)
File "c:\users\s10575\appdata\local\temp\pip-install-g856rq6f\weditor.egg
s\pbr-5.1.3-py3.4.egg\pbr\util.py", line 456, in setup_cfg_to_setup_kwargs
if pkg_resources.evaluate_marker('(%s)' % env_marker):
File "E:\Python34\Lib\site-packages\pkg_resources_init_.py", line 1481,
in evaluate_marker
return cls.interpret(parser.expr(text).totuple(1)[1])
File "E:\Python34\Lib\site-packages\pkg_resources_init_.py", line 1515,
in interpret
return op(nodelist)
File "E:\Python34\Lib\site-packages\pkg_resources_init_.py", line 1429,
in atom
return cls.interpret(nodelist[2])
File "E:\Python34\Lib\site-packages\pkg_resources_init_.py", line 1515,
in interpret
return op(nodelist)
File "E:\Python34\Lib\site-packages\pkg_resources_init_.py", line 1450,
in comparison
raise SyntaxError(msg)
File "", line None
SyntaxError: '<=' operator not allowed in environment markers
error in setup command: Error parsing C:\Users\s10575\AppData\Local\Temp\pip
-install-g856rq6f\weditor\setup.cfg: SyntaxError: '<=' operator not allowed in e
nvironment markers
----------------------------------------
ERROR: Command "python setup.py egg_info" failed with error code 1 in C:\Users\s
10575\AppData\Local\Temp\pip-install-g856rq6f\weditor\

是否通过wifi连接?

[I 180103 16:00:06 web:2063] 304 GET /api/v1/version (::1) 1.79ms
[I 180103 16:00:09 web:2063] 200 POST /api/v1/connect (::1) 107.96ms
SN 3039ec4f-443a-4d6f-a079-9336c5d26500
Traceback (most recent call last):
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 357, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/connection.py", line 166, in connect
    conn = self._new_conn()
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x1152ef2e8>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='d9d53d2e', port=7912): Max retries exceeded with url: /screenshot/0 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1152ef2e8>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/weditor/__main__.py", line 134, in get
    d.screenshot().convert("RGB").save(buffer, format='JPEG')
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/uiautomator2/__init__.py", line 668, in screenshot
    r = requests.get(self.server.screenshot_uri)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='d9d53d2e', port=7912): Max retries exceeded with url: /screenshot/0 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x1152ef2e8>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))
[W 180103 16:00:12 web:2063] 430 GET /api/v1/devices/3039ec4f-443a-4d6f-a079-9336c5d26500/screenshot (::1) 30.53ms
^Cexiting...
exit success
edsiondeMacBook-Pro:yyb edsion$ python -m weditor 17310
listen port 17310
[I 180103 16:02:06 web:2063] 304 GET /api/v1/version (::1) 2.25ms
[I 180103 16:02:09 web:2063] 200 POST /api/v1/connect (::1) 85.90ms
SN 1722a09c-067d-4502-b4e8-5672730b7189
Traceback (most recent call last):
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/connection.py", line 141, in _new_conn
    (self.host, self.port), self.timeout, **extra_kw)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/util/connection.py", line 60, in create_connection
    for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/socket.py", line 745, in getaddrinfo
    for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 601, in urlopen
    chunked=chunked)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 357, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/http/client.py", line 1239, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/http/client.py", line 1285, in _send_request
    self.endheaders(body, encode_chunked=encode_chunked)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/http/client.py", line 1234, in endheaders
    self._send_output(message_body, encode_chunked=encode_chunked)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/http/client.py", line 1026, in _send_output
    self.send(msg)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/http/client.py", line 964, in send
    self.connect()
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/connection.py", line 166, in connect
    conn = self._new_conn()
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/connection.py", line 150, in _new_conn
    self, "Failed to establish a new connection: %s" % e)
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPConnection object at 0x10f5832e8>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/requests/adapters.py", line 440, in send
    timeout=timeout
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/connectionpool.py", line 639, in urlopen
    _stacktrace=sys.exc_info()[2])
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/urllib3/util/retry.py", line 388, in increment
    raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPConnectionPool(host='d9d53d2e', port=7912): Max retries exceeded with url: /screenshot/0 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10f5832e8>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/weditor/__main__.py", line 134, in get
    d.screenshot().convert("RGB").save(buffer, format='JPEG')
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/uiautomator2/__init__.py", line 668, in screenshot
    r = requests.get(self.server.screenshot_uri)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/requests/api.py", line 72, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/requests/api.py", line 58, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/requests/sessions.py", line 508, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/requests/sessions.py", line 618, in send
    r = adapter.send(request, **kwargs)
  File "/Users/edsion/.pyenv/versions/3.6.3/lib/python3.6/site-packages/requests/adapters.py", line 508, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPConnectionPool(host='d9d53d2e', port=7912): Max retries exceeded with url: /screenshot/0 (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x10f5832e8>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',))
[W 180103 16:02:11 web:2063] 430 GET /api/v1/devices/1722a09c-067d-4502-b4e8-5672730b7189/screenshot (::1) 17.97ms

错误信息如上,是否因为我的pc和手机不在同一网段(不同网段之间网络隔离)导致的?怎么才能走USB呢

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.