Example of using AskUI together with two Android devices. In this example, AskUI is used to click on two devices on a text.
- Two Android Devices connected to the local device
- adb is installed
npm install
Set the following environment variables to configure the example. The ASKUI_WORKSPACE_ID
and ASKUI_TOKEN
are required to connect to the askui services. Read our docs on how to get them: Windows Linux, macOS.
- Copy the
.env.template
to.env
and insert the value forASKUI_WORKSPACE_ID
andASKUI_TOKEN
e.g.
.env
-example
ASKUI_WORKSPACE_ID=<your_workspace_id>
ASKUI_TOKEN=<your_workspace_token>
- Configure your two Android devices with following Guide Setup Real Android Devices
Nothing Todo. The AskUI Controller is available inside the AskUI Shell
- Note Mac, Linux only: Download the controller Mac (Intel) | Mac (ARM) | Linux and copy it to this project
askui-example-android-multiple-devices/askui-ui-controller.{exe,dmg,AppImage}
First we check if both Android devices are connected. This should look like:
$ adb devices
emulator-5556 device product:sdk_google_phone_x86_64 model:Android_SDK_built_for_x86_64 device:generic_x86_64
emulator-5554 device product:sdk_google_phone_x86 model:Android_SDK_built_for_x86 device:generic_x86
Now we have to open a terminal for each AskUI Controller and start it on different ports.
# Open AskUI Shell
askui-shell
# Start first AskUI Controller on Port 6769 for android device 0 (emulator-5556)
AskUI-StartController -DisplayNum 0 -Runtime android -Port 6769
# Start second AskUI Controller on Port 6869 for android device 1 (emulator-5554)
AskUI-StartController -DisplayNum 1 -Runtime android -Port 6869
# Connects to the first device returned by 'adb devices'
./askui-ui-controller.AppImage --host 0.0.0.0 -p 6769 -d 0 -m -r android
# Connects to the second device returned by 'adb devices'
./askui-ui-controller.AppImage --host 0.0.0.0 -p 6869 -d 1 -m -r android
# Start first AskUI Controller on Port 6769 for android device 0 (emulator-5556)
./askui-ui-controller --host 0.0.0.0 -p 6769 -d 0 -m -r android
# Start second AskUI Controller on Port 6869 for android device 1 (emulator-5554)
./askui-ui-controller --host 0.0.0.0 -p 6869 -d 1 -m -r android
Now both controllers should be connected to the device.
Then let's run the workflows with:
npm run askui
Afterwards there should be two reports under html screenshots ./report/