Git Product home page Git Product logo

texturegroup / weaver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from square/ponydebugger

81.0 10.0 10.0 2.41 MB

Remote debugging for Texture apps using Chrome DevTools

Home Page: http://texturegroup.org

License: Other

Ruby 0.40% Objective-C 35.49% Go 5.29% Python 29.59% CSS 0.21% HTML 0.46% JavaScript 26.25% Objective-C++ 2.31%
ios-ui texture chrome-devtools asyncdisplaykit uikit rendering pinterest

weaver's Introduction

Weaver

Version License Platform

Weaver is a remote debugging tool for Texture apps. It is a client library and gateway server combination that uses Chrome DevTools on your browser to debug your application's layout hierarchy.

Demo video: https://youtu.be/zdACP6dQlQ8

Weaver is a hard fork of PonyDebugger. It was trimmed down and modified to work with layout elements from both UIKit and Texture.

To use Weaver, you must enable the client in your iOS application and connect it to the gateway server called "ponyd".

Quick Start

Install ponyd

  • Prerequisites: Python 2, pip, virtualenv
  1. Create a temporary directory:
$ mkdir ponyd && cd ponyd
  1. Download required dependencies
$ curl -O https://pypi.python.org/packages/11/b6/abcb525026a4be042b486df43905d6893fb04f05aac21c32c638e939e447/pip-9.0.1.tar.gz && \
curl -O https://pypi.python.org/packages/25/5d/cc55d39ac39383dd6e04ae80501b9af3cc455be64740ad68a4e12ec81b00/setuptools-0.6c11-py2.7.egg && \
curl -O https://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/pybonjour/pybonjour-1.1.1.tar.gz && \
tar xvf pybonjour-1.1.1.tar.gz && \
mv pybonjour-1.1.1 pybonjour
  • 2.1. If you're on Ubuntu, you need to install libavahi-compat-libdnssd1 as well:
$ sudo apt-get install libavahi-compat-libdnssd1
  1. Download and run ponyd's boostrap script:
$ curl -s https://raw.githubusercontent.com/TextureGroup/Weaver/master/scripts/bootstrap-ponyd.py | python - --never-download ~/Library/Weaver
  1. Install dependencies
$ ~/Library/Weaver/bin/easy_install -U backports_abc && \
~/Library/Weaver/bin/easy_install -U certifi && \
~/Library/Weaver/bin/easy_install -U singledispatch && \
~/Library/Weaver/bin/easy_install -U pybonjour
  1. Add ponyd symlink
$ sudo mkdir -p /usr/local/bin
$ ln -s ~/Library/Weaver/bin/ponyd /usr/local/bin/ponyd
  1. Install DevTools
$ ponyd update-devtools
  1. Start the ponyd server
$ ponyd serve -i 0.0.0.0 -p 9229

In your browser, navigate to http://localhost:9229. You should see the ponyd lobby. Now you need to integrate the client to your application.

For more detailed instructions, check out the gateway server README_ponyd.

Weaver iOS Client

The Weaver iOS client lets you to debug your application's layout hierarchy.

Technical

  • Requires iOS 8.0 or above
  • Uses ARC (Automatic Reference Counting).
  • Uses SocketRocket as a WebSocket client.

Installing via CocoaPods

Weaver is available on CocoaPods. Add the following to your Podfile:

target 'MyApp' do
  pod 'Texture'
  pod 'Weaver'
end

Quit Xcode completely before running the following command in the project directory

$ pod install

in the project directory in Terminal.

To update your version of Weaver, run the following command in the project directory

$ pod update Weaver

Don't forget to use the workspace .xcworkspace file, not the project .xcodeproj file.

Usage

Weaver's main entry points exist in the WVDebugger singleton.

WVDebugger *debugger = [WVDebugger defaultInstance];

Then enable layout debugging by calling enableLayoutElementDebuggingWithApplication and passing your UIApplication to it:

[debugger enableLayoutElementDebuggingWithApplication:application];

To connect automatically to ponyd on your LAN (via Bonjour):

[debugger autoConnect];

Or to open the connection to a specific host, for instance ws://localhost:9229/device:

[debugger connectToURL:[NSURL URLWithString:@"ws://localhost:9229/device"]];

To manually close the connection:

[debugger disconnect];

Integration example

You can find an example on how to integrate Weaver into an existing app here.

Getting Help

We use Slack for real-time debugging, community updates, and general talk about Texture and Weaver. Signup yourself and join #weaver channel.

Contributing

We welcome any contributions. See the CONTRIBUTING file for how to get involved.

License

The Weaver project was created by Pinterest as a continuation, under a different name, of the PonyDebugger codebase originally developed by Square. PonyDebugger was originally released by Square under the Apache License, Version 2.0. All code contributed to Weaver after 5/15/2017 is released by Pinterest under the same license, Apache 2.0 license (http://www.apache.org/licenses/LICENSE-2.0.html).

Some useful links:

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.