需要配置Appium的启动相关参数:
官网超详细参数配置及其含义

iOS配置:

{
  "platformVersion": "11.2.6",
  "deviceName": "iPhone",
  "platformName": "iOS",
  "udid": "手机udid",
  "bundleId": "APP bundleid",
  "automationName": "XCUITest",
  "xcodeSigningId": "iPhone Developer",
  "xcodeOrgId": "10位校验码",
  "showIOSLog": "true",
  "preventWDAAttachments": "false"
}

C6A65838-49AD-4297-872A-1F471CD316A2.png

A336B764865B54E3B6052376C1535718.png

启动成功界面:
Screen Shot 2018-09-18 at 6.45.51 PM.png

Android配置:

{
  "platformName": "Android",
  "deviceName": "MI_5s_Plus",
  "newCommandTimeout": 180,
  "udid": "设备号",
  "appActivity": "要启动的 Android acticity",
  "appPackage": "包名",
  "autoGrantPermissions": true
}

appActivity和appPackage可通过
adb shell dumpsys activity activities
命令行获取

例如结果中含有:cmp=com.Qunar/com.mqunar.hy.browser.HyMainActivity
则:

appPackage:com.Qunar
appActivity:com.mqunar.hy.browser.HyMainActivity

8B648255F2F5EFC60DCDAF053C81EF0D.png

启动成功界面:
AA9C062B-03DF-4095-AC7D-7A6D070DEC80.png


Shemiou
26 声望5 粉丝