appium driver参数及命令行参数

自己用的一套driver参数:

import time
from appium import webdriver
from util.operation_yaml import OperationYaml
from data.settings import CONNECT_INFO_YAML, info_key_format


class Driver:

    def __init__(self):
        # self.platform = platform
        self.oy = OperationYaml()

    def android(self,i):
        data = self.oy.read(CONNECT_INFO_YAML)
        info = data[info_key_format % int(i)]
        platform_version = info['platformVersion']
        device_name = info['deviceName']
        udid = info['udid']
        bport = info['bport']
        port = info['port']
        desired_caps = {
            'platformName': "Android",
            'platformVersion': "8",
            'deviceName': "d",
            # 'app': "/path/to/the/downloaded/ApiDemos-debug.apk",
            'appPackage': "com.tencent.mm",
            'appActivity': "com.tencent.mm.ui.LauncherUI",
            'automationName': "UiAutomator2",
            'systemPort': '8200',
            'noReset': 'true',
            'skipServerInstalltion': 'true', #跳过安装
            'udid': 'udid',
            'newCommandTimeout': 120,
            'ensureWebviewsHavePages':'true',
            'settings[waitForIdleTimeout]':0  #设置等待页面加载完成时间,默认10s
        }
        for i in range(15):
            try:
                return webdriver.Remote('http://127.0.0.1:%s/wd/hub' % port, desired_capabilities=desired_caps)
            except Exception as e:
                if i == 14:
                    raise e
                time.sleep(1)

    def ios(self, i):
        data = self.oy.read(CONNECT_INFO_YAML)
        info = data[info_key_format % int(i)]
        platform_version = info['platformVersion']
        device_name = info['deviceName']
        udid = info['udid']
        wda_local_port = info['wda_local_port']
        port = info['port']
        desired_caps = {
            'autoAcceptAlerts': True,
            'automationName': 'XCUITest',
            'bundleId': 'com.tencent.xin',
            'deviceName': device_name,
            'newCommandTimeout': 120,
            'noReset': True,
            'platformName': 'iOS',
            'platformVersion': platform_version,
            'udid': udid,
            'wdaLocalPort': wda_local_port,
            'xcodeOrgId': 'L8MRL9B64l'#开发者账号ID,加入开发者团队,主页会显示,这个是我随便写的一个
        }
        for i in range(15):
            try:
                return webdriver.Remote('http://127.0.0.1:%s/wd/hub' % port,
                                        desired_capabilities=desired_caps)
            except Exception as e:
                if i == 14:
                    raise e
                time.sleep(1)


if __name__ == '__main__':
    d = Driver().ios(0)

下方是官网的一套参数:

客服端参数地址:https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/caps.md

服务端参数地址:https://github.com/appium/appium/blob/master/docs/en/writing-running-appium/server-args.md

CapabilityDescriptionValues
automationNameWhich automation engine to useAppium (default), or UiAutomator2Espresso, or UiAutomator1 for Android, or XCUITest or Instruments for iOS, or YouiEngine for application built with You.i Engine
platformNameWhich mobile OS platform to useiOSAndroid, or FirefoxOS
platformVersionMobile OS versione.g., 7.14.4
deviceNameThe kind of mobile device or emulator to useiPhone SimulatoriPad SimulatoriPhone Retina 4-inchAndroid EmulatorGalaxy S4, etc.... On iOS, this should be one of the valid devices returned by instruments with instruments -s devices. On Android this capability is currently ignored, though it remains required.
appThe absolute local path or remote http URL to a .ipa file (IOS), .app folder (IOS Simulator), .apk file (Android) or .apks file (Android App Bundle), or a .zip file containing one of these. Appium will attempt to install this app binary on the appropriate device first. Note that this capability is not required for Android if you specify appPackage and appActivity capabilities (see below). UiAutomator2 and XCUITest allow to start the session without app or appPackage. Incompatible with browserName. See here about .apks file./abs/path/to/my.apk or http://myapp.com/app.ipa
otherAppsApp or list of apps (as a JSON array) to install prior to running tests. Note that it will not work with automationName of Espresso and iOS real devicese.g., "/path/to/app.apk"https://www.example.com/url/to/app.apk["http://appium.github.io/appium/assets/TestApp9.4.app.zip", "/path/to/app-b.app"]
browserNameName of mobile web browser to automate. Should be an empty string if automating an app instead.'Safari' for iOS and 'Chrome', 'Chromium', or 'Browser' for Android
newCommandTimeoutHow long (in seconds) Appium will wait for a new command from the client before assuming the client quit and ending the sessione.g. 60
languageLanguage to set for iOS (XCUITest driver only) and Android.e.g. fr
localeLocale to set for iOS (XCUITest driver only) and Android. fr_CA format for iOS. CA format (country name abbreviation) for Androide.g. fr_CACA
udidUnique device identifier of the connected physical devicee.g. 1ae203187fc012g
orientation(Sim/Emu-only) start in a certain orientationLANDSCAPE or PORTRAIT
autoWebviewMove directly into Webview context. Default falsetruefalse
noResetDon't reset app state before this session. See here for more detailstruefalse
fullResetPerform a complete reset. See here for more detailstruefalse
eventTimingsEnable or disable the reporting of the timings for various Appium-internal events (e.g., the start and end of each command, etc.). Defaults to false. To enable, use true. The timings are then reported as events property on response to querying the current session. See the event timing docs for the the structure of this response.e.g., true
enablePerformanceLogging(Web and webview only) Enable Chromedriver's (on Android) or Safari's (on iOS) performance logging (default false)truefalse
printPageSourceOnFindFailureWhen a find operation fails, print the current page source. Defaults to false.e.g., true
clearSystemFilesDelete any generated files at the end of a session. Default to false.truefalse

