How to use IntelliJ IDEA to test Android (Android) App on the mobile terminal

Preface

The problem encountered with the emulator that comes with IntelliJ IDEA has never been solved. This error has been reported for a few days, and I have tried various methods of Google + Baidu (I always feel that the details are not solved). Originally wanted to hold on for a long time (but to solve the urgent need), I had to give up the simulator and go directly to the real machine to test!

adb devices
List of devices attached
emulator-5554   device

Insert picture description here

Real machine test steps

Create a New Project ——> select Empty Activity ——> Click Next to
Insert picture description here
see the prompt selection.
Insert picture description here

First let the phone enter the developer mode

To enter the developer mode, click below:
https://jingyan.baidu.com/article/14bd256e477577bb6d2612cc.html

Note: Remember to turn on USB debugging

As shown in the figure: This has been connected to my phone (the phone model appears)
Insert picture description here

Open cmd, enter the code, as shown in the figure below, you can also test whether the phone can be connected

adb devices

Insert picture description here
*********************************************** 一条华丽的分割线 ***********************************************

When I clicked to run in IDEA, (that is, the button in the picture below), the Insert picture description here
phone responded accordingly.
Insert picture description here
This is how the first app is
Insert picture description here
completely downloaded.
Insert picture description here

Actual mobile test

If it’s an app written by myself, it’s better. Just run it and you can test it. I’ll update it later (I haven’t started learning yet). I owe it first (If I didn’t update it, please comment on Liu Ya)

Temporarily use other people's apk hahahaha. Go to the pea pod on the computer (you can download the apk on this website) to search for a simple app and download it.
For example, if I download a baby's riddle, I
Insert picture description here
don’t need to choose this
Insert picture description here

Open cdm, install

>adb install 路径/名称.apk

E.g

adb install F:\INSTALL/110_89c01f23201e1bc7566d77594a3f104c.apk

Note: If the above does not work, use the following two methods

Send the apk file directly to the phone for download and installation

Insert picture description here

Or you can download and install it directly in the mobile software store

After downloading, you can directly test the function and perform the black box test .
Insert picture description here

https://blog.csdn.net/hanhanwanghaha, a super invincible cute duck welcomes your attention! Looking forward to learning together, please leave a message if you don’t understand.

Guess you like

Origin blog.csdn.net/hanhanwanghaha/article/details/109143855