Android device access
This article will introduce the related content of connecting Android devices to Sonic.
General access steps
All devices need to be connected according to this step.
- Plug one end of the usb cable into the Agent and the other end into the phone
- Enter the [Settings] page of the mobile phone
- Go to the [About Phone] page
- Click [Version Number] multiple times (please look down for differences between different brands) until the developer option is enabled
- Go to developer options
- Turn on usb debugging
- Keep the device upright or flat
TIP
If you need to collect performance information, you can additionally open the following options
- Click [GPU rendering mode analysis] in the developer options (some models are called [HWUI rendering mode analysis])
- In [GPU rendering mode analysis], click to select [in adb shell dumpsys gfxinfo]
If the versions of Sonic plug-in, uiautomator2, and uiautomator2-test are updated after upgrading Sonic, the phone may restore related power optimization. Therefore, you need to check again to ensure that the Sonic plug-in, uiautomator2, and uiautomator2-test battery optimization are configured correctly.
Different content of each brand can be read down 👇
HUAWEI
- Go to [Settings] -> [About Phone] -> [Version Number] and click multiple times to open the developer options
- Enter the developer options, close [Monitor ADB installed applications]
- Go to【System and Update】->【Language and Input Method】to close the secure keyboard
XiaoMi
- Enter【Settings】->【My Device】->【All Parameters】->【MIUI Version】Multiple clicks to enable developer options
- Open the developer page, [USB installation] and [USB debugging (safe mode)] are turned on, and some options need to insert a SIM card, which can be pulled out after the configuration is completed.
- [MIUI Optimization] at the bottom of the developer is off
- Go to the phone manager and open [Application Management]
- Click [Permissions]
- Click the setting icon in the upper right corner
- Turn off permission monitoring and USB installation monitoring
- 【Language and input method】Turn off the safe keyboard
- [Settings] -> [Power Saving and Battery] Settings icon in the upper right corner -> [Application Smart Power Saving]
- Find sonic, uiautomator2, uiautomator2-test -> [unlimited]
OPPO
- Enter【Settings】->【System Management】->【About Phone】->【Version Information】->【Software Version】Multiple clicks to enable developer options
- Enter the developer options, open the bottom [Disable permission monitoring], close [USB verification application]
- Open the system power settings
- Turn off the power optimization of Sonic plug-in, uiautomator2, uiautomator2-test
- [Others] -> [Keyboard and Input Method] Close the safe keyboard
vivo
- Enter【Settings】->【System Management】->【About Phone】->【Version Information】->【Software Version】Multiple clicks to enable developer options
- Enter the developer options, enable [Security Permissions] and [USB Simulate Click]
- [Others] -> [Keyboard and Input Method] Close the safe keyboard
- Turn off the power optimization of Sonic plug-in, uiautomator2, uiautomator2-test
OnePlus
- Go to [Settings] -> [About Phone] -> [Version Number] and click multiple times to open the developer options
- Go to [Settings] -> [System] -> [Developer Options] and enable [USB Debugging]
- Go to [Settings] -> [System] -> [Developer Options] -> [Default USB Configuration] to select file transfer
- Go to [Settings] -> [Battery] -> [Battery Optimization], turn off the power optimization of Sonic plug-in, uiautomator2, uiautomator2-test (if you can’t find it, you need to go to the fifth step first)
- Some OnePlus devices need to enable 【Prohibit Permission Monitoring】
Meizu
- Open [Mobile Manager] -> [Settings] -> [Flyme Payment Protection] and turn it off.
Frequently Asked Questions (Q&A)
Q1: [Driver initialization failed! 】Prompts such as
A1: There are many situations when viewing logs:
- If the word apksigner appears, please confirm that the built-tool of Android SDK is correct and there is apksigner.jar under platform-tool
- If the words "shell command error" appear, it is usually because the device permission is not enabled.
Q2: The OPPO phone shows a prompt similar to requires:android.permission.WRITE_SECURE_SETTINGS
A2: Generally, the device has not enabled [Prohibit permission monitoring] at the bottom of the developer options.
TIP
For more questions, please go to 👉Community👈 to communicate