GVKun编程网logo

iPhone 通过UIRequiredDeviceCapabilities指定程序适用于哪些设备

19

针对iPhone通过UIRequiredDeviceCapabilities指定程序适用于哪些设备这个问题,本篇文章进行了详细的解答,同时本文还将给你拓展Anapplicationisattempti

针对iPhone 通过UIRequiredDeviceCapabilities指定程序适用于哪些设备这个问题,本篇文章进行了详细的解答,同时本文还将给你拓展An application is attempting to perform an action that requires privileges. Authentication is requir、Appium Desired Capabilities、Appium Desired Capabilities-Android Only、Appium Desired Capabilities-iOS Only等相关知识,希望可以帮助到你。

本文目录一览:

iPhone 通过UIRequiredDeviceCapabilities指定程序适用于哪些设备

iPhone 通过UIRequiredDeviceCapabilities指定程序适用于哪些设备

以前在itunes中查看某个应用时,会有说明信息,表明程序适用于ios 1.0,2.0,3.0什么的。

上周末将Key Manager上传到app store时,一直有个疑问,就是没有发现填写程序适用于哪些设备的地方。

虽有疑问,但程序还是上传成功了,只是心里有个担心,怕程序不能通过审核。

但是前天发现,程序审核通过了,切实高兴了一番。

今天闲来无事,决定查下为什么现在不需要填写程序的适用设备了。

呵呵,不卖关子了,如下:

当提交程序到app store时,3.0及更高版本的应用程序不再直接说明使用哪种设备,而是使用info.plist文件来确定需要哪些设备功能。iTunes通过这个所需功能的列表来确定一个应用程序能否下载到一个指定的设备并在该设备上正常运行。

例如,我在info.plist中设置如下,那么只有居右wifi、电话功能和麦克风(内置的或附件所带的麦克风功能)的ios设备才能运行该程序。

除了wifi和telephony项,还有很多项代表各种设备功能,如下:

sms 应用程序需要Messages应用程序或者使用sms://URL
still-camera 应用程序需要使用照相机模式作为图像选取器的控制器
auto-focus-camera 应用程序需要使用更多的聚焦功能以进行微距摄影或者拍摄特别清晰的图像以进行图像内数据检测
video-camera 应用程序需要使用视频模式作为图像选取器的控制器
accelerometer 应用程序需要特定于加速计的反馈而不知是简单的UIViewController方向事件
location-services 应用程序需要使用Core Location
gps 应用程序需要使用Core Location并需要更加精确的gps定位
magnetometer 应用程序需要使用Core Location并需要与前进方向相关的事件,即行进的方向(通过磁力计获得)
peer-peer 应用程序需要使用GameKit通过蓝牙(3.1或更高版本)进行对等连接
opengles-1 应用程序需要OpenGL ES 1.1
opengles-2 应用程序需要OpenGL ES 2.0
armv-6 应用程序仅针对armv6指令集(3.1或更高版本)编译
armv-7 应用程序仅针对armv7指令集(3.1或更高版本)编译

An application is attempting to perform an action that requires privileges. Authentication is requir

An application is attempting to perform an action that requires privileges. Authentication is requir

An application is attempting to perform an action that requires privileges. Authentication is required to perform this action.
resolve  :   sudo command...

Appium Desired Capabilities

Appium Desired Capabilities

简介

Appium Desired Capabilities官方文档:http://appium.io/docs/en/writing-running-appium/caps/
或者在gitHub上查看:https://github.com/appium/appium/blob/master/docs/cn/writing-running-appium/caps.md
Desired Capabilities是一组设置的键值对的集合,是对Appium会话进行配置,传达给服务器所需自动化的平台和应用程序,通知Appium Server建立所需要的Session信息

例:

{
    "platformName": "iOS",
    "platformVersion": "11.0",
    "deviceName": "iPhone 7",
    "automationName": "XCUITest",
    "app": "/path/to/my.app"}@H_301_9@

  这组设置就是表明运行平台IOS系统,平台版本11.0,设备名称iPhone7,使用ios的XCITest驱动运行程序/path/to/my.app

appium-desktop 中设置

  点击【start server v xxx】启动appium-desktop后点击右上角放大镜图标。

   

 

  进入设置Desired Capabilities。配置Appium session,设置Capabilities,如下图,启动会话对app进行操作

  