Update settings

CapabilityDescriptionValues
settings[settingsKey]Update Appium Settings on session creation.e.g., 'settings[mjpegScalingFactor]': 10'settings[shouldUseCompactResponses]': true

Android Only

These Capabilities are available only on Android-based drivers.

CapabilityDescriptionValues
appActivityActivity 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
appPackageJava 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.myAppcom.android.settings
appWaitActivityActivity 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. You can also use wildcards (*).SplashActivitySplashActivity,OtherActivity**.SplashActivity
appWaitPackageJava package of the Android app you want to wait for. By default the value of this capability is the same as for appActivitycom.example.android.myAppcom.android.settings
appWaitDurationTimeout in milliseconds used to wait for the appWaitActivity to launch (default 20000)30000
deviceReadyTimeoutTimeout in seconds while waiting for device to become ready5
allowTestPackagesAllow to install a test package which has android:testOnly="true" in the manifest. false by defaulttrue or false
androidCoverageFully qualified instrumentation class. Passed to -w in adb shell am instrument -e coverage true -wcom.my.Pkg/com.my.Pkg.instrumentation.MyInstrumentation
androidCoverageEndIntentA broadcast action implemented by yourself which is used to dump coverage into file system. Passed to -a in adb shell am broadcast -acom.example.pkg.END_EMMA
androidDeviceReadyTimeoutTimeout in seconds used to wait for a device to become ready after bootinge.g., 30
androidInstallTimeoutTimeout in milliseconds used to wait for an apk to install to the device. Defaults to 90000e.g., 90000
androidInstallPathThe name of the directory on the device in which the apk will be push before install. Defaults to /data/local/tmpe.g. /sdcard/Downloads/
adbPortPort used to connect to the ADB server (default 5037)5037
systemPortsystemPort used to connect to appium-uiautomator2-server or appium-espresso-driver. The default is 8200 in general and selects one port from 8200 to 8299 for appium-uiautomator2-server, it is 8300 from 8300 to 8399 for appium-espresso-driver. 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
remoteAdbHostOptional remote ADB server hoste.g.: 192.168.0.101
androidDeviceSocketDevtools 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
avdName of avd to launche.g., api19
avdLaunchTimeoutHow long to wait in milliseconds for an avd to launch and connect to ADB (default 60000)300000
avdReadyTimeoutHow long to wait in milliseconds for an avd to finish its boot animations (default 120000)300000
avdArgsAdditional emulator arguments used when launching an avde.g., -netfast
useKeystoreUse a custom keystore to sign apks, default falsetrue or false
keystorePathPath to custom keystore, default ~/.android/debug.keystoree.g., /path/to.keystore
keystorePasswordPassword for custom keystoree.g., foo
keyAliasAlias for keye.g., androiddebugkey
keyPasswordPassword for keye.g., foo
chromedriverExecutableThe 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
chromedriverArgsAn array of arguments to be passed to the chromedriver binary when it's run by Appium. By default no CLI args are added beyond what Appium uses internally (such as --url-base--port--adb-port, and --log-path.e.g., ["--disable-gpu", "--disable-web-security"]
chromedriverExecutableDirThe 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
chromedriverChromeMappingFileThe 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
chromedriverUseSystemExecutableIf true, bypasses automatic Chromedriver configuration and uses the version that comes downloaded with Appium. Ignored if chromedriverExecutable is set. Defaults to falsee.g., true
autoWebviewTimeoutAmount of time to wait for Webview context to become active, in ms. Defaults to 2000e.g. 4
chromedriverPortNumeric port to start Chromedriver on. Note that use of this capability is discouraged as it will cause undefined behavior in case there are multiple webviews present. By default Appium will find a free port.e.g. 8000
chromedriverPortsA list of valid ports for Appium to use for communication with Chromedrivers. This capability supports multiple webview scenarios. The form of this capability is an array of numeric ports, where array items can themselves be arrays of length 2, where the first element is the start of an inclusive range and the second is the end. By default, Appium will use any free port.e.g. [8000, [9000, 9005]]
ensureWebviewsHavePagesWhether or not Appium should augment its webview detection with page detection, guaranteeing that any webview contexts which show up in the context list have active pages. This can prevent an error if a context is selected where Chromedriver cannot find any pages. Defaults to falsee.g. true
webviewDevtoolsPortTo support the ensureWebviewsHavePages feature, it is necessary to open a TCP port for communication with the webview on the device under test. This capability allows overriding of the default port of 9222, in case multiple sessions are running simultaneously (to avoid port clash), or in case the default port is not appropriate for your system.e.g. 9543
enableWebviewDetailsCollectionEnables collection of detailed WebView information via /json/version CDP (Chrome Developer Protocol) endpoint since Appium 1.18.0+. This helps to properly match Chromedriver version which supports the given WebView. Without this flag enabled, Appium tries to guess the version of the WebView based on the version of the corresponding installed package (which usually fails for custom web views). Defaults to falsetrue or false
dontStopAppOnResetDoesn'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 falsetrue or false
unicodeKeyboardEnable Unicode input, default falsetrue or false
resetKeyboardReset keyboard to its original state, after running Unicode tests with unicodeKeyboard capability. Ignored if used alone. Default falsetrue or false
noSignSkip checking and signing of app with debug keys, will work only with UiAutomator, default falsetrue or false
ignoreUnimportantViewsCalls 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 falsetrue or false
disableAndroidWatchersDisables 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, default falsetrue or false
chromeOptionsAllows passing chromeOptions capability for ChromeDriver. For more information see chromeOptionschromeOptions: {args: ['--disable-popup-blocking']}
recreateChromeDriverSessionsKill ChromeDriver session when moving to a non-ChromeDriver webview. Defaults to falsetrue or false
nativeWebScreenshotIn a web context, use native (adb) method for taking a screenshot, rather than proxying to ChromeDriver. Defaults to falsetrue or false
androidScreenshotPathThe name of the directory on the device in which the screenshot will be put. Defaults to /data/local/tmpe.g. /sdcard/screenshots/
autoGrantPermissionsHave 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
networkSpeedSet 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
gpsEnabledToggle 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
isHeadlessSet 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
adbExecTimeoutTimeout in milliseconds used to wait for adb command execution. Defaults to 20000e.g., 50000
localeScriptSets the locale scripte.g., "Cyrl" (Cyrillic)
skipDeviceInitializationSkip device initialization which includes i.a.: installation and running of Settings app or setting of permissions. Can be used to improve startup performance when the device was already used for automation and it's prepared for the next automation. Defaults to falsetrue or false
chromedriverDisableBuildCheckSets the chromedriver flag --disable-build-check for Chrome webview teststrue or false
skipUnlockSkips unlock during session creation. Defaults to falsetrue or false
unlockTypeUnlock the target device with particular lock pattern instead of just waking up the device with a helper app. It works with unlockKey capability. Defaults to undefined. fingerprint is available only for Android 6.0+ and emulators. Read unlock doc in android driver.['pin', 'password', 'pattern', 'fingerprint']
unlockKeyA key pattern to unlock used by unlockType.e.g., '1111'
autoLaunchInitializing the app under test automatically. Appium does not install/launch the app under test if this is false. Defaults to truetrue or false
skipLogcatCaptureSkips to start capturing logcat. It might improve performance such as network. Log related commands will not work. Defaults to false.true or false
uninstallOtherPackagesA package, list of packages or * to uninstall package/s before installing apks for test. '*' uninstall all of thrid-party packages except for packages which is necessary for Appium to test such as io.appium.settings or io.appium.uiautomator2.server since Appium already contains the logic to manage them.e.g. "io.appium.example"["io.appium.example1", "io.appium.example2"]'*'
disableWindowAnimationSet device animation scale zero if the value is true. After session is complete, Appium restores the animation scale to it's original value. Defaults to falsetruefalse
remoteAppsCacheLimitSet the maximum number of remote cached apks (default is 10) which are pushed to the device-under-test's local storage. Caching apks remotely speeds up the execution of sequential test cases, when using the same set of apks, by avoiding the need to be push an apk to the remote file system every time a reinstall is needed. Set this capability to 0 to disable caching.e.g. 0520
buildToolsVersionSpecify the Android build-tools version to be something different than the default, which is to use the most recent version. It is helpful to use a non-default version if your environment uses alpha/beta build tools.e.g. '28.0.3'
androidNaturalOrientationAllow for correct handling of orientation on landscape-oriented devices. Set to true to basically flip the meaning of PORTRAIT and LANDSCAPE. Defaults to falsetruefalse
enforceAppInstallBy default application installation is skipped if newer or the same version of this app is already present on the device under test. Setting this option to true will enforce Appium to always install the current application build independently of the currently installed version of it. Defaults to false.true , false
ignoreHiddenApiPolicyErrorIgnores Security exception: Permission denial alert and allows to continue the session creation process since Appium 1.18.0+. The error happens when Appium tries to relax hidden API policy, although some devices with a customized firmware deny such requests. Defaults to false.truefalse
mockLocationAppSets the package identifier of the app, which is used as a system mock location provider since Appium 1.18.0+. This capability has no effect on emulators. If the value is set to null or an empty string, then Appium will skip the mocked location provider setup procedure. Defaults to Appium Setting package identifier (io.appium.settings).e.g., nullio.appium.settingsexample.your.app
logcatFormatSet the output format for logcat messages since Appium 1.18.0. Supported formats are listed in here. Please read logcat#outputFormat for more details about each format. Defaults to threadtime.e.g., process
logcatFilterSpecsSet the output filter rule for logcat messages since Appium 1.18.0. Please read logcat#filteringOutput for more details about the rule. Write and View Logs with Logcat is also helpful.e.g., ['*:W', 'MyActivity:D'] (MyActivity is a tag)
allowDelayAdbWhether enable -delay-adb on emulator startup. Defaults to truetruefalse

