1. The app has been installed on the mobile phone or emulator (Meituan as an example)
Method 1: Enter adb shell am monitor on the command line, press Enter, and then start the app you want to get (the package name is on the last line: com.sankuai.meituan )
C:\Users\starteos>adb shell am monitor
Monitoring activity manager... available commands:
(q)uit: finish monitoring
** Activity starting: com.sankuai.meituan
Method 2: Start the app you want to get first, and then enter the command: adb shell dumpsys window w | findstr / | findstr name=, press Enter (the package name is on the penultimate line)
Method 3: Start the app you want to get first, and then enter the command: adb shell dumpsys window | findstr mCurrentFocus, press Enter (the package name is in the middle)
Method 4: Obtain the package names of all third-party applications on the mobile phone, enter the command: adb shell pm list package -3, and press Enter (the package name is on the last line, and the specific location is different for each device)
C:\Users\starteos>adb shell pm list package -3
package:io.appium.settings
package:com.smarttoolfactory.tutorial3_1transitions
package:com.sankuai.meituan
2. There is an apk installation package on the computer