脚本中进行设置

  如下脚本:  

from appium import webdriver

caps = {}
caps["platformName"] = "Android"
caps["deviceName"] = "32"
caps["appPackage"] = "com.tencent.qqlite"
caps["appActivity"] = "com.tencent.mobileqq.activity.RegisterGuideActivity"

driver = webdriver.Remote("http://localhost:4723/wd/hub", caps)

el1 = driver.find_element_by_id("com.tencent.qqlite:id/btn_login")
el1.click()
el2 = driver.find_element_by_accessibility_id("请输入QQ号码或手机或邮箱")
el2.send_keys("xxxxxxxxxx")
el3 = driver.find_element_by_accessibility_id("请输入密码")
el3.send_keys("xxxxxxxxxxx")
el4 = driver.find_element_by_accessibility_id("登录QQ")
el4.click()

driver.quit()@H_301_9@

 

Capability 参数

  以下设置来源于gitHub:https://github.com/appium/appium/blob/master/docs/cn/writing-running-appium/caps.md

            Appium 服务器初始化参数(Capability)

  公有

  <expand_table>

描述
automationName 自动化测试的引擎 Appium (默认)或者 Selendroid
platformName 使用的手机操作系统 iOSAndroid, 或者 FirefoxOS
platformVersion 手机操作系统的版本 例如 7.14.4
deviceName 使用的手机或模拟器类型 iPhone SimulatoriPad SimulatoriPhone Retina 4-inchAndroid Emulatorgalaxy S4, 等等.... 在 iOS 上,使用 Instruments 的 instruments -s devices 命令可返回一个有效的设备的列表。在 Andorid 上虽然这个参数目前已被忽略,但仍然需要添加上该参数
app 本地绝对路径_或_远程 http URL 所指向的一个安装包(.ipa,.apk,或 .zip 文件)。Appium 将其安装到合适的设备上。请注意,如果您指定了 appPackage 和 appActivity 参数(见下文),Android 则不需要此参数了。该参数也与 browserName 不兼容。 /abs/path/to/my.apk 或 http://myapp.com/app.ipa
browserName 做自动化时使用的浏览器名字。如果是一个应用则只需填写个空的字符串 'Safari' 对应 iOS,'Chrome', 'Chromium', 或 'browser' 则对应 Android
newCommandTimeout 用于客户端在退出或者结束 session 之前,Appium 等待客户端发送一条新命令所花费的时间(秒为单位) 例如 60
language (Sim/Emu-only) 为模拟器设置语言 例如 fr
locale (Sim/Emu-only) 为模拟器设置所在区域 例如 fr_CA
udid 连接真机的唯一设备号 例如 1ae203187fc012g
orientation (Sim/Emu-only) 模拟器当前的方向 竖屏 或 横屏
autoWebview 直接转换到 Webview 上下文(context)。默认值为 false truefalse
noreset 在当前 session 下不会重置应用的状态。默认值为 false truefalse
fullReset (iOS)删除所有的模拟器文件夹。(Android) 要清除 app 里的数据,请将应用卸载才能达到重置应用的效果。在 Android, 在 session 完成之后也会将应用卸载掉。默认值为 false truefalse

  

  Android 独有

  <expand_table>

