2017-02-01 63 views
2

我有Xcode 8.2版本。我在eclipse中編寫代碼並嘗試運行。我能夠安裝ipa文件,但試圖打開應用程序時,它不能打開。請在下面找到我的代碼 -在appium中啓動iOS設備時出現錯誤

package com.sampleiOS.com.sampleiOS; 

import java.io.File; 
import java.net.MalformedURLException; 
import java.net.URL; 

import io.appium.java_client.AppiumDriver; 
import io.appium.java_client.MobileElement; 
import io.appium.java_client.ios.IOSDriver; 
import io.appium.java_client.remote.MobileCapabilityType; 
import io.appium.java_client.service.local.AppiumDriverLocalService; 
import io.appium.java_client.service.local.AppiumServiceBuilder; 

//import org.openqa.selenium.WebDriver; 
//import org.openqa.selenium.firefox.FirefoxDriver; 
import org.openqa.selenium.remote.DesiredCapabilities; 
import org.testng.annotations.Test; 




/** 
* Unit test for simple App. 
*/ 
public class AppTest 
{ 
    //public WebDriver driver; 
    public AppiumDriver<MobileElement> driver; 
    /** 
    * @return 
    * @return 
    * @return the suite of tests being tested 
    * @throws MalformedURLException 
    * @throws InterruptedException 
    */ 
    @Test 
    public void Rijo() throws MalformedURLException, InterruptedException 
    { 

     AppiumDriverLocalService service = AppiumDriverLocalService 
       .buildService(new AppiumServiceBuilder() 
         .usingDriverExecutable(new File("/usr/local/opt/node/bin/node")) 
         .withAppiumJS(new File(
           "/usr/local/lib/node_modules/appium/build/lib/main.js"))); 
         //.withLogFile(new File("AppiumServerLogs/logs.txt"))); 
     service.start(); 
     DesiredCapabilities capabilities = new DesiredCapabilities(); 
     capabilities.setCapability(MobileCapabilityType.DEVICE_NAME, "Ipod"); 
     capabilities.setCapability(MobileCapabilityType.PLATFORM_VERSION, "9.3"); 
     capabilities.setCapability(MobileCapabilityType.UDID, "4319165xxxxx"); 
     capabilities.setCapability("app", "/Users/rijom/Downloads/xx.ipa"); 
     capabilities.setCapability("automationName", "XCUITest"); 

     driver = new IOSDriver<MobileElement>(new URL("http://0.0.0.0:4723/wd/hub"), capabilities); 
     Thread.sleep(5000); 

    } 
} 

請在下面找到appium控制檯日誌 -

[TestNG] Running: 
    /private/var/folders/hh/qx4s0ttd3zg3fn0w7g10hgt00000gs/T/testng-eclipse--1535528232/testng-customsuite.xml 

[Appium] Welcome to Appium v1.6.0 (REV 0f37e2943bba265b42bb2087ea24b86dcc614c35) 
[Appium] Appium REST http interface listener started on 0.0.0.0:4723 
[HTTP] --> GET /wd/hub/status {} 
[MJSONWP] Calling AppiumDriver.getStatus() with args: [] 
[MJSONWP] Responding to client with driver.getStatus() result: {"build":{"version":"1.6.0"... 
[HTTP] <-- GET /wd/hub/status 200 23 ms - 121 
[HTTP] --> POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/rijom/Downloads/RSSFeedReader.ipa","automationName":"XCUITest","udid":"43191654cb4d510f9f3e75a1577fef3bff459859","platformName":"iOS","deviceName":"Ipod","platformVersion":"9.3"}} 
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"/Users/rijom/Downl... 
[Appium] Creating new XCUITestDriver session 
[Appium] Capabilities: 
[Appium] app: '/Users/rijom/Downloads/RSSFeedReader.ipa' 
[Appium] automationName: 'XCUITest' 
[Appium] udid: '43191654cb4d510f9f3e75a1577fef3bff459859' 
[Appium] platformName: 'iOS' 
[Appium] deviceName: 'Ipod' 
[Appium] platformVersion: '9.3' 
[debug] [XCUITest] XCUITestDriver version: 2.0.26 
[BaseDriver] Session created with session id: ed58e7cb-1b46-42ca-aacf-c5edc9289573 
[debug] [XCUITest] Xcode version set to '8.2' 
[debug] [XCUITest] iOS SDK Version set to '10.2' 
[debug] [XCUITest] Available devices: 43191654cb4d510f9f3e75a1577fef3bff459859 
[debug] [XCUITest] Creating iDevice object with udid 43191654cb4d510f9f3e75a1577fef3bff459859 
[XCUITest] Determining device to run tests on: udid: '43191654cb4d510f9f3e75a1577fef3bff459859', real device: true 
[BaseDriver] Using local app '/Users/rijom/Downloads/RSSFeedReader.ipa' 
[debug] [BaseDriver] Copying local zip to tmp dir 
[debug] [BaseDriver] Unzipping /var/folders/hh/qx4s0ttd3zg3fn0w7g10hgt00000gs/T/201711-76306-k3wipf.ft3wok1emi/appium-app.zip 
[debug] [BaseDriver] Testing zip archive: /var/folders/hh/qx4s0ttd3zg3fn0w7g10hgt00000gs/T/201711-76306-k3wipf.ft3wok1emi/appium-app.zip 
[BaseDriver] Unzipped local app to '/var/folders/hh/qx4s0ttd3zg3fn0w7g10hgt00000gs/T/201711-76306-k3wipf.ft3wok1emi/Payload/RSSFeedReader.app' 
[debug] [XCUITest] Checking whether app is actually present 
[debug] [ios-app-utils] Getting bundle ID from app 
[debug] [iOSLog] Attempting iOS device log capture via libimobiledevice idevicesyslog 
[debug] [iOSLog] Found idevicesyslog: '/usr/local/bin/idevicesyslog' 
[XCUITest] Setting up real device 
[debug] [XCUITest] Stdout from app isInstalled check: [....] Waiting for iOS device to be connected 
[....] Using iPod Touch 5G 'Ipod' (43191654cb4d510f9f3e75a1577fef3bff459859). 
true 

[debug] [XCUITest] App is installed. 
[debug] [XCUITest] Full reset not requested. No need to install. 
[XCUITest] Using default agent: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj 
[XCUITest] Using default bootstrap: /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent 
[XCUITest] Launching WebDriverAgent on the device 
[debug] [XCUITest] Carthage found: /usr/local/bin/carthage 
[debug] [XCUITest] Beginning test with command '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/bin/run-xcodebuild.sh --project /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent/WebDriverAgent.xcodeproj --scheme WebDriverAgentRunner --destination id=43191654cb4d510f9f3e75a1577fef3bff459859' in directory '/usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent' 
[XCUITest] Waiting for WebDriverAgent to start on device 
[debug] [XCUITest] Log file for xcodebuild test: /Users/rijom/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Logs/Test/B8534D7A-50CD-4B8A-8AD6-382B80BC7B84/Session-WebDriverAgentRunner-2017-02-01_154328-QrQMw9.log 
[debug] [WebDriverAgent] Device: Feb 1 15:43:53 Ipod XCTRunner[493] <Warning>: Running tests... 
[debug] [WebDriverAgent] Device: Feb 1 15:43:55 Ipod XCTRunner[493] <Warning>: Continuing to run tests in the background with task ID 1 
[debug] [WebDriverAgent] Device: Feb 1 15:43:56 Ipod XCTRunner[493] <Warning>: Built at Feb 1 2017 15:43:37 
[XCUITest] Detected that WebDriverAgent is running at url 'http://192.168.2.112:8100' 
[debug] [WebDriverAgent] Device: Feb 1 15:43:57 Ipod XCTRunner[493] <Warning>: ServerURLHere->http://192.168.2.112:8100<-ServerURLHere 
[XCUITest] WebDriverAgent started at url 'http://192.168.2.112:8100' 
[debug] [XCUITest] Starting iproxy to forward traffic from local port 8100 to device port 8100 over USB 
[debug] [WebDriverAgent] Device: Feb 1 15:43:57 Ipod XCTRunner[493] <Warning>: Listening on USB 
[debug] [WebDriverAgent] Device: Feb 1 15:43:57 Ipod SpringBoard[48] <Warning>: HW kbd: Failed to set (null) as keyboard focus 
[debug] [iProxy] bind(): Address already in use 
[debug] [iProxy] Error creating socket: Address already in use 
[XCUITest] Error: iproxy exited with code '208' 
    at SubProcess.<anonymous> (lib/webdriveragent.js:378:25) 
    at emitTwo (events.js:106:13) 
    at SubProcess.emit (events.js:191:7) 
    at ChildProcess.<anonymous> (lib/teen_process.js:191:14) 
    at emitTwo (events.js:106:13) 
    at ChildProcess.emit (events.js:191:7) 
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) 
Error: iproxy exited with code '208' 
    at SubProcess.<anonymous> (lib/webdriveragent.js:378:25) 
    at emitTwo (events.js:106:13) 
    at SubProcess.emit (events.js:191:7) 
    at ChildProcess.<anonymous> (lib/teen_process.js:191:14) 
    at emitTwo (events.js:106:13) 
    at ChildProcess.emit (events.js:191:7) 
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) 
[debug] [XCUITest] Running ios real device reset flow 
[debug] [XCUITest] Resetting simulator 
[debug] [iOSLog] Stopping iOS log capture 
[MJSONWP] Encountered internal error running command: Error: iproxy exited with code '208' 
    at SubProcess.<anonymous> (lib/webdriveragent.js:378:25) 
    at emitTwo (events.js:106:13) 
    at SubProcess.emit (events.js:191:7) 
    at ChildProcess.<anonymous> (lib/teen_process.js:191:14) 
    at emitTwo (events.js:106:13) 
    at ChildProcess.emit (events.js:191:7) 
    at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12) 
