Android 在VS2015上使用Appium和Selenium启动活动的权限被拒绝

Android 在VS2015上使用Appium和Selenium启动活动的权限被拒绝,android,selenium-webdriver,automated-tests,appium,user-acceptance-testing,Android,Selenium Webdriver,Automated Tests,Appium,User Acceptance Testing,我一直在尝试在Visual studio-2015中使用Selenium和Appium为特定应用程序运行android测试,但一直失败,每次运行时都会返回下面的错误消息。对于计算器等其他应用程序,它运行良好。我已经尝试过故障排除,但它总是出现同样的问题 代码如下: using System; using Microsoft.VisualStudio.TestTools.UnitTesting; using OpenQA.Selenium; using OpenQA.Selenium.Remote

我一直在尝试在Visual studio-2015中使用Selenium和Appium为特定应用程序运行android测试,但一直失败,每次运行时都会返回下面的错误消息。对于计算器等其他应用程序,它运行良好。我已经尝试过故障排除,但它总是出现同样的问题

代码如下:

using System;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using OpenQA.Selenium;
using OpenQA.Selenium.Remote;

namespace ZoneAppTesting
{
    [TestClass]
    public class UnitTest1
    {
        IWebDriver driver;

        [TestMethod]
        public void TestMethod1()
        {
            DesiredCapabilities capabilities = new DesiredCapabilities();
            capabilities.SetCapability("deviceName", "HT577SY03629");
            capabilities.SetCapability(CapabilityType.BrowserName, "Android");
            capabilities.SetCapability(CapabilityType.Version, "5.1");
            capabilities.SetCapability("platformName", "Android");
            capabilities.SetCapability("appPackage", "com.appzonegroup.dejavuandroid.zoneRevamp");
            capabilities.SetCapability("appActivity", "com.appzonegroup.dejavuandroid.activities.HelpActivity");

            driver = new RemoteWebDriver(new Uri("http://127.0.0.1:4723/wd/hub"), capabilities);
            driver.Manage().Timeouts().ImplicitlyWait(TimeSpan.FromSeconds(200));
        }
    }
}
这是Appium控制台错误日志

