From the HBuilder/HBuilderX menu, click the real machine to run, the program will perform the following steps:
The mobile phone hardware is connected to the computer where HBuilder is located through the usb cable. At this time, the connection may fail due to various problems such as the mobile phone driver, the usb port, the data cable, and the mobile phone hardware.
HBuilderX detects the mobile phone through adb or itunes service. At this time, it may not be detected due to mobile phone channels, usb connection settings, adb settings or adb conflicts, and itunes settings.
HBuilderX installs the debugging base to the mobile phone. At this time, the installation may fail because the mobile phone prohibits usb installation, the Android mobile phone does not have an sd card, and the iOS mobile phone does not have a trust certificate.
HBuilderX synchronizes the code in the ide to the phone and starts the debug base. This step is generally not a problem.
According to the query result, it is confirmed that the connection whose port is 5037 is occupied by that process. The "5816" displayed in the result indicates the PID of the process occupying the adb port.
The specific process can be found according to the PID of the process.
Type in the command line: tasklist | findstr 5816
Find a line similar to the following in the output:
adb.exe 5816 Console 04,440 K
adb.exe(名称一般不是adb.exe,以adb.exe举例)为启动的adb进程。
Or manually locate the process in the task manager, open the task manager, go to the process tab, if there is a PID in the list, look for it directly; if there is no PID in the list, click the menu to view - select a column, and tick the PID.
# Q1: The mobile phone can be detected, but it is grayed out and cannot be clicked
This situation usually occurs when the mobile phone is detected, and the connection of other software is disconnected in the middle, and the mobile phone needs to be re-plugged or restarted or HBuilderX needs to be restarted.
# Q2: The mobile phone can be detected, but the real machine of HBuilder fails to install and debug the base
Some Android roms, such as Xiaomi, have the permission to install apk via usb, which may be turned off. In this case, you need to find the permission to install apk via usb in the settings such as the phone manager, and turn it on.
Some Android phones will pop up a box on the phone interface when installing apk on the usb. If the popup box cannot be clicked in time, the installation will fail due to timeout. Please pay attention to the display of the mobile phone screen.
When the HBuilder console prompts "Failed to install the HBuilder base app, please use the mobile assistant to manually install xxx\android_base.apk.", this is basically the case.
The iOS version occasionally reports an error. You also need to manually install iPhone_base.ipa according to the prompts. The installation method recommends itools, you can use itunes without itools.
After installation, there will be an HBuilder application on the phone.
After you click the real machine to run, you can deploy the project to the mobile phone, and then manually click the HBuilder application to see the results of the project.
# Q3: The solution to the problem that the HBuilder console does not output logs
Make sure that the USB debugging mode is turned on. If it is not turned on, please turn on the USB debugging mode and run the real machine debugging again.
If HBuilder has detected the mobile phone, there may be a conflict with the mobile assistant, please close all mobile assistants and re-run the real device debugging.
Use the mobile assistant to manually install android_base.apk to the mobile phone, and then re-run the real device debugging.
# Q5: Permission denied for Android real machine joint debugging report file operation
Please try the following solutions:
Unplug the data cable
Re-turn on USB debugging mode
Re-plug the data cable. At this time, authorization confirmation may be required on the mobile phone. Click OK.
Re-run the real machine debugging to see if there is any problem
Restart the phone, and then re-run the real machine debugging to see if the problem is solved
If there is still a problem, restart HBuilder, repeat steps 1-4, and then re-run the real machine debugging to see if the problem is solved
If the problem is still not resolved, reinstall the phone driver:
My Computer---Right Click---Properties---Hardware---Device Manager---Delete USB Driver
Open the mobile phone assistant and reinstall the driver; at this time, authorization confirmation may be required on the mobile phone, click confirm, and then re-run the real machine debugging
If none of the above solutions can be solved, it may be that when the phone is rooted, the permissions of the sdcard directory are wrong, resulting in the inability to run on the real machine. At this time, you can restore the factory settings, or re-root, or brush the machine to solve this problem.
# Q6: Android real machine joint debugging report: open '/dev/hwlog_switch' fail -1, 13. Permission denied
If none of the above solutions can be solved, it may be that when the phone is rooted, the permissions of the sdcard directory are wrong, resulting in the inability to run on the real machine. At this time, you can restore the factory settings, or re-root, or brush the machine to solve this problem.
# Q7: Why can't the real device debug the Android phone without SDCard?
Android phones without root only have access to SDCard. However, this SDCard does not have to be inserted into a physical SD card, it is a root directory called SDCard in the mobile phone.
如果是使用Android模拟器,在模拟器里可以配置SDCard是否存在及大小。
This situation has expired, and normal mobile phones currently have SDCard directories.
# Q8: The console shows that the mobile application has been launched, but it does not appear on the mobile screen?
When the base application is installed on an Android phone for the first time, most of the antivirus software on the mobile phone needs to be detected for a while before it is released, and it needs to wait for a while.
# Q9: After the 5+App is running, the mobile terminal stays on the startup screen and cannot enter
# Q10: Why is my iphone not plugged into my computer, but HBuilder detects an iOS device?
iTunes supports wifi synchronization. If the iOS device starts wifi synchronization, iTunes on the computer can detect it, and then HBuilder can also detect it.
# Q11: The real machine is successfully started, but the software displayed on the mobile phone is not the running project after it is started.
In this case, the adb connection to the mobile phone is successful, but the copying of the project file to the mobile phone fails. Rerun the real machine debugging.
Or check whether the directory name and file name of the project to be run have special symbols or are too long to cause Android to not recognize them.
# Q12: After the real machine is started, the HBuilder real machine operation (log) interface is displayed {#synchronous}
Re-run real device debugging to try to solve the problem
The Android device may conflict with the mobile assistant, please close all mobile assistants and re-run the real device to debug
If step 2 cannot solve the problem, please change to another mobile assistant, and re-run the real device debugging to try to solve the problem.
Confirm the installation location of the HBuilder application on the mobile phone. If there is an external sdcard on the mobile phone, do not install the HBuilder base app on the external sdcard. If it is installed on the external sdcard, uninstall the HBuilder base app on the external sdcard, and Do not set the default installation location of the application to the external sdcard in the settings, or transfer the application to the phone memory or built-in sdcard, and re-run the real machine debugging
If you encounter the following errors, please check the dock type first:
standard base
HBuilderX cloud packaging custom base
Custom dock made by offline SDK Android Studio
If the following solutions do not solve the problem, please go to Ask Forum to explain the problem in detail (need to include operating system, HBuilderX version, project information, base information, mobile phone information, console screenshots, etc. Detailed information will help us troubleshoot the problem)
Try the following workarounds
On the Android phone, find the app, delete it, and run it again.
Turn off developer mode, usb debugging, and try again. Phone USB settings, try each option
If it is a custom base made by offline SDK Android Studio, check whether implementation 'com.squareup.okhttp3:okhttp:3.12.12', implementation 'com.squareup.okio:okio:1.15' are missing. 0', add them if missing.
If it is a custom base made by offline SDK Android Studio, you can try to use HBuilderX cloud to package the custom base to see if it is normal.