先说下,我的环境:
操作系统:Mac OS X EI Caption ,版本号:10.11.6
python版本:2.7.13
Mob SF
1、启动needle
打开终端, 找到 needle所在目录,键入命令: python needle.py
当然, 你可以使用命令: show options 查看到当前的一些配置:
Name Current Value Required Description
------------ ------------- -------- -----------
APP no Bundle ID of the target application (e.g., com.example.app). Leave empty to launch wizard
DEBUG False yes Enable debugging output
IP 127.0.0.1 yes IP address of the testing device (set to localhost to use USB)
OUTPUT_FOLDER /root/.needle/output yes Full path of the output folder, where to store the output of the modules
PASSWORD alpine yes SSH Password of the testing device
PORT 2222 yes Port of the SSH agent on the testing device (needs to be != 22 to use USB)
PUB_KEY_AUTH True yes Use public key auth to authenticate to the device. Key must be present in the ssh-agent if a
SAVE_HISTORY True yes Persists command history across sessions
SETUP_DEVICE True yes Set to true to enable auto-configuration of the device (installation of all the tools needed)
USERNAME root yes SSH Username of the testing device
VERBOSE True yes Enable verbose output
可以看到一些常见属性, IP, 端口, bundle ID。
我们也可以自己建立好一个配置文件, 名为 : config.txt, 内容填写格式如下:
$ cat config.txt
# This is a comment, it won't be executed
set DEBUG False
set VERBOSE False
# If SETUP_DEVICE is set to True,
# Needle will automatically install all the required tools on the device
set SETUP_DEVICE False
set IP 192.168.0.10
set PORT 5555
set APP com.example.app
use binary/info/metadata
然后,放到 needle.py 所在目录, 重新打开终端名, 启动 needle . 命令:
python needle.py -r config.txt