UIAutomator 1

These Capabilities are available on UIAutomator 1.

CapabilityDescriptionValues
intentActionIntent action which will be used to start activity (default android.intent.action.MAIN)e.g.android.intent.action.MAINandroid.intent.action.VIEW
intentCategoryIntent category which will be used to start activity (default android.intent.category.LAUNCHER)e.g. android.intent.category.LAUNCHERandroid.intent.category.APP_CONTACTS
intentFlagsFlags that will be used to start activity (default 0x10200000)e.g. 0x10200000
optionalIntentArgumentsAdditional intent arguments that will be used to start activity. See Intent argumentse.g. --esn <EXTRA_KEY>--ez <EXTRA_KEY> <EXTRA_BOOLEAN_VALUE>, etc.

UIAutomator2 Only

Please refer to the documentation on the UIAutomator2 driver repository about its available capabilities.

Espresso Only

Please refer to the documentation on the Espresso driver repository about its available capabilities.

iOS Only

These Capabilities are available only on the XCUITest Driver and the deprecated UIAutomation Driver.

CapabilityDescriptionValues
calendarFormat(Sim-only) Calendar format to set for the iOS Simulatore.g. gregorian
bundleIdBundle 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
udidUnique device identifier of the connected physical devicee.g. 1ae203187fc012g
launchTimeoutAmount of time in ms to wait for instruments before assuming it hung and failing the sessione.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
autoAcceptAlertsAccept all iOS alerts automatically if they pop up. This includes privacy access permission alerts (e.g., location, contacts, photos). Default is false.true or false
autoDismissAlertsDismiss all iOS alerts automatically if they pop up. This includes privacy access permission alerts (e.g., location, contacts, photos). Default is false.true or false
nativeInstrumentsLibUse native intruments lib (ie disable instruments-without-delay).true or false
nativeWebTapEnable "real", non-javascript-based web taps in Safari. Default: false. Warning: depending on viewport size/ratio; this might not accurately tap an elementtrue or false
safariInitialUrlInitial safari url, default is a local welcome pagee.g. https://www.github.com
safariAllowPopups(Sim-only) Allow javascript to open new windows in Safari. Default keeps current sim settingtrue 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/finishedtrue or false
localizableStringsDirWhere to look for localizable strings. Default en.lprojen.lproj
processArgumentsArguments to pass to the AUT using instrumentse.g., -myflag
interKeyDelayThe delay, in ms, between keystrokes sent to an element when typing.e.g., 100
showIOSLogWhether to show any logs captured from a device in the appium logs. Default falsetrue or false
sendKeyStrategystrategy to use to type test into a test field. Simulator default: oneByOne. Real device default: groupedoneByOnegrouped or setValue
screenshotWaitTimeoutMax timeout in sec to wait for a screenshot to be generated. default: 10e.g., 5
waitForAppScriptThe 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 booleane.g. true;target.elements().length > 0;$.delay(5000); true;
webviewConnectRetriesNumber of times to send connection message to remote debugger, to get webview. Default: 8e.g., 12
appNameThe 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 5000e.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"
enableAsyncExecuteFromHttpscapability to allow simulators to execute asynchronous JavaScript on pages using HTTPS. Defaults to falsetrue or false
skipLogCaptureSkips to start capturing logs such as crash, system, safari console and safari network. It might improve performance such as network. Log related commands will not work. Defaults to false.true or false
webkitDebugProxyPort(Real device only) Port to which ios-webkit-debug-proxy is connected, during real device tests. Default is 27753.12021
fullContextListReturns the detailed information on contexts for the get available context command. If this capability is enabled, then each item in the returned contexts list would additionally include WebView title, full URL and the bundle identifier. Defaults to false.true or false

 