描述
appActivity Activity 的名字是指从你的包中所要启动的 Android acticity。他通常需要再前面添加. (例如 使用 .MainActivity 代替 MainActivity MainActivity.Settings
appPackage 运行的 Android 应用的包名 com.example.android.myAppcom.android.settings
appWaitactivity 用于等待启动的 Android Activity 名称 SplashActivity
appWaitPackage 用于等待启动的 Android 应用的包 com.example.android.myAppcom.android.settings
appWaitDuration 用于等待 appWaitactivity 启动的超时时间(以毫秒为单位)(默认值为 20000) 30000
deviceReadyTimeout 用于等待模拟器或真机准备就绪的超时时间 5
androidCoverage 用于执行测试的 instrumentation 类。 传送 -w 参数到如下命令 adb shell am instrument -e coverage true -w com.my.Pkg/com.my.Pkg.instrumentation.MyInstrumentation
enablePerformanceLogging (仅适用于 Chrome 与 webview)开启 Chromedriver 的性能日志。(默认值为 false truefalse
androidDeviceReadyTimeout 用于等待设备在启动应用后准备就绪的超时时间。以秒为单位。 例如 30
androidInstallTimeout 用于等待在设备中安装 apk 所花费的时间(以毫秒为单位)。默认值为 90000 例如 90000
adbPort 用来连接 ADB 服务器的端口(默认值为 5037 5037
androidDeviceSocket 开发工具的 socket 名称。只有在被测应用是一个使用 Chromium 内核的浏览器时才需要。socket 会被浏览器打开,然后 Chromedriver 把它作为开发者工具来进行连接。 例如 chrome_devtools_remote
avd 被启动 avd 的名字 例如 api19
avdLaunchTimeout 用于等待 avd 启动并连接 ADB 的超时时间(以毫秒为单位),默认值为 120000 300000
avdReadyTimeout 用于等待 avd 完成启动动画的超时时间(以毫秒为单位),默认值为 120000 300000
avdArgs 启动 avd 时使用的额外参数 例如 -netfast
useKeystore 使用自定义的 keystore 给 apk 签名,默认值为 false truefalse
keystorePath 自定义 keystore 的路径, 默认路径为 ~/.android/debug.keystore 例如 /path/to.keystore
keystorePassword 自定义 keystore 的密码 例如 foo
keyAlias key 的别名 例如 androiddebugkey
keyPassword key 的密码 例如 foo
chromedriverExecutable webdriver 可执行文件的绝对路径(如果 Chromium 内嵌一个自己提供的 webdriver,则应使用他去替换掉 Appium 自带的 chromedriver) /abs/path/to/webdriver
autoWebviewTimeout 用于等待 Webview 上下文(context)激活的时间(以毫秒为单位)。默认值为 2000 例如 4
intentAction 用于启动 activity 的 intent action(默认值为 android.intent.action.MAIN) 例如 android.intent.action.MAINandroid.intent.action.VIEW
intentCategory 用于启动 activity 的 intent category。(默认值为 android.intent.category.LAUNCHER) 例如 android.intent.category.LAUNCHERandroid.intent.category.APP_CONTACTS
intentFlags 用于启动 activity 的标识(flags)(默认值为 0x10200000 例如 0x10200000
optionalIntentArguments 用于启动 activity 的额外 intent 参数。请查看 Intent 参数 例如 --esn <EXTRA_KEY>--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE>, 等等。
dontStopAppOnReset 在使用 adb 启动应用之前,不要终止被测应用的进程。如果被测应用是被其他钩子(anchor)应用所创建的,设置该参数为 false 后,就允许钩子(anchor)应用的进程在使用 adb 启动被测应用期间仍然存在。换而言之,设置 dontStopAppOnReset 为 true 后,我们在 adb shell am start 的调用中不需要包含 -S标识(flag)。忽略该 capability 或 设置为 false 的话,就需要包含 -S 标识(flag)。默认值为 false truefalse
unicodeKeyboard 使用 Unicode 输入法。 默认值为 false truefalse
resetKeyboard 在设定了 unicodeKeyboard 关键字的 Unicode 测试结束后,重置输入法到原有状态。如果单独使用,将会被忽略。默认值为 false truefalse
noSign 跳过检查和对应用进行 debug 签名的步骤。仅适用于 UiAutomator,不适用于 selendroid。 默认值为 false truefalse
ignoreUnimportantViews 调用 uiautomator 的函数 setCompressedLayoutHierarchy()。由于 Accessibility 命令在忽略部分元素的情况下执行速度会加快,这个关键字能加快测试执行的速度。被忽略的元素将不能够被找到,因此这个关键字同时也被实现成可以随时改变的 设置 ( settings )。 默认值为 false true 或 false
disableAndroidWatchers 禁用 android 监视器(watchers)。监视器用于见识应用程序的无响应状态(anr)和崩溃(crash),禁用会降低 Android 设备或模拟器的 cpu 使用率。该 capability 仅在使用 UiAutomator 时有效,不适用于 selendroid,默认设置为 false true 或 false
chromeOptions 允许对 ChromeDriver 传 chromeOptions 的参数。了解更多信息请查阅 chromeOptions chromeOptions: {args: ['--disable-popup-blocking']}
recreateChromeDriverSessions 当移除非 ChromeDriver webview时,终止掉 ChromeDriver 的 session。默认设置为 false truefalse
nativeWebScreenshot 在 web 的上下文(context),使用原生(native)的方法去截图,而不是用过代理的 ChromeDriver。默认值为 false truefalse
androidScreenshotPath 在设备中截图被保存的目录名。默认值为 /data/local/tmp 例如 /sdcard/screenshots/
autoGrantPermissions 让Appium自动确定您的应用需要哪些权限,并在安装时将其授予应用。默认设置为 false truefalse

 

  iOS 独有

  <expand_table>

描述
calendarFormat (仅支持模拟器) 为iOS的模拟器设置日历格式 例如 gregorian
bundleId 被测应用的 bundle ID 。用于在真实设备中启动测试,也用于使用其他需要 bundle ID 的关键字启动测试。在使用 bundle ID 在真实设备上执行测试时,你可以不提供 app 关键字,但你必须提供 udid 。 例如 io.appium.TestApp
udid 连接的真实设备的唯一设备编号 (Unique device identifier) 例如 1ae203187fc012g
launchTimeout 以毫秒为单位,在 Appium 运行失败之前设置一个等待 instruments 的时间 例如 20000
locationServicesEnabled (仅支持模拟器)强制打开或关闭定位服务。默认值是保持当前模拟器的设定. truefalse
locationServicesAuthorized (仅支持模拟器)通过修改 plist 文件设定是否允许应用使用定位服务,从而避免定位服务的警告出现。默认值是保持当前模拟器的设定。请注意在使用这个关键字时,你同时需要使用 bundleId 关键字来发送你的应用的 bundle ID。 truefalse
autoAcceptAlerts 当警告弹出的时候,都会自动去点接受。包括隐私访问权限的警告(例如 定位,联系人,照片)。默认值为 false。不支持基于 XCUITest 的测试。 truefalse
autodismissAlerts 当警告弹出的时候,都会自动去点取消。包括隐私访问权限的警告(例如 定位,联系人,照片)。默认值为 false。不支持基于 XCUITest 的测试。 truefalse
nativeInstrumentsLib 使用原生 intruments 库(即关闭 instruments-without-delay)。 truefalse
nativeWebTap (仅支持模拟器)在Safari中允许“真实的",非基于 javascript 的 web 点击 (tap) 。 默认值:false。注意:取决于 viewport 大小/比例, 点击操作不一定能精确地点中对应的元素。 truefalse
safariInitialUrl (仅支持模拟器) (>= 8.1) 初始化 safari 的时使用的地址。默认是一个本地的欢迎页面 例如 https://www.github.com
safariAllowPopups (仅支持模拟器)允许 javascript 在 Safari 中创建新窗口。默认保持模拟器当前设置。 truefalse
safariIgnoreFraudWarning (仅支持模拟器)阻止 Safari 显示此网站可能存在风险的警告。默认保持浏览器当前设置。 truefalse
safariOpenLinksInBackground (仅支持模拟器)Safari 是否允许链接在新窗口打开。默认保持浏览器当前设置。 truefalse
keepKeyChains (仅支持模拟器)当 Appium 会话开始/结束时是否保留存放密码存放记录 (keychains) 库(Library)/钥匙串(Keychains)) truefalse
localizableStringsDir 从哪里查找本地化字符串。默认值为 en.lproj en.lproj
processArguments 通过 instruments 传递到 AUT 的参数 例如 -myflag
interKeyDelay 以毫秒为单位,按下每一个按键之间的延迟时间 例如 100
showIoslog 是否在 Appium 的日志中显示设备的日志。默认值为 false truefalse
sendKeyStrategy 输入文字到文字框的策略。模拟器默认值:oneByOne(一个接着一个)。真实设备默认值:grouped (分组输入) oneByOnegroupedsetValue
screenshotWaitTimeout 以秒为单位,生成屏幕截图的最长等待时间。默认值为:10 例如 5
waitForAppScript 用于判断 "应用是否被启动” 的 iOS 自动化脚本代码。默认情况下系统等待直到页面内容非空。结果必须是布尔类型。 例如 true;target.elements().length > 0;$.delay(5000); true;
webviewConnectRetries 用于获取 webview 失败时,发送连接信息到远程调试器的次数。默认次数为: 8 例如 12
appName 被测应用的名字。 用于支持 iOS 9 以上系统的应用的自动化。 例如 UICatalog
customSSLCert (Sim/Emu-only) 给模拟器添加一个 SSL 证书。 例如
-----BEGIN CERTIFICATE-----MIIFWjCCBEKg...
-----END CERTIFICATE-----

 

  使用 XCUITest(iOS 独有)

  <expand_table>

描述
processArguments 将会传送到 WebDriverAgent 的进程参数与环境 { args: ["a", "b", "c"] , env: { "a": "b", "c": "d" } } 或 '{"args": ["a", "b", "c"], "env": { "a": "b", "c": "d" }}'
wdaLocalPort 如果这个值被指定了,Mac 主机就会使用这个端口,通过 USB 发送数据到 iOS 设备中。默认的端口与 iOS 设备中 WDA 的端口号是一致的。 例如 8100
showXcodeLog 是否显示运行测试时 Xcode 的输出日志,如果值设置为 true ,则会在启动的时候产生大量的额外日志。默认设置为 false 例如 true
iosInstallPause 安装应用程序与启动 WebDriverAgent 之间停止的间隔时间(以毫秒为单位),特别适用于体积较大的包。默认是设置为 0 例如 8000
xcodeConfigFile 一个可选的 Xcode 可配置文件的完整路径,用于指定在真机上运行 WebDriverAgent 的个人身份或者团队身份的代码签名。 例如 /path/to/myconfig.xcconfig
keychainPath 从系统的 keychain 中导出私有开发秘钥的完整路径。在真机测试时与 keychainPassword 配合使用。 例如 /path/to/MyPrivateKey.p12
keychainPassword 在 keychainPath 中指定 keychain 的解锁密码。 例如 super awesome password
scaleFactor 模拟器缩放因子。这对于默认分辨率是大于实际分辨的模拟器来说非常有用。因此,你不用上下滑动模拟器的屏幕就能看到所有模拟器显示的内容了。 可接受的值为: '1.0', '0.75', '0.5', '0.33' 和 '0.25'。 这些值都应该是一个字符串
preventWDAAttachments 设置 WebDriverAgent 项目中的 DerivedData 文件夹的权限为仅可读。为了防止 XCTest 框架产生大量无用的截屏与日志,该设置是非常必要的,因为这是不可能通过 Apple 提供的接口去关闭的。 设置 capabilitity 为 true 将会设置 Posix 的文件夹的权限为 555,设置为 false 则会将权限重置回 755
webDriverAgentUrl 若提供了 URL,Appium 将在这 URL 上连接现有的 WebDriverAgent 实例,而不是重新启动一个。 例如 http://localhost:8100
useNewWDA 若设置为 true,则直接卸载设备上现存的所有 WebDriverAgent 客户端。在某些情况,该做法可以提高稳定性。默认设置为 false 例如 true
wdaLaunchTimeout 等待 WebDriverAgent 可 ping 同的时间(以毫秒为单位)。默认设置为 60000ms。 例如 30000
calendaraccessAuthorized 若设置为 true,则允许在 iOS 模拟器上访问日历。若设置为 false,则不被允许。否则,日历的 authorizationStatus 会保持不变。 -

 

  You.i 引擎独有

  <expand_table>

描述
youiEngineAppAddress 正在运行的应用的设备的 IP 地址。使用 localhost 作为模拟地址。使用 localhost 作为模拟器地址。使用设备的 IP 地址作为真机的 IP。 例如 localhost 或 192.168.1.203

 

  WinAppDriver 独有

  <expand_table>

描述
platformName 运行测试时所在的平台 例如 Windows
deviceName 运行测试时所使用设备的名字 例如 WindowsPC
app 被测 windows 应用的 appID 或被测的 .exe 文件的路径。 查阅该文档可了解更多查找 appID 的详细方法。 例如 c24c8163-548e-4b84-a466-530178fc0580_scyf5npe3hv32!App

 

Appium Desired Capabilities-Android Only

Appium Desired Capabilities-Android Only

Android Only

These Capabilities are available only on Android-baseddrivers (like UiAutomator2for example).

appActivity

Activity name for the Android activity you  want to launch from your package. This often needs to be preceded by a .  (e.g., .MainActivity instead of MainActivity). By default this capability is  received from the package manifest (action: android.intent.action.MAIN ,  category: android.intent.category.LAUNCHER)

MainActivity, .Settings

appPackage

Java package of the Android app you want to  run. By default this capability is received from the package manifest  (@package attribute value)

com.example.android.myApp,  com.android.settings

appWaitActivity

Activity name/names, comma separated, for the  Android activity you want to wait for. By default the value of this  capability is the same as for appActivity. You must set it to the very first  focused application activity name in case it is different from the one which  is set as appActivity if your capability has appActivity and appPackage.

SplashActivity, SplashActivity,OtherActivity,  *, *.SplashActivity

appWaitPackage

Java package of the Android app you want to  wait for. By default the value of this capability is the same as for  appActivity

com.example.android.myApp,  com.android.settings

appWaitDuration

Timeout in milliseconds used to wait for the  appWaitActivity to launch (default 20000)

30000

deviceReadyTimeout

Timeout in seconds while waiting for device to  become ready

5

allowTestPackages

Allow to install a test package which has  android:testOnly="true" in the manifest. false by default

true or false

androidCoverage

Fully qualified instrumentation class. Passed  to -w in adb shell am instrument -e coverage true -w

com.my.Pkg/com.my.Pkg.instrumentation.MyInstrumentation

androidCoverageEndIntent

A broadcast action implemented by yourself  which is used to dump coverage into file system. Passed to -a in adb shell am  broadcast -a

com.example.pkg.END_EMMA

androidDeviceReadyTimeout

Timeout in seconds used to wait for a device  to become ready after booting

e.g., 30

androidInstallTimeout

Timeout in milliseconds used to wait for an  apk to install to the device. Defaults to 90000

e.g., 90000

androidInstallPath

The name of the directory on the device in  which the apk will be push before install. Defaults to /data/local/tmp

e.g. /sdcard/Downloads/

adbPort

Port used to connect to the ADB server  (default 5037)

5037

systemPort

systemPort used to connect to appium-uiautomator2-server,  default is 8200 in general and selects one port from 8200 to 8299. When you  run tests in parallel, you must adjust the port to avoid conflicts. Read Parallel  Testing Setup Guide for more details.

e.g., 8201

remoteAdbHost

Optional remote ADB server host

e.g.: 192.168.0.101

androidDeviceSocket

Devtools socket name. Needed only when tested  app is a Chromium embedding browser. The socket is open by the browser and  Chromedriver connects to it as a devtools client.

e.g., chrome_devtools_remote

avd

Name of avd to launch

e.g., api19

avdLaunchTimeout

How long to wait in milliseconds for an avd to  launch and connect to ADB (default 120000)

300000

avdReadyTimeout

How long to wait in milliseconds for an avd to  finish its boot animations (default 120000)

300000

avdArgs

Additional emulator arguments used when  launching an avd

e.g., -netfast

useKeystore

Use a custom keystore to sign apks, default  false

true or false

keystorePath

Path to custom keystore, default  ~/.android/debug.keystore

e.g., /path/to.keystore

keystorePassword

Password for custom keystore

e.g., foo

keyAlias

Alias for key

e.g., androiddebugkey

keyPassword

Password for key

e.g., foo

chromedriverExecutable

The absolute local path to webdriver  executable (if Chromium embedder provides its own webdriver, it should be  used instead of original chromedriver bundled with Appium)

/abs/path/to/webdriver

chromedriverExecutableDir

The absolute path to a directory to look for  Chromedriver executables in, for automatic discovery of compatible  Chromedrivers. Ignored if chromedriverUseSystemExecutable is true

/abs/path/to/chromedriver/directory

chromedriverChromeMappingFile

The absolute path to a file which maps  Chromedriver versions to the minimum Chrome that it supports. Ignored if  chromedriverUseSystemExecutable is true

/abs/path/to/mapping.json

chromedriverUseSystemExecutable

If true, bypasses automatic Chromedriver  configuration and uses the version that comes downloaded with Appium. Ignored  if chromedriverExecutable is set. Defaults to false

e.g., true

autoWebviewTimeout

Amount of time to wait for Webview context to  become active, in ms. Defaults to 2000

e.g. 4

intentAction

Intent action which will be used to start  activity (default android.intent.action.MAIN)

e.g.android.intent.action.MAIN,  android.intent.action.VIEW

intentCategory

Intent category which will be used to start  activity (default android.intent.category.LAUNCHER)

e.g. android.intent.category.LAUNCHER,  android.intent.category.APP_CONTACTS

intentFlags

Flags that will be used to start activity  (default 0x10200000)

e.g. 0x10200000

optionalIntentArguments

Additional intent arguments that will be used  to start activity. See Intent  arguments

e.g. --esn <EXTRA_KEY>, --ez  <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE>, etc.

dontStopAppOnReset

Doesn''t stop the process of the app under  test, before starting the app using adb. If the app under test is created by  another anchor app, setting this false, allows the process of the anchor app  to be still alive, during the start of the test app using adb. In other  words, with dontStopAppOnReset set to true, we will not include the -S flag  in the adb shell am start call. With this capability omitted or set to false,  we include the -S flag. Default false

true or false

unicodeKeyboard

Enable Unicode input, default false

true or false

resetKeyboard

Reset keyboard to its original state, after  running Unicode tests with unicodeKeyboard capability. Ignored if used alone.  Default false

true or false

noSign

Skip checking and signing of app with debug  keys, will work only with UiAutomator and not with selendroid, default false

true or false

ignoreUnimportantViews

Calls the setCompressedLayoutHierarchy()  uiautomator function. This capability can speed up test execution, since  Accessibility commands will run faster ignoring some elements. The ignored  elements will not be findable, which is why this capability has also been  implemented as a toggle-able setting  as well as a capability. Defaults to false

true or false

disableAndroidWatchers

Disables android watchers that watch for  application not responding and application crash, this will reduce cpu usage  on android device/emulator. This capability will work only with UiAutomator  and not with selendroid, default false

true or false

chromeOptions

Allows passing chromeOptions capability for  ChromeDriver. For more information see chromeOptions

chromeOptions: {args:  [''--disable-popup-blocking'']}

recreateChromeDriverSessions

Kill ChromeDriver session when moving to a  non-ChromeDriver webview. Defaults to false

true or false

nativeWebScreenshot

In a web context, use native (adb) method for  taking a screenshot, rather than proxying to ChromeDriver. Defaults to false

true or false

androidScreenshotPath

The name of the directory on the device in  which the screenshot will be put. Defaults to /data/local/tmp

e.g. /sdcard/screenshots/

autoGrantPermissions

Have Appium automatically determine which  permissions your app requires and grant them to the app on install. Defaults  to false. If noReset is true, this capability doesn''t work.

true or false

networkSpeed

Set the network speed emulation. Specify the  maximum network upload and download speeds. Defaults to full

[''full'',''gsm'', ''edge'', ''hscsd'', ''gprs'',  ''umts'', ''hsdpa'', ''lte'', ''evdo''] Check -netspeed  option more info about speed emulation for avds

gpsEnabled

Toggle gps location provider for emulators  before starting the session. By default the emulator will have this option  enabled or not according to how it has been provisioned.

true or false

isHeadless

Set this capability to true to run the  Emulator headless when device display is not needed to be visible. false is  the default value. isHeadless  is also support for iOS, check XCUITest-specific capabilities.

e.g., true

uiautomator2ServerLaunchTimeout

Timeout in milliseconds used to wait for an  uiAutomator2 server to launch. Defaults to 20000

e.g., 20000

uiautomator2ServerInstallTimeout

Timeout in milliseconds used to wait for an  uiAutomator2 server to be installed. Defaults to 20000

e.g., 20000

otherApps

App or list of apps (as a JSON array) to  install prior to running tests

e.g., "/path/to/app.apk",  https://www.example.com/url/to/app.apk, ["/path/to/app-a.apk",  "/path/to/app-b.apk"]

adbExecTimeout

Timeout in milliseconds used to wait for adb  command execution. Defaults to 20000

e.g., 50000

localeScript

Sets the locale script

e.g., "Cyrl" (Cyrillic)

 

Appium Desired Capabilities-iOS Only

Appium Desired Capabilities-iOS Only

Appium Desired Capabilities-iOS Only

These Capabilities are available only on the XCUITest Driver and the deprecatedUIAutomation Driver.

calendarFormat

(Sim-only)  Calendar format to set for the iOS Simulator

e.g. gregorian

bundleId

Bundle ID of  the app under test. Useful for starting an app on a real device or for using other  caps which require the bundle ID during test startup. To run a test on a real  device using the bundle ID, you may omit the ''app'' capability, but you must  provide ''udid''.

e.g.  io.appium.TestApp

udid

Unique device  identifier of the connected physical device

e.g.  1ae203187fc012g

launchTimeout

Amount of time  in ms to wait for instruments before assuming it hung and failing the session

e.g. 20000

locationServicesEnabled

(Sim-only)  Force location services to be either on or off. Default is to keep current  sim setting.

true or false

locationServicesAuthorized

(Sim-only) Set  location services to be authorized or not authorized for app via plist, so  that location services alert doesn''t pop up. Default is to keep current sim  setting. Note that if you use this setting you MUST also use the bundleId  capability to send in your app''s bundle ID.

true or false

autoAcceptAlerts

Accept all iOS  alerts automatically if they pop up. This includes privacy access permission  alerts (e.g., location, contacts, photos). Default is false. Does not work on  XCUITest-based tests.

true or false

autoDismissAlerts

Dismiss all iOS  alerts automatically if they pop up. This includes privacy access permission  alerts (e.g., location, contacts, photos). Default is false. Does not work on  XCUITest-based tests.

true or false

nativeInstrumentsLib

Use native  intruments lib (ie disable instruments-without-delay).

true or false

nativeWebTap

(Sim-only)  Enable "real", non-javascript-based web taps in Safari. Default:  false. Warning: depending on viewport size/ratio this might not accurately  tap an element

true or false

safariInitialUrl

(Sim-only)  (>= 8.1) Initial safari url, default is a local welcome page

e.g.  https://www.github.com

safariAllowPopups

(Sim-only)  Allow javascript to open new windows in Safari. Default keeps current sim  setting

true or false

safariIgnoreFraudWarning

(Sim-only)  Prevent Safari from showing a fraudulent website warning. Default keeps  current sim setting.

true or false

safariOpenLinksInBackground

(Sim-only)  Whether Safari should allow links to open in new windows. Default keeps  current sim setting.

true or false

keepKeyChains

(Sim-only)  Whether to keep keychains (Library/Keychains) when appium session is  started/finished

true or false

localizableStringsDir

Where to look  for localizable strings. Default en.lproj

en.lproj

processArguments

Arguments to  pass to the AUT using instruments

e.g., -myflag

interKeyDelay

The delay, in  ms, between keystrokes sent to an element when typing.

e.g., 100

showIOSLog

Whether to show  any logs captured from a device in the appium logs. Default false

true or false

sendKeyStrategy

strategy to use  to type test into a test field. Simulator default: oneByOne. Real device  default: grouped

oneByOne,  grouped or setValue

screenshotWaitTimeout

Max timeout in  sec to wait for a screenshot to be generated. default: 10

e.g., 5

waitForAppScript

The ios  automation script used to determined if the app has been launched, by default  the system wait for the page source not to be empty. The result must be a  boolean

e.g. true;,  target.elements().length > 0;, $.delay(5000); true;

webviewConnectRetries

Number of times  to send connection message to remote debugger, to get webview. Default: 8

e.g., 12

appName

The display  name of the application under test. Used to automate backgrounding the app in  iOS 9+.

e.g., UICatalog

customSSLCert

(Sim only) Add  an SSL certificate to IOS Simulator.

e.g. 
 -----BEGIN CERTIFICATE-----MIIFWjCCBEKg...
 -----END CERTIFICATE-----

webkitResponseTimeout

(Real device  only) Set the time, in ms, to wait for a response from WebKit in a Safari  session. Defaults to 5000

e.g., 10000

remoteDebugProxy

(Sim only,  <= 11.2) If set, Appium sends and receives remote debugging messages  through a proxy on either the local port (Sim only, <= 11.2) or a proxy on  this unix socket (Sim only >= 11.3) instead of communicating with the iOS  remote debugger directly.

e.g. 12000 or  "/tmp/my.proxy.socket"

 

 

今天关于iPhone 通过UIRequiredDeviceCapabilities指定程序适用于哪些设备的介绍到此结束,谢谢您的阅读,有关An application is attempting to perform an action that requires privileges. Authentication is requir、Appium Desired Capabilities、Appium Desired Capabilities-Android Only、Appium Desired Capabilities-iOS Only等更多相关知识的信息可以在本站进行查询。

本文标签: