Home > Article > Web Front-end > How to debug uniapp on Android phone
With the popularity of mobile Internet, the demand for mobile application development is increasing. But during the development process, we often need to debug on different mobile platforms. Now, in the face of this situation, Uniapp emerged as the times require. This framework allows developers to quickly develop efficient, cross-platform applications. However, because different platforms have different debugging methods, many developers are still a little confused. This article will focus on how to debug Uniapp on Android phones.
1. Use Chrome for Weinre debugging
Weinre is a tool for remote debugging on mobile devices, which can well solve the debugging problem of mobile devices during development. With Weinre, we can debug web applications on Android devices in a remote browser without having to install the application locally on the computer. The following are the specific steps:
Installing Weinre
Before installing Weinre, we need to open a terminal or command line tool first, and then execute the following command.
npm -g install weinre
weinre --httpPort 8080 --boundHost -all-
Among them, the port number can be customized. Here we specify the port number as 8080.
<script></script>
[](https://img.php.cn/upload/article/000/000/068/168197743152266.png)
Click the "debug" button , you can connect to the device and perform remote debugging.
2. Use Chrome DevTools for debugging
In addition to Weinre, we can also use Chrome DevTools to debug Uniapp. The specific steps are as follows:
[](https://img.php.cn/upload/article/000/000/068/168197743518848.png)
Click the "inspect" button , you can open Chrome DevTools and debug the application on your phone.
Summary:
This article introduces two methods of remote debugging of Uniapp on Android phones, including using Weinre and Chrome DevTools. Both methods are very simple and easy to use and suitable for all kinds of developers. In the actual development process, we can also use these methods for debugging according to the actual situation to improve development efficiency.
The above is the detailed content of How to debug uniapp on Android phone. For more information, please follow other related articles on the PHP Chinese website!