[appium] Successfully solved the problem that the app cannot be started automatically

Question:
Use a python script, pass in the parameters appPackage, appActivity, and execute. The app cannot start itself.

Solution:
The reason is that the name of the interface is wrong, and it must be run after opening the app

adb shell dumpsys activity activities | find "mFocusedActivity"

Using the first appActivity obtained after opening as a parameter, it can be started normally. For example, if I start the app, I immediately enter the above command to get the package name in cmd, and try the first .activity.StartActivity, and it can start normally.

Guess you like

Origin blog.csdn.net/keira674/article/details/126923483