Acitvity
Start Activity
通过提供包名和Activity名来启动一个Android Activity
# Python
self.driver.start_activity("com.example", "ActivityName");
获取当前的Activity名称
得到当前的Android Activity名称
# Python
activity = self.driver.current_activity;
获取当前的包名
得到当前的Android应用的包名
package = self.driver.current_package;
APP
安装应用
将给定的应用安装到设备上
self.driver.install_app('/Users/johndoe/path/to/app.apk');
是否已安装应用程序
检查设备上是否安装了指定的应用程序
self.driver.is_app_installed('com.example.AppName');
启动应用
在设备上启动被测应用
self.driver.launch_app()
Background App
Send the currently running app for this session to the background
self.driver.background_app(10)
Close an App
self.driver.close_app()
重置应用
self.driver.reset()
删除应用
self.driver.remove_app('com.example.AppName');
Activate App
Activate the given app onto the device
driver.activate_app('com.apple.Preferences')
driver.activate_app('io.appium.android.apis')
Terminate App
driver.terminate_app('com.apple.Preferences')
driver.terminate_app('io.appium.android.apis')
获取应用状态
获取设备上给定的应用程序状态
driver.query_app_state('com.apple.Preferences')
driver.query_app_state('io.appium.android.apis')