Previous: Remote Debugging Next: Automated Testing 
WDB (WeTest Debug Bridge) is a unified remote debugging tool provided by the WeTest platform. The program is a cross-platform binary file that can be directly downloaded and used. For instance, on Windows, please use cmd/cmder/powershell; on MacOS, you can use Terminal/iTerm2, etc.
1.WDB supports simultaneous connection to remote Android and iOS devices on WeTest.
2.When using WDB on Linux/MacOS, it will automatically back up the existing /var/run/usbmuxd in the system on first launch:

(If the error start debug failed: [start usbmuxd failed: rename /var/run/usbmuxd /var/run/usbmuxd.bak: permission denied] is reported, it indicates a permission issue. You can try manually executing sudo rename /var/run/usbmuxd /var/run/usbmuxd.bak first, then run wdb connect.)
3.If using on Windows, launch Command Prompt (cmd) as an administrator and execute the following command to stop the Apple Mobile Device Service. If iTunes is not installed, please ignore this step.
net stop "Apple Mobile Device Service"
4.WDB has the following known limitations when remotely debugging iOS devices:
●Cannot debug local iOS devices and remote iOS devices simultaneously on the same computer.
●Cannot debug multiple remote iOS devices simultaneously on the same computer.
●If performing remote debugging with WDB + Xcode, devices running iOS 17 or later are not supported.
1.After enabling remote debugging of cloud phones, download the corresponding wdb tool from the Web interface according to your computer’s operating system. For Mac or Linux environments, please refer to the FAQ section below for settings after downloading.

2.Copy the command to the terminal and execute it. If it’s the first time you run WDB-related commands, WDB will automatically launch the wdb server with the default port 5038.

If the port is already in use, set the WDB_SERVER_PORT environment variable as prompted, or set the wdb server port by specifying the parameter -p port. If you set the port via -p, you must specify the port with -p for all subsequent WDB-related commands. It is recommended to set a custom port by configuring the WDB_SERVER_PORT environment variable.

3.After successful connection:
●Android devices: wdb will forward the adb connection to a local port. You can check via adb devices that the locally forwarded port has been automatically connected. Subsequently, you can operate the remote device by using adb to interact with the device on the local 127.0.0.1:40000 port.

●iOS devices: Use tools such as go-ios and tidevice to view device information and operate the remote device.
4.If multiple remote devices are connected, you can check the correspondence between remote device Tokens and local adb ports (for Android devices) or device serial numbers (for iOS devices) via wdb devices:

(If you cannot see the serial number of an iOS device when running wdb devices but can view it using tools like go-ios or tidevice, the device is already connected successfully, and this phenomenon can be ignored.)
5.To disconnect, execute the wdb disconnect command (you can specify a remote device token to disconnect a specific device). For Android devices, the corresponding local adb connection will also be disconnected.

1.If executing the wdb command reports a permission error, you need to add executable permissions to wdb:
chmod +x wdb
2.If a popup stating “wdb cannot be opened because the developer cannot be verified” appears when executing any wdb command:

Please go to “System Settings” - “Privacy & Security” and allow it.


Execute the wdb command again to confirm it opens:

3.If you encounter an Error: EOF while sequentially remote-debugging multiple iOS devices, or see socket error-type issues when using third-party tools such as go-ios or tidevice, you can run wdb kill-server and then retry.
If you see an error such as no such file: /var/run/usbmuxd during the process, you need to manually run sudo mv /var/run/usbmuxd.bak /var/run/usbmuxd and then retry.
1.Before remote debugging, you need to launch Command Prompt (cmd) as an administrator and execute the following command to stop the Apple Mobile Device Service:
net stop "Apple Mobile Device Service"
2.If you encounter an Error: EOF while sequentially remote-debugging multiple iOS devices, or see socket error-type issues when using go-ios, tidevice, or similar tools, you can run wdb kill-server, restart iTunes, and then retry.
Previous: Remote Debugging Next: Automated Testing 