Skip to content

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoye committed Jul 12, 2018
0 parents commit c41d548
Show file tree
Hide file tree
Showing 25 changed files with 13,902 additions and 0 deletions.
189 changes: 189 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,189 @@
# Created by .ignore support plugin (hsz.mobi)
### macOS template
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon

# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk
### Python template
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
.hypothesis/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
target/

# Jupyter Notebook
.ipynb_checkpoints

# pyenv
.python-version

# celery beat schedule file
celerybeat-schedule

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
### JetBrains template
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839

.idea/

# User-specific stuff:
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/dictionaries

# Sensitive or high-churn files:
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.xml
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml

# Gradle:
.idea/**/gradle.xml
.idea/**/libraries

# CMake
cmake-build-debug/

# Mongo Explorer plugin:
.idea/**/mongoSettings.xml

## File-based project format:
*.iws

## Plugin-specific files:

# IntelliJ
out/

# mpeltonen/sbt-idea plugin
.idea_modules/

# JIRA plugin
atlassian-ide-plugin.xml

# Cursive Clojure plugin
.idea/replstate.xml

# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties

# lyrebird debug
data/

# vscode
.vscode/
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2018-present, 美团点评

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
2 changes: 2 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
graft lyrebird_ios
recursive-exclude * *.pyc *.pyo *.swo *.swp *.map *.DS_Store
91 changes: 91 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
# Lyrebird iOS Plugin

Lyrebird 是一个基于拦截以及模拟 HTTP/HTTPs 网络请求的面向移动应用的插件化测试平台。iOS Plugin 是其插件之一,您可以在插件中快速查看已连接设备的详细设备信息,截取屏幕快照,以及查看已连接设备的应用信息。

## 特性
* 支持快速截取 iOS 设备屏幕快照
* 在主页您可以快速查看已连接设备的详细信息
* 在应用管理页面可以快速查看已连接设备的应用信息

## 环境要求
- macOS
- [Python >= 3.6](https://www.python.org/downloads/release/python-360/)
- [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice)
- [ideviceinstaller](https://github.com/libimobiledevice/ideviceinstaller)
- [Command Line Tools for Xcode](https://developer.apple.com/download/more/)

## 准备
插件依赖于 libimobiledevice 第三方依赖

- 首先,安装源管理工具 [Homebrew](https://brew.sh/)

- 现在,通过 Homebrew 开始安装 [libimobiledevice](https://github.com/libimobiledevice)

```bash
brew install --HEAD libimobiledevice
brew link --overwrite libimobiledevice
brew install --HEAD ideviceinstaller
brew link --overwrite ideviceinstaller
sudo chmod -R 777 /var/db/lockdown/
```

- 最终,测试第三方依赖是否正常工作

```bash
ideviceinfo
idevicescreenshot
```

## 安装

- 安装 Lyrebird plugin - iOS

```bash
pip3 install lyrebird-ios
```


## 启动

```bash
lyrebird
```

## 预览

<img src="./image/home_page.png" style="width:800px">

## 开发者

1. clone本项目

```
git clone <repo>
```

2. 进入项目目录

```
cd lyrebird-ios
```

3. 创建虚拟环境

```
python3 -m venv venv
```

4. 使用IDE打开工程(推荐Pycharm或vscode)

## 常见问题
#### libimobiledevice 无法使用,终端提示 - "Could not connect to lockdownd ...".
重新安装 libimobiledevice 和 ideviceinstaller, 然后确保在安装完成后,以下命令被执行

`sudo chmod -R 777 /var/db/lockdown/`

> Tips:
>
> 参考解决方案自 [stackoverflow](http://stackoverflow.com/questions/39035415/ideviceinstaller-fails-with-could-not-connect-to-lockdownd-exiting)

#### 截取屏幕快照功能无法正常工作,提示 Could not start screenshot service!
在连接设备之前您必须确保开发者选项可用。通过 [stackoverflow](https://stackoverflow.com/questions/30736932/xcode-error-could-not-find-developer-disk-image) 获取更多解决帮助。
82 changes: 82 additions & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# Lyrebird plugin iOS

The easiest way to manage your iOS devices.

## Feature
* Support for take screenshot.
* Device details are displayed on the Home page.
* App info is displayed on the Application Management page.
* Integration in overbridge.
* Support for adding screenshot attachments to Bugit.

## Required
- macOS
- [Python >= 3.6](https://www.python.org/downloads/release/python-360/)
- [libimobiledevice](https://github.com/libimobiledevice/libimobiledevice)
- [ideviceinstaller](https://github.com/libimobiledevice/ideviceinstaller)
- [Command Line Tools for Xocde](https://developer.apple.com/download/more/)

## Get ready
This plugin currently depends on libimobiledevice to do certain things. Install it with Homebrew.

- First, install [Homebrew](https://brew.sh/).

- Now, you can install [libimobiledevice](https://github.com/libimobiledevice) like this

```bash
$ brew install --HEAD libimobiledevice
$ brew link --overwrite libimobiledevice
$ brew install --HEAD ideviceinstaller
$ brew link --overwrite ideviceinstaller
$ sudo chmod -R 777 /var/db/lockdown/
```

- Now, you can plugged in your iOS device and testing your libimobiledevice commandline tools.

```bash
$ ideviceinfo
$ idevicescreenshot
```

## Get started
- Install Lyrebird plugin - iOS

```
$ pip3 install lyrebird-ios
```
## Preview
![Home Pge](./image/home_page.png)
## For developer
1. Clone repo
```
$ git clone <repo>
```
2. Enter to lyrebird-ios
```
$ cd lyrebird-ios
```
3. Make virtual environment
```
$ python3 -m venv venv
```
4. Open project
## FAQs
#### Some error occurs like this - "Could not connect to lockdownd ...".
Re-install both libimobiledevice and ideviceinstaller, and then make sure below command executed
`$ sudo chmod -R 777 /var/db/lockdown/`
> Tips:
>
> Reference solution on [stackoverflow](http://stackoverflow.com/questions/39035415/ideviceinstaller-fails-with-could-not-connect-to-lockdownd-exiting)
#### Could not use screenshot feature, Could not start screenshotr service!
You must have to mount the developer disk image on your device. See -> [How to enable dev on your device](https://www.jianshu.com/p/a1d075b3472c)
Loading

0 comments on commit c41d548

Please sign in to comment.