python-2.7-Win32-Windows-IDLE-PIP-AndroidTestLib-uiautomator

14 篇文章 0 订阅
4 篇文章 0 订阅

# Python Android test module Github URL  

https://github.com/xiaocong/uiautomator

 

############# Python27/w32 on Windows 10/64bit 

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Users\lhu>cd \Python27

### install pip/Python lib/module management tools 

C:\Python27>python.exe   D:\Develop\Cloud\Python\pip-8.1.1\setup.py   install
running install
running bdist_egg
running egg_info
creating pip.egg-info
writing requirements to pip.egg-info\requires.txt
writing pip.egg-info\PKG-INFO
writing top-level names to pip.egg-info\top_level.txt
writing dependency_links to pip.egg-info\dependency_links.txt
writing entry points to pip.egg-info\entry_points.txt
writing manifest file 'pip.egg-info\SOURCES.txt'
reading manifest file 'pip.egg-info\SOURCES.txt'
writing manifest file 'pip.egg-info\SOURCES.txt'
installing library code to build\bdist.win32\egg
running install_lib
warning: install_lib: 'build\lib' does not exist -- no Python modules to install

creating build
creating build\bdist.win32
creating build\bdist.win32\egg
creating build\bdist.win32\egg\EGG-INFO
copying pip.egg-info\PKG-INFO -> build\bdist.win32\egg\EGG-INFO
copying pip.egg-info\SOURCES.txt -> build\bdist.win32\egg\EGG-INFO
copying pip.egg-info\dependency_links.txt -> build\bdist.win32\egg\EGG-INFO
copying pip.egg-info\entry_points.txt -> build\bdist.win32\egg\EGG-INFO
copying pip.egg-info\not-zip-safe -> build\bdist.win32\egg\EGG-INFO
copying pip.egg-info\requires.txt -> build\bdist.win32\egg\EGG-INFO
copying pip.egg-info\top_level.txt -> build\bdist.win32\egg\EGG-INFO
creating dist
creating 'dist\pip-8.1.1-py2.7.egg' and adding 'build\bdist.win32\egg' to it
removing 'build\bdist.win32\egg' (and everything under it)
Processing pip-8.1.1-py2.7.egg
creating c:\python27\lib\site-packages\pip-8.1.1-py2.7.egg
Extracting pip-8.1.1-py2.7.egg to c:\python27\lib\site-packages
Adding pip 8.1.1 to easy-install.pth file
Installing pip-script.py script to C:\Python27\Scripts
Installing pip.exe script to C:\Python27\Scripts
Installing pip.exe.manifest script to C:\Python27\Scripts
Installing pip2.7-script.py script to C:\Python27\Scripts
Installing pip2.7.exe script to C:\Python27\Scripts
Installing pip2.7.exe.manifest script to C:\Python27\Scripts
Installing pip2-script.py script to C:\Python27\Scripts
Installing pip2.exe script to C:\Python27\Scripts
Installing pip2.exe.manifest script to C:\Python27\Scripts

Installed c:\python27\lib\site-packages\pip-8.1.1-py2.7.egg
Processing dependencies for pip==8.1.1
Finished processing dependencies for pip==8.1.1

################  try  pip

C:\Python27> C:\Python27\Scripts\pip.exe  list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
pip (8.1.1)
setuptools (39.0.1)
You are using pip version 8.1.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
  
################  Install  uiautomator through pip

C:\Python27> C:\Python27\Scripts\pip.exe   install    uiautomator
Collecting uiautomator
  Downloading https://files.pythonhosted.org/packages/09/b7/d562585617f3edee3b856d7028202a35d50263bc126a5859924edf0dd406/uiautomator-0.3.2.tar.gz (2.9MB)
    100% |¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€| 2.9MB 101kB/s
Collecting urllib3>=1.7.1 (from uiautomator)
  Downloading https://files.pythonhosted.org/packages/bd/c9/6fdd990019071a4a32a5e7cb78a1d92c53851ef4f56f62a3486e6a7d8ffb/urllib3-1.23-py2.py3-none-any.whl (133kB)
    100% |¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€¨€| 143kB 112kB/s
Installing collected packages: urllib3, uiautomator
  Running setup.py install for uiautomator ... done
Successfully installed uiautomator-0.3.2 urllib3-1.23
You are using pip version 8.1.1, however version 18.0 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

##################### Python lib/uiautomator is installed to  C:\Python27\Lib\site-packages

 

############# Setup environment for Android SDK Windows

 

D:\>set  ANDROID_HOME=C:\android-sdk-windows

or

Python  os.putenv('ANDROID_HOME','C:/android-sdk-windows') 

D:\>set
ALLUSERSPROFILE=C:\ProgramData
ANDROID_HOME=C:\android-sdk-windows
..............

D:\>echo %PATH%
C:\Perl\site\bin;C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\system32\config\systemprofile\.dnx\bin;C:\Program Files\Microsoft DNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\

D:\>set PATH=%ANDROID_HOME%\platform-tools;%PATH%

D:\>echo %PATH%
C:\android-sdk-windows\platform-tools;C:\Perl\site\bin;C:\Perl\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\system32\config\systemprofile\.dnx\bin;C:\Program Files\MicrosoftDNX\Dnvm\;C:\Program Files\Microsoft SQL Server\130\Tools\Binn\;C:\Program Files\Git\cmd;C:\Program Files (x86)\nodejs\;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\

D:\>C:\Python27\python.exe
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:22:17) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os,sys
>>> os.system('adb shell "getprop|grep name" ')
[net.bt.name]: [Android]
[net.hostname]: [android-1390cbc487a26fd5]
[ro.build.version.all_codenames]: [REL]
[ro.build.version.codename]: [REL]
[ro.product.name]: [sbc_rk3399]
0
>>>


 

############################################################## Try Python IDLE script

C:\Python27\Lib\idlelib\idle.bat

####################################################### Write a python test script to test Android GUI 

 

D:\>C:\Python27\python.exe
Python 2.7.15 (v2.7.15:ca079a3ea3, Apr 30 2018, 16:22:17) [MSC v.1500 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> from uiautomator import device 
>>> from uiautomator import device as d
 
>>> d.info
{u'displayRotation': 0, u'displaySizeDpY': 811, u'displaySizeDpX': 1442, u'screenOn': True, u'currentPackageName': u'com.android.launcher3', u'productName': u'rk3399_firefly_box', u'displayWidth': 1920, u'sdkInt': 25, u'displayHeight': 1016
, u'naturalOrientation': True}
>>>

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值