Skip to content

hqlian007/AndroidUISpy

 
 

Repository files navigation

Android控件探测器

本工具可用于探测Android设备中的应用控件,可代替UIAutomator等工具

使用限制:

  • Root设备中可以探测任意应用的控件
  • 非Root设备中只能探测debug应用的控件

PREPARE ENVIRONMENT

  1. cd $project_root
  2. virtualenv .env --python=python2.7
  3. Windows:
    .env\Scripts\activate.bat
    Others:
    source .env/bin/activate
  4. pip install -r requirements.txt

如果是Windows系统,还需要执行:

pip install -r requirements_win32.txt

HOW TO DEBUG

python ui/app.py

HOW TO BUILD

python build.py versions(2.5.1.0)

QUESTIONS

  • 如果macos上执行python脚本遇到以下报错:

This program needs access to the screen. Please run with a Framework build of python, and only when you are logged in on the main display of your Mac.

可以将以下内容写入文件:.env/bin/python

#!/bin/bash

# what real Python executable to use
PYVER=2.7
PYTHON=/System/Library/Frameworks/Python.framework/Versions/$PYVER/bin/python$PYVER

# find the root of the virtualenv, it should be the parent of the dir this script is in
ENV=`$PYTHON -c "import os; print os.path.abspath(os.path.join(os.path.dirname(\"$0\"), '..'))"`

# now run Python with the virtualenv set as Python's HOME
export PYTHONHOME=$ENV 
exec $PYTHON "$@"

并添加可以执行权限:chmod 775 .env/bin/python

About

UI Spy for Android

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%