提兵百万西湖上,立马吴山第一峰!这篇文章主要讲述APP——自动化——java——初始化安装程序相关的知识,希望能为你提供帮助。
package jkcs; import java.net.MalformedURLException; import java.net.URL; import java.util.concurrent.TimeUnit; import org.openqa.selenium.remote.DesiredCapabilities; import io.appium.java_client.AppiumDriver; public class jblx { public static void main(String[] args) throws MalformedURLException, InterruptedException { DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("platformName", "android"); capabilities.setCapability("deviceName","8DF6R17503000072"); capabilities.setCapability("platformVersion", "8.0.0"); capabilities.setCapability("unicodeKeyboard","True"); capabilities.setCapability("resetKeyboard","True"); capabilities.setCapability("autoGrantPermissions", "True"); capabilities.setCapability("app", "C:\Users\del\Desktop\b\jsq.apk"); capabilities.setCapability("appPackage", "com.youba.calculate"); capabilities.setCapability("appActivity", "com.youba.calculate.MainActivity"); AppiumDriver driver = new AppiumDriver(new URL("http://127.0.0.1:4723/wd/hub"), capabilities); driver.manage().timeouts().implicitlyWait(500, TimeUnit.SECONDS); Thread.sleep(5000); System.out.println(driver.currentActivity()); Thread.sleep(5000); System.out.println(driver.getCapabilities()); Thread.sleep(5000); driver.quit(); } }
执行结果:
.MainActivity
Capabilities [{appPackage=com.youba.calculate, statBarHeight=84, viewportRect={top=84, left=0, width=1440, height=2344}, deviceName=8DF6R17503000072, platform=LINUX, deviceUDID=8DF6R17503000072, desired={app=C:UsersdelDesktopjsq.apk, appPackage=com.youba.calculate, appActivity=com.youba.calculate.MainActivity, platformVersion=8.0.0, autoGrantPermissions=true, unicodeKeyboard=true, platformName=Android, deviceName=8DF6R17503000072, resetKeyboard=true}, platformVersion=8.0.0, webStorageEnabled=false, takesScreenshot=true, javascriptEnabled=true, unicodeKeyboard=true, platformName=Android, deviceApiLevel=26, deviceManufacturer=HUAWEI, resetKeyboard=true, app=C:UsersdelDesktopjsq.apk, deviceScreenSize=1440x2560, networkConnectionEnabled=true, warnings={}, databaseEnabled=false, appActivity=com.youba.calculate.MainActivity, pixelRatio=3.5, locationContextEnabled=false, autoGrantPermissions=true, deviceScreenDensity=560, deviceModel=EDI-AL10}]
【APP——自动化——java——初始化安装程序】
推荐阅读
- APP——自动化——java——程序安装好,直接调用
- uni-app map组件关于marker标记点动态设置的问题
- entfrm-app赋能entfrm零代码开发平台 开启多平台分发
- 移动APP测试流程及基本测试的checklist
- ESA2GJK1DH1K基础篇: APP使用APUConfig配网绑定ESP8266,实现远程温湿度显示和远程控制继电器
- ? 0001 No application 'E:wwwgolog' found in your GOPATH
- 对xx面APP进行分析
- 获取Spring上下文(ApplicationContext)的三种方法
- 浙大保研2019年上机题7-1 Happy Numbers (20分)