Skip to content

Commit

Permalink
文件增加命令相关使用
Browse files Browse the repository at this point in the history
  • Loading branch information
hqlian committed Nov 7, 2018
1 parent e05fac4 commit 2df9f18
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 19 deletions.
Binary file removed docs/img/setup/androiddriver.png
Binary file not shown.
Binary file added docs/img/testcases/install_driver_cmd.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/testcases/qt4a_driver_files.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/img/testcases/repack_apk_cmd.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 1 addition & 12 deletions docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,8 @@ QT4A使用需要至少有一台Android设备。
$ adb devices
List of devices attached
3fr4343aa12 device

3. 安装QT4A测试桩

运行"copy_android_driver"函数,将测试桩拷贝到手机中::
from qt4a.androiddriver.androiddriver import copy_android_driver
copy_android_driver()
如下表示拷贝成功:

.. image:: ./img/setup/androiddriver.png
4. 如果你的手机是root过的设备,那么该步骤可跳过。如果你的手机未root,请先在你的电脑上安装jdk 64位,并配置环境变量,同时把bin目录下的jarsigner.exe加入到环境变量中,为后面重打包apk准备环境。
3. 如果你的手机是root过的设备,那么该步骤可跳过。如果你的手机未root,请先在你的电脑上安装jdk 64位,并配置环境变量,同时把bin目录下的jarsigner.exe加入到环境变量中,为后面重打包apk准备环境。

.. note:: 建议优先使用root过的设备,这样没有各类系统授权弹框的干扰,也无需重打包APK后再安装应用。

Expand Down
32 changes: 25 additions & 7 deletions docs/testcase.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,26 @@
通过pip安装的方式安装QT4A::

pip install qt4a
=========
安装QT4A测试桩
=========

====
执行用例前,需先安装QT4A测试桩,可通过QT4A命令执行::

qt4a-manage install-driver

执行成功如下:

.. image:: ./img/testcases/install_driver_cmd.png

同时可以看到文件已拷贝到手机目录中:

.. image:: ./img/testcases/qt4a_driver_files.png

======
Demo工程
====
======

可于github(`<https://github.com/qtacore/QT4ADemoProj>`_)上下载demo工程,其中包括demo测试项目源码和demo apk,本文的分析基于该demo工程进行。

Expand All @@ -47,13 +63,15 @@ Demo工程
手机未root
-------

如果你的手机未root,请先将你的apk进行重打包(假设你已经按照《:ref:`qt4a_setup`》一节装好了jdk),再安装重打包后的apk,重打包方法如下::
如果你的手机未root,请先将你的apk进行重打包(假设你已经按照《:ref:`qt4a_setup`》一节装好了jdk),再安装重打包后的apk,重打包命令如下::

qt4a-manage repack-apk -p D:\1.apk

耐心等待执行完成,会打印出一个重打包后的apk路径:

from qt4a.apktool.repack import repack_apk
apk_path = r'E:\1.apk'
print (repack_apk(apk_path))
.. image:: ./img/testcases/repack_apk_cmd.png

耐心等待执行完成,会打印出一个重打包后的apk路径,到该路径下拷贝重打包后的apk,安装重打包后的apk即可。
到该路径下拷贝重打包后的apk,安装重打包后的apk即可。命令更多参数可以在命令行中加-h查看

----------
安装release包
Expand Down

0 comments on commit 2df9f18

Please sign in to comment.