Write in front:
- Appium environment is set up, Genymotion Simulator is also configured OK, then began to write the first demo
First, get the APK package name
- Open cmd, enter the instruction AAPT dump badging D:\test\xxx.apk (full name of the APK, such as magic Diffuse camera apk). If the package name is obtained through Appium, it may not be accurate.
- Package Name: com.manboker.headportrait
Ii. acquisition of Launcheractivity
- Take the previous step, and then the CMD interface to look up. The launcheractivity value of the magic diffuse camera is Com.manboker.headportrait.activities.FirstActivit
Third, demo
- Platformname:android apk
- DeviceName: Phone device name, CMD interface through ADB devices command view
- Platformversion:android System Version number
- APPPACKAGE:APK Package Name
- appactivity:apk launcheractivity
(Ps is copy from elsewhere)
Four, running Appium
- Configure the IP address if you do not know the default. Then click on the small triangle on the right to run.
Five, the Code
# Coding=utf-8
From Appium import Webdriver
Desired_caps = {
' PlatformName ': ' Android ',
' DeviceName ': ' 192.168.56.101:5555 ',
' Platformversion ': ' 6.0 ',
# APK Package Name
' Apppackage ': ' com.manboker.headportrait ',
# APK for Launcheractivity
' appactivity ': ' Com.manboker.headportrait.activities.FirstActivit '
}
Driver = Webdriver. Remote (' Http://127.0.0.1:4723/wd/hub ', desired_caps)
Appium+python Mobile Automation Test (iii)--demo