Skip to content

Commit

Permalink
Feature/iPhoneXs support (#26)
Browse files Browse the repository at this point in the history
* add ideviceinstaller

* update README
  • Loading branch information
yumiguan authored Jun 5, 2019
1 parent b8c5a37 commit d190e9d
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 30 deletions.
7 changes: 2 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ Lyrebird 是一个基于拦截以及模拟 HTTP/HTTPs 网络请求的面向移
- 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/)

## 准备
Expand All @@ -29,8 +28,6 @@ Lyrebird 是一个基于拦截以及模拟 HTTP/HTTPs 网络请求的面向移
```bash
brew install --HEAD libimobiledevice
brew link --overwrite libimobiledevice
brew install --HEAD ideviceinstaller
brew link --overwrite ideviceinstaller
sudo chmod -R 777 /var/db/lockdown/
```

Expand Down Expand Up @@ -58,7 +55,7 @@ lyrebird

## 预览

<img src="./image/home_page.png" style="width:800px">
![Home Page](./image/plugin-ios.gif)

## 开发者

Expand All @@ -84,7 +81,7 @@ lyrebird

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

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

Expand Down
19 changes: 9 additions & 10 deletions README_EN.md
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# Lyrebird plugin iOS
# Lyrebird iOS Plugin
[![Build Status](https://travis-ci.org/Meituan-Dianping/lyrebird-ios.svg?branch=master)](https://travis-ci.org/Meituan-Dianping/lyrebird-ios)
[![PyPI](https://img.shields.io/pypi/v/lyrebird-ios.svg)](https://pypi.python.org/pypi/lyrebird-ios)
![PyPI](https://img.shields.io/pypi/pyversions/lyrebird.svg)
![GitHub](https://img.shields.io/github/license/meituan/lyrebird-ios.svg)

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.
This plugin depends on libimobiledevice to do certain things. Install it with Homebrew.

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

Expand All @@ -26,8 +27,6 @@ This plugin currently depends on libimobiledevice to do certain things. Install
```bash
$ brew install --HEAD libimobiledevice
$ brew link --overwrite libimobiledevice
$ brew install --HEAD ideviceinstaller
$ brew link --overwrite ideviceinstaller
$ sudo chmod -R 777 /var/db/lockdown/
```

Expand All @@ -47,7 +46,7 @@ $ pip3 install lyrebird-ios
## Preview
![Home Pge](./image/home_page.png)
![Home Page](./image/plugin-ios.gif)
## For developer
1. Clone repo
Expand All @@ -70,7 +69,7 @@ $ pip3 install lyrebird-ios
## FAQs
#### Some error occurs like this - "Could not connect to lockdownd ...".
Re-install both libimobiledevice and ideviceinstaller, and then make sure below command executed
Re-install libimobiledevice, and make sure below command executed
`$ sudo chmod -R 777 /var/db/lockdown/`
Expand Down
Binary file removed image/home_page.png
Binary file not shown.
Binary file added image/plugin-ios.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added lyrebird_ios/bin/ideviceinstaller
Binary file not shown.
17 changes: 3 additions & 14 deletions lyrebird_ios/ios_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from lyrebird import context
from lyrebird.log import get_logger
from . import wda_helper
from pathlib import Path

_log = get_logger()

Expand Down Expand Up @@ -66,15 +67,6 @@ def check_environment():
time.sleep(20)
_log.debug('ideviceinfo program found but not working with error: %s.' % err)

if not os.path.exists('/usr/local/bin/ideviceinstaller'):
error_msg = {"show_error": True,
"user_message": '<b>No ideviceinstaller program found, '
'dependencies with Homebrew, See <a href="https://github.com/'
'meituan/lyrebird-ios#%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98" '
'target="_blank">README 常见问题</a></b>'}
time.sleep(20)
_log.debug("No ideviceinstaller program found.")

if not os.path.exists('/usr/local/bin/idevicescreenshot'):
error_msg = {"show_error": True,
"user_message": '<b>No idevicescreenshot program found, '
Expand All @@ -85,7 +77,7 @@ def check_environment():
_log.debug('No idevicescreenshot program found.')

idevice_id = '/usr/local/bin/idevice_id'
ideviceinstaller = '/usr/local/bin/ideviceinstaller'
ideviceinstaller = Path(__file__).parent/'bin'/'ideviceinstaller'
ideviceinfo = '/usr/local/bin/ideviceinfo'
idevicesyslog = '/usr/local/bin/idevicesyslog'
idevicescreenshot = '/usr/local/bin/idevicescreenshot'
Expand Down Expand Up @@ -266,10 +258,7 @@ def get_device_plist(self, device_id):
plist_path = '%s/%s.plist' % (PLIST_PATH, self.device_id)
if not os.path.exists(PLIST_PATH):
os.mkdir(PLIST_PATH)
if '-' in device_id:
_cmd = f'{ideviceinstaller} -l -o xml > {plist_path}'
else:
_cmd = f'{ideviceinstaller} -u {self.device_id} -l -o xml > {plist_path}'
_cmd = f'{ideviceinstaller} -u {self.device_id} -l -o xml > {plist_path}'
p = subprocess.Popen(_cmd, shell=True)
p.wait()

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='lyrebird-ios',
version='0.2.6',
version='0.2.7',
packages=['lyrebird_ios'],
url='https://github.com/meituan/lyrebird-ios',
author='HBQA',
Expand Down

0 comments on commit d190e9d

Please sign in to comment.