Skip to content

Commit

Permalink
1.0.8, support Android to P, allow touchscreen dev file to be specifi…
Browse files Browse the repository at this point in the history
…ed for some cases
  • Loading branch information
mingyuan-xia committed Jun 14, 2018
1 parent f6c2b21 commit 1701ed5
Show file tree
Hide file tree
Showing 102 changed files with 39 additions and 34 deletions.
12 changes: 6 additions & 6 deletions README.cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
不同系统的可执行文件可以在如下文件夹下找到, MacOS 系统的在 `darwin/` 文件夹下, Windows 系统的在 `win32/` 文件夹下, Ubuntu Fedora 和 CentOS 系统的在 `linux/` 文件夹下。 可以将路径添加到 `PATH` 下全局运行。 Linux 和 MacOS 需要在64位环境下运行,Windows 可以在64位环境下运行(兼容32位环境)

```
用法: appetizer [-h] {version,trace,adb,devices,plan} ...
用法: replaykit [-h] {version,trace,adb,devices,plan} ...
参数说明:
{version,trace,adb,devices,plan}
Expand All @@ -29,9 +29,9 @@
```

## 录制和重放
录制或重放触屏事件,输入 `appetizer trace`:
录制或重放触屏事件,输入 `replaykit trace`:
```
用法: appetizer trace [-h] {info,describe,replay,record} ...
用法: replaykit trace [-h] {info,describe,replay,record} ...
参数说明:
{info,replay,record} 操作
Expand All @@ -47,9 +47,9 @@
[![Record and replay](https://i.vimeocdn.com/video/583660790_640.jpg)](http://www.bilibili.com/video/av6725203/index_2.html)

## 控制多设备和镜像操作
同时控制多台设备,输入 `appetizer devices`:
同时控制多台设备,输入 `replaykit devices`:
```
用法: appetizer devices [-h]
用法: replaykit devices [-h]
{list,screenshot,mirror,control}
...
Expand All @@ -71,7 +71,7 @@
## ADB 相关
Android SDK 的 `adb``replaykit` 的必要依赖。replaykit 本身可以检测是否有 adb 二进制环境并且可以控制 adb server。
```
用法: appetizer adb [-h]
用法: replaykit adb [-h]
{check-server,start-server,kill-server,detectadb}
...
Expand Down
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
* control multiple devices concurrently (e.g., run a shell command, install an app, etc.)
* mirror the touchscreen events from one device to many in real time (aspect ratios must be the same)

`replaykit` can work on Windows 7+, MacOS Mavericks+ and Linux. To integrate it with existing CI infrastructure, consider the [Python SDK](https://github.com/appetizerio/replaykit.py).
`replaykit` can work on Windows 7+, MacOS Mavericks+ and Linux, available for Android API 9-27(9.0 aka. P), emulators, VMs (like Genymotion) and real devices. To integrate replaykit with existing CI infrastructure, consider the [Python wrapper](https://github.com/appetizerio/replaykit.py).

Please submit issues for bug reports, enhancements and feature requests. Pull requests are welcomed too.
Please submit issues for bug reports, enhancements and feature requests. Pull requests for documentation improvement are welcomed too.

## Installation
The executable file can be found in the `darwin/` for MacOS, `win32/` for Windows and `linux/` for Ubuntu, Fedora and CentOS. You might want to add to PATH to use the tool globally. Linux and MacOS build are both 64-bit and Windows build is 32-bit (compatible with 64-bit as WOW). `replaykit` requires `adb` to be present in `PATH`. You can install the Android SDK and ensure `<sdk>/platform-tools` is in your PATH.
Expand All @@ -18,24 +18,24 @@ Suppose you have several devices attached to the development machine via USB and

First, make sure replaykit recognizes all of them devices:
```
./darwin/appetizer devices list
./darwin/replaykit devices list
```
You should see a JSON output. Note the `serialno` field, which is the same as the `adb devices` output. A serialno uniquely identifies a connected device.

Next, you can try these:
```
DEVICE=serialno1,serialno2 # device serialnos, comma separated, no whitespace!
appetizer devices control $DEVICE uninstall com.helloworld # uninstall an app on those devices
appetizer devices control $DEVICE install hellworld.apk # install an app
appetizer devices control $DEVICE kill_all # kill all background apps
appetizer devices control $DEVICE launch_pkg com.helloworld # launch an app
appetizer devices control $DEVICE shell input keyevent KEYCODE_HOME # simulate the home button
appetizer devices control $DEVICE shell pm grant com.helloworld android.permission.SOME_PERMISSION # grant a permission to an app
appetizer devices control $DEVICE shell "input keyboard text 'Paste%stext%son%sAndroid%sDevice'" # input text (pre Android 6)
appetizer devices control $DEVICE shell "input keyboard text 'Paste text on Android Device'" # input text (Android 6+)
appetizer devices control $DEVICE shell screenrecord /sdcard/demo.mp4 # record screen into a video(Android 4.4+)
replaykit devices control $DEVICE uninstall com.helloworld # uninstall an app on those devices
replaykit devices control $DEVICE install hellworld.apk # install an app
replaykit devices control $DEVICE kill_all # kill all background apps
replaykit devices control $DEVICE launch_pkg com.helloworld # launch an app
replaykit devices control $DEVICE shell input keyevent KEYCODE_HOME # simulate the home button
replaykit devices control $DEVICE shell pm grant com.helloworld android.permission.SOME_PERMISSION # grant a permission to an app
replaykit devices control $DEVICE shell "input keyboard text 'Paste%stext%son%sAndroid%sDevice'" # input text (pre Android 6)
replaykit devices control $DEVICE shell "input keyboard text 'Paste text on Android Device'" # input text (Android 6+)
replaykit devices control $DEVICE shell screenrecord /sdcard/demo.mp4 # record screen into a video(Android 4.4+)
```
Basically everything you did with `adb shell` can now be replaced with `appetizer devices control serialno1,serialno2 shell` to perform that on multiple devices simultaneously.
Basically everything you did with `adb shell` can now be replaced with `replaykit devices control serialno1,serialno2 shell` to perform that on multiple devices simultaneously.

And, just in case you need them:
* [Key code cheatsheet](https://developer.android.com/reference/android/view/KeyEvent.html)
Expand All @@ -44,19 +44,19 @@ And, just in case you need them:
## Record and Replay touchscreen events
Replaykit can record touchscreen events from one device and replay back to many to automate stuff.
```
appetizer trace record --device serailno mytrace.trace
replaykit trace record --device serailno mytrace.trace
```
Now find the device and start touching. The touchsceen events will be captured and saved to `mytrace.trace`. If you are done, type in `exit` to stop. You are all set if seeing "Recorder stopped, trace saved to mytrace.trace". Try not to use `Ctrl+C`.

Check if the trace is good:
```
appetizer trace info mytrace.trace
replaykit trace info mytrace.trace
```
Again, it shows a JSON about the recorded trace, showing the screen resolution, time length, how many fingers, etc. To modify the description of this trace, use `appetizer trace describe mytrace.trace "the description to be added"`.
Again, it shows a JSON about the recorded trace, showing the screen resolution, time length, how many fingers, etc. To modify the description of this trace, use `replaykit trace describe mytrace.trace "the description to be added"`.

Next replay the trace back to see how it goes:
```
appetizer trace replay mytrace.trace serialno
replaykit trace replay mytrace.trace serialno
```
You will see something like the video below:

Expand All @@ -67,7 +67,7 @@ If you want to replay to more than one devices, simply replace `serialno` with a
## Mirror Touchscreen Events
With replaykit, you can mirror the touchscreen events from one device to other devices in real time.
```
appetizer devices mirror <from_device> <to_device>
replaykit devices mirror <from_device> <to_device>
```
The `<from_device>` is a single serialno while `<to_device>` can be a comma-separated list of device serialnos.
Make sure all involving devices have the same aspect ratio. Otherwise the command will fail.
Expand All @@ -80,10 +80,10 @@ Here is a demo:
## ADB related
Finally, replaykit provides some commands to check the ADB environment.
```
appetizer adb start-server # start the ADB server
appetizer adb kill-server # kill the ADB server
appetizer adb detectadb # this tells where the adb binary locates. If not found, tune your PATH
appetizer adb check-server # check if the adb server is running properly now
replaykit adb start-server # start the ADB server
replaykit adb kill-server # kill the ADB server
replaykit adb detectadb # this tells where the adb binary locates. If not found, tune your PATH
replaykit adb check-server # check if the adb server is running properly now
```
## License
Apache License v2
3 changes: 2 additions & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
build_script:
- cd win32
- appetizer.exe version
- replaykit.exe version
- replaykit.exe trace info ./test.trace

Binary file modified darwin/appetizer
Binary file not shown.
Binary file renamed linux/appetizer → linux/replaykit
Binary file not shown.
8 changes: 6 additions & 2 deletions nixtest.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
if [[ $TRAVIS_OS_NAME == 'osx' ]]; then
./darwin/appetizer version
REPLAYKIT=./darwin/replaykit
else
./linux/appetizer version
REPLAYKIT=./linux/replaykit
fi
$REPLAYKIT version
$REPLAYKIT trace info test.trace || exit 1
$REPLAYKIT trace describe test.trace "may the force be with you" || exit 1
$REPLAYKIT trace info test.trace | grep force || exit 1
Binary file added test.trace
Binary file not shown.
Binary file not shown.
Binary file added win32/API-MS-Win-Core-LibraryLoader-L1-1-0.dll
Binary file not shown.
Binary file not shown.
Binary file added win32/API-MS-Win-Core-Misc-L1-1-0.dll
Binary file not shown.
Binary file added win32/API-MS-Win-Core-ProcessThreads-L1-1-0.dll
Binary file not shown.
Binary file added win32/API-MS-Win-Core-Profile-L1-1-0.dll
Binary file not shown.
Binary file added win32/API-MS-Win-Core-String-L1-1-0.dll
Binary file not shown.
Binary file added win32/API-MS-Win-Core-SysInfo-L1-1-0.dll
Binary file not shown.
Binary file added win32/API-MS-Win-Security-Base-L1-1-0.dll
Binary file not shown.
Binary file modified win32/CRYPT32.dll
Binary file not shown.
Binary file added win32/KERNELBASE.dll
Binary file not shown.
Binary file added win32/MSASN1.dll
Binary file not shown.
Binary file modified win32/_ctypes.pyd
Binary file not shown.
Binary file modified win32/_elementtree.pyd
Binary file not shown.
Binary file modified win32/_hashlib.pyd
Binary file not shown.
Binary file modified win32/_multiprocessing.pyd
Binary file not shown.
Binary file modified win32/_socket.pyd
Binary file not shown.
Binary file modified win32/_ssl.pyd
Binary file not shown.
Binary file modified win32/bz2.pyd
Binary file not shown.
Binary file modified win32/library.zip
Binary file not shown.
Binary file modified win32/pyexpat.pyd
Binary file not shown.
Binary file modified win32/python27.dll
Binary file not shown.
Binary file renamed win32/appetizer.exe → win32/replaykit.exe
Binary file not shown.
Binary file modified win32/select.pyd
Binary file not shown.
Binary file modified win32/unicodedata.pyd
Binary file not shown.
6 changes: 3 additions & 3 deletions win32/vendor/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Third-party dependencies
* [minitouch](https://github.com/openstf/minitouch) for manipulating touch screen
* [minicap](https://github.com/openstf/minicap) for taking screenshots
# Third-party dependencies
* [minitouch](https://github.com/openstf/minitouch) for manipulating touch screen
* [minicap](https://github.com/openstf/minicap) for taking screenshots
Binary file removed win32/vendor/minicap-libs/android-19/x86/minicap.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed win32/vendor/minicap-libs/android-21/x86/minicap.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed win32/vendor/minicap-libs/android-22/x86/minicap.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed win32/vendor/minicap-libs/android-23/x86/minicap.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed win32/vendor/minicap/arm64-v8a/minicap.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed win32/vendor/minicap/armeabi-v7a/minicap.so
Binary file not shown.
Binary file added win32/vendor/minicap/x86/bin/minicap
Binary file not shown.
Binary file added win32/vendor/minicap/x86/bin/minicap-nopie
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed win32/vendor/minicap/x86/minicap
Binary file not shown.
Binary file removed win32/vendor/minicap/x86/minicap-nopie
Binary file not shown.
Binary file removed win32/vendor/minicap/x86/minicap.so
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file removed win32/vendor/minicap/x86_64/minicap.so
Binary file not shown.

0 comments on commit 1701ed5

Please sign in to comment.