> Checking if an update is available
> Update not available
> Launching Appium server with command: C:\Program Files (x86)\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --platform-name Android --platform-version 22 --automation-name Appium --log-no-color
> info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
> info: Appium REST http interface listener started on 127.0.0.1:4723
> info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"22","automationName":"Appium"}
> info: Console LogLevel: debug
> info: --> POST /wd/hub/session {"desiredCapabilities":{"deviceName":"HT577SY03629","browserName":"Android","version":"5.1","platformName":"Android","appPackage":"com.appzonegroup.dejavuandroid.zoneRevamp","appActivity":"com.appzonegroup.dejavuandroid.activities.HelpActivity"}}
> info: Client User-Agent string: undefined
> info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : version
> info: [debug] Didn't get app but did get Android package, will attempt to launch it on the device
> info: [debug] Creating new appium session 8ba8b2af-c204-4c67-a5a3-c139ea222615
> info: Starting android appium
> info: [debug] Getting Java version
> info: Java version is: 1.8.0_111
> info: [debug] Checking whether adb is present
> info: [debug] Using adb from C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe
> warn: No app capability, can't parse package/activity
> info: [debug] Using fast reset? true
> info: [debug] Preparing device for session
> info: [debug] Not checking whether app is present since we are assuming it's already on the device
> info: Retrieving device
> info: [debug] Trying to find a connected android device
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe devices
> info: [debug] 1 device(s) connected
> info: Found device HT577SY03629
> info: [debug] Setting device id to HT577SY03629
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 wait-for-device
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "echo 'ready'"
> info: [debug] Starting logcat capture
> info: [debug] Getting device API level
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 22
> info: Device API level is: 22
> info: [debug] Extracting strings for language: default
> info: [debug] Apk doesn't exist locally
> info: [debug] Could not get strings, but it looks like we had an old strings file anyway, so ignoring
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "rm -rf /data/local/tmp/strings.json"
> info: [debug] Not uninstalling app since server not started with --full-reset
> info: [debug] Skipping install since we launched with a package instead of an app path
> info: [debug] Forwarding system:4724 to device:4724
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 forward tcp:4724 tcp:4724
> info: [debug] Pushing appium bootstrap to device...
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 push "C:\\Program Files (x86)\\Appium\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/
> info: [debug] Pushing settings apk to device...
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk"
> info: [debug] Pushing unlock helper app to device...
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
> info: Starting App
> info: [debug] Attempting to kill all 'uiautomator' processes
> info: [debug] Getting all processes with 'uiautomator'
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "ps 'uiautomator'"
> info: [debug] No matching processes found
> info: [debug] Running bootstrap
> info: [debug] spawning: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.appzonegroup.dejavuandroid.zoneRevamp -e disableAndroidWatchers false
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
> info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
> info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
> info: [debug] [BOOTSTRAP] [debug] Loading json...
> info: [debug] Waking up device if it's not alive
> info: [debug] Pushing command to appium work queue: ["wake",{}]
> info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
> info: [debug] [BOOTSTRAP] [debug] Client connected
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: wake
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":true}
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "dumpsys window"
> info: [debug] Screen already unlocked, continuing.
> info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"\/data\/local\/tmp"}
> info: [debug] dataDir set to: /data/local/tmp
> info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] Getting device API level
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "getprop ro.build.version.sdk"
> info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":false}
> info: [debug] Device is at API Level 22
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.appzonegroup.dejavuandroid.zoneRevamp/com.appzonegroup.dejavuandroid.activities.HelpActivity"
> error: Permission to start activity denied.
> info: [debug] Stopping logcat capture
> info: [debug] Logcat terminated with code null, signal SIGTERM
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
> info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
> info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"OK, shutting down"}
> info: [debug] [BOOTSTRAP] [debug] Closed client connection
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
> info: [debug] [UIAUTOMATOR STDOUT] Time: 2.188
> info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
> info: [debug] UiAutomator shut down normally
> info: [debug] Cleaning up android objects
> info: [debug] Cleaning up appium session
> error: Failed to start an Appium session, err was: Error: Permission to start activity denied.
> info: [debug] Error: Permission to start activity denied.
>     at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:1151:19)
>     at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:180:9)
>     at ChildProcess.exithandler (child_process.js:742:7)
>     at ChildProcess.emit (events.js:110:17)
>     at maybeClose (child_process.js:1016:16)
>     at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
> info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Permission to start activity denied.)","origValue":"Permission to start activity denied."},"sessionId":null}
> info: <-- POST /wd/hub/session 500 6834.503 ms - 194 
> Checking if an update is available
> Update not available
> Launching Appium server with command: C:\Program Files (x86)\Appium\node.exe lib\server\main.js --address 127.0.0.1 --port 4723 --platform-name Android --platform-version 22 --automation-name Appium --log-no-color
> info: Welcome to Appium v1.4.16 (REV ae6877eff263066b26328d457bd285c0cc62430d)
> info: Appium REST http interface listener started on 127.0.0.1:4723
> info: [debug] Non-default server args: {"address":"127.0.0.1","logNoColors":true,"platformName":"Android","platformVersion":"22","automationName":"Appium"}
> info: Console LogLevel: debug
> info: --> POST /wd/hub/session {"desiredCapabilities":{"deviceName":"HT577SY03629","browserName":"Android","version":"5.1","platformName":"Android","appPackage":"com.appzonegroup.dejavuandroid.zoneRevamp","appActivity":"com.appzonegroup.dejavuandroid.activities.HelpActivity"}}
> info: Client User-Agent string: undefined
> info: [debug] The following desired capabilities were provided, but not recognized by appium. They will be passed on to any other services running on this server. : version
> info: [debug] Didn't get app but did get Android package, will attempt to launch it on the device
> info: [debug] Creating new appium session 8ba8b2af-c204-4c67-a5a3-c139ea222615
> info: Starting android appium
> info: [debug] Getting Java version
> info: Java version is: 1.8.0_111
> info: [debug] Checking whether adb is present
> info: [debug] Using adb from C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe
> warn: No app capability, can't parse package/activity
> info: [debug] Using fast reset? true
> info: [debug] Preparing device for session
> info: [debug] Not checking whether app is present since we are assuming it's already on the device
> info: Retrieving device
> info: [debug] Trying to find a connected android device
> info: [debug] Getting connected devices...
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe devices
> info: [debug] 1 device(s) connected
> info: Found device HT577SY03629
> info: [debug] Setting device id to HT577SY03629
> info: [debug] Waiting for device to be ready and to respond to shell commands (timeout = 5)
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 wait-for-device
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "echo 'ready'"
> info: [debug] Starting logcat capture
> info: [debug] Getting device API level
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "getprop ro.build.version.sdk"
> info: [debug] Device is at API Level 22
> info: Device API level is: 22
> info: [debug] Extracting strings for language: default
> info: [debug] Apk doesn't exist locally
> info: [debug] Could not get strings, but it looks like we had an old strings file anyway, so ignoring
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "rm -rf /data/local/tmp/strings.json"
> info: [debug] Not uninstalling app since server not started with --full-reset
> info: [debug] Skipping install since we launched with a package instead of an app path
> info: [debug] Forwarding system:4724 to device:4724
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 forward tcp:4724 tcp:4724
> info: [debug] Pushing appium bootstrap to device...
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 push "C:\\Program Files (x86)\\Appium\\node_modules\\appium\\build\\android_bootstrap\\AppiumBootstrap.jar" /data/local/tmp/
> info: [debug] Pushing settings apk to device...
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 install "C:\Program Files (x86)\Appium\node_modules\appium\build\settings_apk\settings_apk-debug.apk"
> info: [debug] Pushing unlock helper app to device...
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 install "C:\Program Files (x86)\Appium\node_modules\appium\build\unlock_apk\unlock_apk-debug.apk"
> info: Starting App
> info: [debug] Attempting to kill all 'uiautomator' processes
> info: [debug] Getting all processes with 'uiautomator'
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "ps 'uiautomator'"
> info: [debug] No matching processes found
> info: [debug] Running bootstrap
> info: [debug] spawning: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell uiautomator runtest AppiumBootstrap.jar -c io.appium.android.bootstrap.Bootstrap -e pkg com.appzonegroup.dejavuandroid.zoneRevamp -e disableAndroidWatchers false
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] io.appium.android.bootstrap.Bootstrap:
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 1
> info: [debug] [BOOTSTRAP] [debug] Socket opened on port 4724
> info: [debug] [BOOTSTRAP] [debug] Appium Socket Server Ready
> info: [debug] [BOOTSTRAP] [debug] Loading json...
> info: [debug] Waking up device if it's not alive
> info: [debug] Pushing command to appium work queue: ["wake",{}]
> info: [debug] [BOOTSTRAP] [debug] Registered crash watchers.
> info: [debug] [BOOTSTRAP] [debug] Client connected
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"wake","params":{}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: wake
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":true}
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "dumpsys window"
> info: [debug] Screen already unlocked, continuing.
> info: [debug] Pushing command to appium work queue: ["getDataDir",{}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"getDataDir","params":{}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] [BOOTSTRAP] [debug] Got command action: getDataDir
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"\/data\/local\/tmp"}
> info: [debug] dataDir set to: /data/local/tmp
> info: [debug] Pushing command to appium work queue: ["compressedLayoutHierarchy",{"compressLayout":false}]
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"compressedLayoutHierarchy","params":{"compressLayout":false}}
> info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
> info: [debug] Getting device API level
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "getprop ro.build.version.sdk"
> info: [debug] [BOOTSTRAP] [debug] Got command action: compressedLayoutHierarchy
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":false}
> info: [debug] Device is at API Level 22
> info: [debug] executing cmd: C:\Users\ken4ward\AppData\Local\Android\sdk\platform-tools\adb.exe -s HT577SY03629 shell "am start -S -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -f 0x10200000 -n com.appzonegroup.dejavuandroid.zoneRevamp/com.appzonegroup.dejavuandroid.activities.HelpActivity"
> error: Permission to start activity denied.
> info: [debug] Stopping logcat capture
> info: [debug] Logcat terminated with code null, signal SIGTERM
> info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"shutdown"}
> info: [debug] Sent shutdown command, waiting for UiAutomator to stop...
> info: [debug] [BOOTSTRAP] [debug] Got command of type SHUTDOWN
> info: [debug] [BOOTSTRAP] [debug] Returning result: {"status":0,"value":"OK, shutting down"}
> info: [debug] [BOOTSTRAP] [debug] Closed client connection
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: numtests=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=.
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: id=UiAutomatorTestRunner
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: test=testRunServer
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: class=io.appium.android.bootstrap.Bootstrap
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: current=1
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: 0
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS: stream=
> info: [debug] [UIAUTOMATOR STDOUT] Test results for WatcherResultPrinter=.
> info: [debug] [UIAUTOMATOR STDOUT] Time: 2.188
> info: [debug] [UIAUTOMATOR STDOUT] OK (1 test)
> info: [debug] [UIAUTOMATOR STDOUT] INSTRUMENTATION_STATUS_CODE: -1
> info: [debug] UiAutomator shut down normally
> info: [debug] Cleaning up android objects
> info: [debug] Cleaning up appium session
> error: Failed to start an Appium session, err was: Error: Permission to start activity denied.
> info: [debug] Error: Permission to start activity denied.
>     at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:1151:19)
>     at [object Object].<anonymous> (C:\Program Files (x86)\Appium\node_modules\appium\node_modules\appium-adb\lib\adb.js:180:9)
>     at ChildProcess.exithandler (child_process.js:742:7)
>     at ChildProcess.emit (events.js:110:17)
>     at maybeClose (child_process.js:1016:16)
>     at Process.ChildProcess._handle.onexit (child_process.js:1088:5)
> info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Permission to start activity denied.)","origValue":"Permission to start activity denied."},"sessionId":null}
> info: <-- POST /wd/hub/session 500 6834.503 ms - 194 
>检查更新是否可用
>更新不可用
>使用以下命令启动Appium服务器:C:\Program Files(x86)\Appium\node.exe lib\server\main.js--地址127.0.0.1--端口4723--平台名称Android--平台版本22--自动化名称Appium--日志号颜色
>信息:欢迎使用Appium v1.4.16(版本ae6877eff263066b26328d457bd285c0cc62430d)
>信息:Appium REST http接口侦听器于127.0.0.1:4723启动
>信息:[调试]非默认服务器参数:{“地址”:“127.0.0.1”,“logNoColors”:true,“platformName”:“Android”,“platformVersion”:“22”,“automationName”:“Appium”}
>信息:控制台日志级别:调试
>信息:-->POST/wd/hub/session{“desiredCapabilities”:{“deviceName”:“HT577SY03629”,“browserName”:“Android”,“version”:“5.1”,“platformName”:“Android”,“appPackage”:“com.appzonegroup.dejavuandroid.zoneRevamp”,“appActivity”:“com.appzonegroup.dejavuandroid.activities.HelpActivity”}
>信息:客户端用户代理字符串:未定义
>信息:[调试]提供了以下所需功能,但appium无法识别。它们将被传递到此服务器上运行的任何其他服务:版本
>信息:[调试]未获取应用程序,但已获取Android软件包,将尝试在设备上启动它
>信息:[调试]创建新的应用程序会话8ba8b2af-c204-4c67-a5a3-c139ea222615
>信息:启动android appium
>信息:[调试]正在获取Java版本
>信息:Java版本为:1.8.0_111
>信息:[调试]检查adb是否存在
>信息:[调试]从C:\Users\ken4ward\AppData\Local\Android\sdk\platform tools\adb.exe使用adb
>警告:没有应用程序功能,无法分析包/活动
>信息:[调试]是否使用快速重置?真的
>信息:[调试]正在为会话准备设备
>信息:[调试]不检查应用程序是否存在,因为我们假设它已经在设备上
>信息:检索设备
>信息:[调试]正在尝试查找已连接的android设备
>信息:[调试]正在获取连接的设备。。。
>信息:[调试]正在执行cmd:C:\Users\ken4ward\AppData\Local\Android\sdk\platform tools\adb.exe设备
>信息:[调试]已连接1个设备
>信息:找到设备HT577SY03629
>信息:[调试]将设备id设置为HT577SY03629
>信息:[调试]等待设备准备就绪并响应shell命令(超时=5)
>信息:[调试]正在执行cmd:C:\Users\ken4ward\AppData\Local\Android\sdk\platform tools\adb.exe-s HT577SY03629等待设备
>信息:[调试]正在执行cmd:C:\Users\ken4ward\AppData\Local\Android\sdk\platform tools\adb.exe-s HT577SY03629 shell“echo'ready'”
>信息:[调试]正在启动logcat捕获
>信息:[调试]正在获取设备API级别
>信息:[调试]正在执行cmd:C:\Users\ken4ward\AppData\Local\Android\sdk\platform tools\adb.exe-s HT577SY03629 shell“getprop ro.build.version.sdk”
>信息:[调试]设备处于API级别22
>信息:设备API级别为:22
>信息:[调试]正在提取语言的字符串:默认值
>信息:[调试]本地不存在Apk
>信息:[调试]无法获取字符串,但看起来我们仍然有一个旧的字符串文件,因此忽略
>信息:[调试]正在执行cmd:C:\Users\ken4ward\AppData\Local\Android\sdk\platform tools\adb.exe-s HT577SY03629 shell“rm-rf/data/Local/tmp/strings.json”
>信息:[调试]未卸载应用程序,因为服务器未以--完全重置启动
>信息:[调试]正在跳过安装,因为我们是使用软件包而不是应用程序路径启动的
>信息:[调试]将系统:4724转发到设备:4724
>信息:[调试]正在执行cmd:C:\Users\ken4ward\AppData\Local\Android\sdk\platform tools\adb.exe-s HT577SY03629 forward tcp:4724 tcp:4724
>信息:[调试]正在将appium引导程序推送到设备。。。
>信息:[调试]执行cmd:C:\Users\ken4ward\AppData\Local\Android\sdk\platform tools\adb.exe-s HT577SY03629 push“C:\\Program Files(x86)\\Appium\\node\u modules\\Appium\\build\\Android\u bootstrap\\AppiumBootstrap.jar”/data/Local/tmp/
>信息:[调试]正在将设置apk推送到设备。。。
>信息:[调试]执行cmd:C:\Users\ken4ward\AppData\Local\Android\sdk\platform tools\adb.exe-s HT577SY03629安装“C:\Program Files(x86)\Appium\node\u modules\Appium\build\settings\u apk\settings\u apk-debug.apk”
>信息:[调试]正在将解锁帮助程序应用程序推送到设备。。。
>信息:[调试]正在执行cmd:C:\Users\ken4ward\AppData\Local\Android\sdk\platform tools\adb.exe-s HT577SY03629安装“C:\Program Files(x86)\Appium\node\u modules\Appium\build\unlock\apk\unlock\u apk-debug.apk”
>信息:启动应用程序
>信息:[调试]正在尝试终止所有“uiautomator”进程
>信息:[调试]使用“uiautomator”获取所有进程
>信息:[调试]正在执行cmd:C:\Users\ken4ward\AppData\Local\Android\sdk\platform tools\adb.exe-s HT577SY03629 shell“ps'uiautomator'”
>信息:[调试]未找到匹配的进程
>信息:[调试]正在运行引导
>信息:[调试]生成:C:\Users\ken4ward\AppData\Local\Android\sdk\platform tools\adb.exe-s HT577SY03629 shell uiautomator runtest AppiumBootstrap.jar-C io.appium.Android.bootstrap.bootstrap-e pkg com.appzonegroup.dejavuandroid.zoneRevamp-e disableAndroidWatchers false
>信息:[debug][UIAUTOMATOR STDOUT]检测\u状态:numtests=1
>信息:[调试][UIAUTOMATOR标准输出]检测\u状态:流=
>信息:[debug][UIAUTOMATOR STDOUT]io.appium.android.bootstrap.bootstrap:
>信息:[调试][UIAUTOMATOR标准输出]检测\u状态:id=UiAutomatorTestRunner
>信息:[debug][UIAUTOMATOR STDOUT]INSTRUMENTATION\u状态:test=testRunServer
>信息:[debug][UIAUTOMATOR STDOUT]检测\u状态:class=io.appium.android.bootstrap.bootstrap
>信息:[调试][UIAUTOMATOR标准输出]检测状态