In this example, we will use Appium Inspector to start a seesion on your emulator on Android Studio.
Start appium
First, start the connection with Appium by cmd appium --allow-cors
. It also gives you the remote url
and the automationName
that can be used in the Appium Inspector
Start Session
- deviceName:
adb devices
- platformName -
appium driver list
- platformVersion -
adb shell getprop ro.build.version.release
Now you can start a session in your emulator, but it always begins from the home page. To directly start a session on certain App, you also need to provide the appPackage
and the appActivity
.
Session with Apps
If your app is downloaded from the PlayStore. It is possible that the apk file name/path is hidden. However, you can You can simply open the app and check its name by adb shell dumpsys window | grep mCurrentFocus
.
It returns the appPackage
and the current appActivity
of the App, which are both necessary for our seesion to start. However, sometimes the current activity may not be directly opened. Then we need to check all the possible activities this App contans and try them out.
To check the activity list, we can use adb shell dumpsys package YOUR_APP_appPackage | grep -i activity
.
Now, we can start our emulator, and run the command adb shell am start -n YOUR_APP_appPackage/YOUR_APP_appActivity
to see whether it can start the App successfully. If it works we can use it in our inspector.
Please cite the source for reprints, feel free to verify the sources cited in the article, and point out any errors or lack of clarity of expression. You can comment in the comments section below or email to GreenMeeple@yahoo.com