[HTTP] <-- POST /wd/hub/session 500 71554 ms - 166 
FAILED: Rijo 
org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: iproxy exited with code '208' (WARNING: The server did not provide any stacktrace information) 
Command duration or timeout: 71.82 seconds 
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46' 
System info: host: 'Suvarnaratnas-Mac-mini.local', ip: '192.168.3.135', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.11.5', java.version: '1.8.0_45' 
Driver info: io.appium.java_client.ios.IOSDriver 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) 
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) 
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) 
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422) 
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206) 
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158) 
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678) 
    at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:40) 
    at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1) 
    at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1) 
    at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:249) 
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:131) 
    at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:144) 
    at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobileDriver.java:36) 
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:114) 
    at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:132) 
    at io.appium.java_client.ios.IOSDriver.<init>(IOSDriver.java:77) 
    at com.sampleiOS.com.sampleiOS.AppTest.Rijo(AppTest.java:58) 
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) 
    at java.lang.reflect.Method.invoke(Method.java:497) 
    at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80) 
    at org.testng.internal.Invoker.invokeMethod(Invoker.java:714) 
    at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:901) 
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1231) 
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:127) 
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:111) 
    at org.testng.TestRunner.privateRun(TestRunner.java:767) 
    at org.testng.TestRunner.run(TestRunner.java:617) 
    at org.testng.SuiteRunner.runTest(SuiteRunner.java:334) 
    at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329) 
    at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291) 
    at org.testng.SuiteRunner.run(SuiteRunner.java:240) 
    at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) 
    at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) 
    at org.testng.TestNG.runSuitesSequentially(TestNG.java:1198) 
    at org.testng.TestNG.runSuitesLocally(TestNG.java:1123) 
    at org.testng.TestNG.run(TestNG.java:1031) 
    at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:132) 
    at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:236) 
    at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:81) 


=============================================== 
    Default test 
    Tests run: 1, Failures: 1, Skips: 0 
=============================================== 


=============================================== 
Default suite 
Total tests run: 1, Failures: 1, Skips: 0 
=============================================== 

[TestNG] Time taken by [email protected]: 85 ms 
[TestNG] Time taken by [email protected]: 89 ms 
[TestNG] Time taken by [email protected]: 14 ms 
[TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 4 ms 
[TestNG] Time taken by [email protected]: 12 ms 
[TestNG] Time taken by [email protected]: 44 ms 

我曾與我的應用程序團隊和證書也那麼它創建一個新的應用程序作爲webDriverAgent但不開放更新WebDriverAgentLib我的應用程序你能幫我打開應用程序嗎?

+0

https://github.com/appium/appium/issues/6996#issuecomment-278349789 –

回答

0

如果有流氓iproxy會話,你可以通過在命令行上執行

ps -ax|grep -i "iproxy"|grep -v grep|awk '{print "kill -9 " $1}'|sh 

殺死它。

+0

嗨茉莉花 我得到了上面的命令SH這樣的響應:線路1:殺:(440) - 操作不permitted.Tried與sudo也同樣的迴應 –