Appium 服务器参数

许多 Appium 1.5 中的服务器参数已被弃用,取而代之使用的是 -default-capabilities 标识 。

用法:node . [标志]

服务器标志

所有标志都是可选的,但是有些必须跟指定标志组合使用才生效。

 

标志默认描述示例
--shellnull进入 REPL 模式 
--allow-corsfalse打开 CORS 兼容模式,这将允许从托管在任何域中的网站内连接到 Appium 服务器。启用此功能时要小心,因为如果您访问的网站使用跨域请求,在 Appium 服务器上启动或运行内省会话,则可能存在安全风险。 
--ipanull(仅 iOS).ipa 文件的绝对路径--ipa /abs/path/to/my.ipa
-a--address0.0.0.0监听的 ip 地址--address 0.0.0.0
-p--port4723监听的端口--port 4723
-ca--callback-addressnull回调 ip 地址 (默认:与 --address 相同)--callback-address 127.0.0.1
-cp--callback-portnull回调端口(默认:与 --port 相同)--callback-port 4723
-bp--bootstrap-port4724(仅 Android)设备跟 Appium 通信的端口--bootstrap-port 4724
-r--backend-retries3(仅 iOS)遇到 crash 或者超时,尝试重启Instruments的次数--backend-retries 3
--session-overridefalse允许 session 覆盖(如有冲突) 
-l--pre-launchfalse首次建立session时预启动应用(iOS 需要 –app 参数,Android 需要 –app-pkg 和 –app-activity 参数) 
-g--lognull将日志输出到指定文件--log /path/to/appium.log
--log-leveldebug为控制台和日志文件设置服务器日志等级(值为 console-level:logfile-level,如果只提供一个值,则两者相同)。可选的值为 debuginfowarnerror,并且越往后,日志越少。--log-level error:debug
--log-timestampfalse在终端输出中显示时间戳 
--local-timezonefalse时间戳使用本地时区 
--log-no-colorsfalse终端输出不为彩色 
-G--webhooknull同时发送日志输出到 HTTP 监听器--webhook localhost:9876
--safarifalse(仅iOS)使用 safari 应用程序 
--default-device-ddfalse(仅iOS模拟器)使用默认模拟器启动 Instruments 
--force-iphonefalse(仅 iOS)不管应用程序指定什么设备,都强制使用 iPhone 模拟器 
--force-ipadfalse(仅 iOS)不管应用程序指定什么设备,都强制使用 iPad 模拟器 
--tracetemplatenull(仅 iOS) 指定 Instruments 所使用的 .tracetemplate 文件--tracetemplate /Users/me/Automation.tracetemplate
--instrumentsnull(仅 iOS)Instruments 二进制文件的路径--instruments /path/to/instruments
--nodeconfignull指定 JSON 格式的配置文件,用于在 selenium grid 中注册 appium--nodeconfig /abs/path/to/nodeconfig.json
-ra--robot-address0.0.0.0robot 的 IP 地址--robot-address 0.0.0.0
-rp--robot-port-1robot 的端口号--robot-port 4242
--selendroid-port8080用于和 Selendroid 通信的本地端口--selendroid-port 8080
--chromedriver-port9515ChromeDriver 运行使用的端口--chromedriver-port 9515
--chromedriver-executablenullChromeDriver 可执行文件的完整路径 
--show-configfalse打印 appium 服务器的配置信息,然后退出 
--no-perms-checkfalse绕过Appium检查,确保我们可以读 / 写必要的文件 
--strict-capsfalse如果所选设备不能被 appium 有效识别,则导致会话失败 
--isolate-sim-devicefalseXcode 6 在某些平台上存在存在一个 bug,想要正确启动某个模拟器,只能去删除掉所有其他模拟器。这个选项将导致了 Appium 删除除了正在使用的设备以外其他所有设备。请注意,这是永久性删除,你可以使用 simctl 或 xcode 管理被 Appium 使用的设备类别。 
--tmpnull目录的绝对路径将被 Appium 用于管理临时文件,比如存放需要移动的内置 iOS 应用程序。在 *nix / Mac 上默认为 /tmp,在 Windows 上默认为 C:\Windows\Temp 
--trace-dirnullappium 用于保存iOS instruments 轨迹的目录,是绝对路径,默认为 /appium-instruments 
--debug-log-spacingfalse在日志中加大间距,帮助进行视觉检查 
--suppress-adb-kill-serverfalse(仅 Android) 如果设置了,可以阻止 Appium 杀掉 adb 实例 
--async-tracefalse向日志条目添加长堆栈追踪。建议仅在调试时使用 
--webkit-debug-proxy-port27753(仅 iOS)用于 ios-webkit-debug-proxy 通信的本地端口--webkit-debug-proxy-port 27753
-dc--default-capabilities{}设置默认预期功能(Desired capabilities),每个会话都将使用默认预期功能,除非被新的功能覆盖--default-capabilities [ '{"app": "myapp.app", "deviceName": "iPhone Simulator"}' | /path/to/caps.json ]
--rebootfalse- (仅 Android)每次建立会话都重启模拟器,会话结束后杀掉模拟器 
--command-timeout60【弃用】- 没有效果。这曾是服务器用于所有会话接收命令的默认超时时间(单位是秒,但不超过 2147483)。预期能力(Desired capabilities)中的 newCommandTimeout 替代 
-k--keep-artifactsfalse【弃用】 - 没有效果。trace 现在默认位于 tmp 目录下,每次运行前都会清除。请查考 --trace-dir 标识 
--platform-namenull【弃用】 - 移动平台名称:iOS、Android 或 FirefoxOS--platform-name iOS
--platform-versionnull【弃用】 - 移动平台的版本号--platform-version 7.1
--automation-namenull【弃用】 - 自动化工具的名称: Appium 或 Selendroid--automation-name Appium
--device-namenull【弃用】 - 将使用的移动设备的名称--device-name iPhone Retina (4-inch), Android Emulator
--browser-namenull【弃用】 - 移动浏览器的名称: Safari 或者 Chrome--browser-name Safari
--appnul【弃用】 - IOS:基于模拟器编译的 .app 文件的绝对路径或者设备上目标的 BundleId; Android:.apk 文件的绝对路径--app /abs/path/to/my.app
-lt--launch-timeout90000【弃用】 - (仅iOS) Instruments启动等待时间(单位:ms) 
--languagenull【弃用】 - iOS 模拟器 / Android 模拟器的语言--language en
--localenull【弃用】 - iOS 模拟器 / Android 模拟器的区域--locale en_US
-U--udidnull【弃用】 - 连接的物理设备的 udid--udid 1adsf-sdfas-asdf-123sdf
--orientationnull【弃用】 - (仅 iOS) 初始化请求时,使用 LANDSCAPE 或者 PORTRAIT--orientation LANDSCAPE
--no-resetfalse【弃用】 - 会话(session)之间不重置应用状态(IOS: 不删除应用的 plist 文件;Android:在创建一个新的session前不删除应用) 
--full-resetfalse【弃用】 - (iOS)删除整个模拟器目录。(Android)通过卸载应用(而不是清除数据)重置应用状态。在 Android 中会话(session)完成后也会删除应用。 
--app-pkgnull【弃用】 - (仅 Android)想要运行的 apk 的 java 包(例如, com.example.android.myApp)--app-pkg com.example.android.myApp
--app-activitynull【弃用】 - (仅 Android)打开应用时,想要启动的 Activity 的名称(例如 MainActivity)--app-activity MainActivity
--app-wait-packagefalse【弃用】 - (仅 Andorid)想要等待的 activity 的包名(例如 com.example.android.myApp)--app-wait-package com.example.android.myApp
--app-wait-activityfalse【弃用】 - (仅 Andorid)想要等待的 activity 名(例如 SplashActivity)--app-wait-activity SplashActivity
--device-ready-timeout5【弃用】 - (仅 Andorid)等待设备准备就绪的超时时间(单位:秒)--device-ready-timeout 5
--android-coveragefalse【弃用】 - (仅 Andorid)完全符合条件的 instrumentation 类,作为命令 adb shell am instrument -e coverage true -w 中的 -w 的参数--android-coverage com.my.Pkg/com.my.Pkg.instrumentation.MyInstrumentation
--avdnull【弃用】 - (仅 Andorid)要启动的安卓虚拟设备的名称--avd @default
--avd-argsnull【弃用】 - (仅 Andorid)启动安装虚拟设备时额外的模拟器参数--avd-args -no-snapshot-load
--use-keystorefalse【弃用】 - (仅 Andorid)设置 apk 签名的 keystore 
--keystore-path<user>/.android/debug.keystore【弃用】 - (仅 Andorid)keystore 的路径 
--keystore-passwordandroid【弃用】 - (仅 Andorid)keystore 的密码 
--key-aliasandroiddebugkey【弃用】 - (仅 Andorid)key 的别名 
--key-passwordandroid【弃用】 - (仅 Andorid)key 的密码 
--intent-actionandroid.intent.action.MAIN【弃用】 - (仅 Andorid)用于启动 activity 的 Intent action--intent-action android.intent.action.MAIN
--intent-categoryandroid.intent.category.LAUNCHER【弃用】 - (仅 Andorid)用于启动 activity 的 Intent category--intent-category android.intent.category.APP_CONTACTS
--intent-flags0x10200000【弃用】 - (仅 Andorid)启动 activity 的标识--intent-flags 0x10200000
--intent-argsnull【弃用】 - (仅 Andorid)启动 activity 时附带额外的 intent 参数--intent-args 0x10200000
--dont-stop-app-on-resetfalse【弃用】 - (仅 Andorid)用于设置 appium 重启时是否先杀掉 app 
--calendar-formatnull【弃用】 - (仅 iOS)iOS 模拟器的日历格式--calendar-format gregorian
--native-instruments-libfalse【弃用】 - (仅 iOS)iOS 内建了一个怪异的不可能避免的延迟,我们在Appium里修复了它,如果你想用原来的,你可以使用这个参数 
--keep-keychainsfalse【弃用】 - (仅 iOS) 当 Appium 启动或者关闭的时候,是否保留keychains(Library / Keychains) 
--localizable-strings-diren.lproj【弃用】 - (仅 iOS)Localizable.strings 与目录的相对路径--localizable-strings-dir en.lproj
--show-ios-logfalse【弃用】 - (仅 iOS)如果设置了,iOS 系统日志将会输出到终端 
--relaxed-securityfalse禁用额外的安全检查,因此可以使用支持此选项的驱动程序提供的某些高级功能。只有当所有客户端都位于可信任网络中,才启用它;如果客户端可能会突破会话沙箱,则不应该启用它。
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值