facebookarchive/WebDriverAgent

Can't connect via Wifi to iOS10.x devices in China

sencho opened this issue · 72 comments

iOS10.0.1 iPhone 6s Device is not work,Xcode Run test is OK,but when i visit the inspector through the url is not work.but in iOS 9.3.5 Device is OK.

2016-09-18 18:23:04.222588 XCTRunner[1568:332260] [Accessibility] ****************** Loading GAX Client Bundle **************** 2016-09-18 18:23:04.311613 XCTRunner[1568:332260] Running tests... 2016-09-18 18:23:05.215474 XCTRunner[1568:332260] Continuing to run tests in the background with task ID 1 Test Suite 'All tests' started at 2016-09-18 18:23:06.075 Test Suite 'WebDriverAgentRunner.xctest' started at 2016-09-18 18:23:06.076 Test Suite 'UITestingUITests' started at 2016-09-18 18:23:06.076 Test Case '-[UITestingUITests testRunner]' started. t = 0.00s Start Test at 2016-09-18 18:23:06.078 t = 0.00s Set Up 2016-09-18 18:23:06.082197 XCTRunner[1568:332291] [User Defaults] Failed to write value for key AutomationDisableFauxCollectionCells in CFPrefsPlistSource<0x1740e9b00> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null)): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access, switching to read-only 2016-09-18 18:23:06.085160 XCTRunner[1568:332260] Built at Sep 18 2016 18:22:55 2016-09-18 18:23:06.113981 XCTRunner[1568:332260] ServerURLHere->http://192.168.0.115:8100<-ServerURLHere 2016-09-18 18:23:06.114477 XCTRunner[1568:332260] Listening on USB

the same

Doy you have any error?
Are you sure device is reachable on your wifi?

sure!both at the same wifi

I just checked iOS 10.x device and it works fine. Make sure you don't have any networking issues. Your router might be blocking connections etc.

I make sure networking is fine, because it works fine at iOS 9.3.5 iPhone 6 Plus,so i was confused why my iPhone 6s 10.0.1 was not fine,

The Runner could be build into iPhone ,but could not inspect through the url

i try to telnet iPhone's IP with port 8100,is not fine.

I am not sure how I can help you here. Can you try different device on different network?

XCode Version 8.0 (8A218a)
iPhone6S 10.0.1
same issue

@sencho did you try maybe using usb proxy to talk to device?

@drptbl Wait, this issue is about WDA not working on devices. Your query shows that it is definitely working. You just hit unhandled endpoint.

Mark that "/" is not handled as expected. You should try e.g. "/inspector" instead.

@marekcirkos you're totally right. I'm sorry for bothering you.

same issue:
Xcode Version 8.0 (8A218a)
IPhone 5s(10.0.2(14A456))
wda can be started, but can not connect to "xxx:8100/inspector".

@BigWavelet make sure you are on the same Wi-Fi network and that network does not block your connections.

yes. i am sure they are on the same network. and i can ping the ip successfully

I am sorry, but I don't know how I can help you. I checked few times and devices work for us on iOS 10. Only thing I can come up with is your's network configuration may block certain ports or maybe device settings.

update my issue info, in my network, the pc ip is 192.168.241.195,my ios10 device ip is 172.18.156.69,but they are in the same network. I can ping the ip foreach.my ios9 device ip is 172.18.149.114,when my ios 9 device run wda, it work normal. 172.18.149.114:8100/inspector can be connect. but in ios10 device when I run wda,it can be run ,but 172.18.156.69:8100/inspector cant be connect....is there any different for wda run in different ip section in the same network to ios 10 device?

@marekcrkos I found a relationship with the iPhone model, the problem is licensed machine in China to support TD-LTE models, such as the A1700 6s,I have tried iPhone 6s/6s Plus/6 Plus all are iOS 10.0.x. please re-verify.

i have got this error....help me!

can i communicate with WD server use socket but http?now there is a bug in communicate between server with client.

I am also having an issue with an iPhone 6 running iOS 10.0.1. Appium establishes connection, WDA app is launched but then minimized and then it just sits waiting. I do not see any errors in the Appium output. Device is accessible at port 8100 and gives this response:

{
  "value" : "Unhandled endpoint: \/ -- http:\/\/192.168.105.114:8100\/ with parameters {\n    wildcards =     (\n        \"\"\n    );\n}",
  "sessionId" : "0E957EBF-EC9D-45C6-8623-866526F203ED",
  "status" : 1
}

The latest output from Appium is:

[Xcode] ▸ Signing /Users/nspassov/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app

[Xcode] MDMCreateDeltaDirectory:1920 calling MDMDirectoryDiff with:
state->old_bundle: /var/folders/qx/brrqhdh576sbppvht41kx56m0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/f153065cd5137f39055aa0a5cefe30ee/80ced61726a241abf3f2309137db58360b9f7329/WebDriverAgentRunner-Runner.app
state->new_bundle: /Users/nspassov/Library/Developer/Xcode/DerivedData/WebDriverAgent-brdadhpuduowllgivnnvuygpwhzy/Build/Products/Debug-iphoneos/WebDriverAgentRunner-Runner.app
state->dst_bundle: /var/folders/qx/brrqhdh576sbppvht41kx56m0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.UOJXeD/WebDriverAgentRunner-Runner.app_sparse.ipa/Payload//WebDriverAgentRunner-Runner.app, binaryDiff flag: FALSE
    dst_ipa: /var/folders/qx/brrqhdh576sbppvht41kx56m0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.UOJXeD/WebDriverAgentRunner-Runner.app_sparse.ipa

[Xcode] __MDMDirectoryDiff_block_invoke.37:1473 calling writeDictToFile with: /var/folders/qx/brrqhdh576sbppvht41kx56m0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.UOJXeD/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist

[Xcode] writeDictToFile:1278 ==== Successfully wrote Manifest cache to /var/folders/qx/brrqhdh576sbppvht41kx56m0000gp/C/com.apple.DeveloperTools/All/Xcode/EmbeddedAppDeltas/WebDriverAgentRunner-Runner.app.UOJXeD/WebDriverAgentRunner-Runner.app_sparse.ipa/ManifestCache.plist

Any ideas what might be going wrong?

there is a framework called GCDWebServer(https://github.com/swisspol/GCDWebServer), maybe can instead RoutingHTTPServer.with RoutingHTTPServer, i cannot access, but use GCDWebServer i can access.so i suggest using GCDWebServer instead of RoutingHTTPServer.

@nspassov This is unrelated issues, you definitely can reach device, but use bad endpoint. This is expected as we do not handle pain /. Try /inspector instead

@sixleaves You should give it a try, and let us know.

@marekcirkos Yes, initially Appium establishes connection, but then it just stops and my test does not run.

@nspassov You should talk to Appium

i found there is a same error in CocoaAsyncSocket framework.but i don't no how to modify.and the error only happend when u use the iphone that licensed machine in China to support TD-LTE models..... @marekcirkos

i have the same problem....

i test it at iOS9+iphone6、6plus,it can work。
but it don't work at iOS10+iphone7.

AliNL commented

Same issue on real machine iPhone 6 with IOS 10.0
But it works fine on simulator with the same configuration

Check if UI Automation is enabled on the device. Also check this thread: appium/appium#7010. Good luck!

any one cannot running on iOS10.0 in china real device, can see here WDUSBClient

@sixleaves have you ever solved this issue, please help

@BigWavelet Yes, i have solved this issue, u can go here WDUSBClient, git clone this project, u should read the wiki that WDUSBClient first before u use it. if have any question, give me a issue.

@sixleaves Can you make a pr to WDA?

@sixleaves I guess you use usb instead of WiFi? We do have client for that https://github.com/facebook/WebDriverAgent/wiki/USB-support

@marekcirkos what configuration should i make if i want to use usb instead of WiFi? thx

@marekcirkos yes, u are right. i have read through the code of WDA.is there have other framework but peertalk? i also want to develop a framework as same as peertalk.

@BigWavelet What do you mean by "What configuration"?
@sixleaves We use peertalk and it works for us well. Is it problematic for you?

AliNL commented

@marekcirkos We only know how to use wifi, but we can not find any document telling us how to setup USB support. Could you please share the steps? I think this is what BigWavelet means.

Hello everyone, I found Xcode8.1 and iOS 10.1 real device can work.
Y can try.

@zhaodazhou not work yet

@sencho Sorry, I was not specified enough. I found Xcode8.1 and iOS 10.1 iPhone 6 real device can work, but on the iOS 10.1 iPhone 7 have the same error.

Have anyone know the function _AXSAutomationSetFauxCollectionViewCellsEnabled(BOOL) work?

@zhaodazhou Why you ask it is unrelated to device issue

@marekcirkos On iPhone 7 iOS 10.1, when call function _AXSAutomationSetFauxCollectionViewCellsEnabled(YES), report info like "Failed to write value for key AutomationDisableFauxCollectionCells in CFPrefsPlistSource<0x1740e9b00> (Domain: com.apple.Accessibility, User: kCFPreferencesCurrentUser, ByHost: No, Container: (null)): setting preferences outside an application's container requires user-preference-write or file-write-data sandbox access, switching to read-only". If not call, no that info.

@zhaodazhou I do not think it is related. (#354)

Any updates about this issue?

I tested 4 real devices.
Two 9.3.4 devices work fine.
10.1 devices still don't work. I use xcode to run the test and no error in the logs. But I can't connect the http://ip:8100/status

use iproxy is ok with iOS 10

Is this all China iPhones? It is a bit interesting.

AliNL commented

Yes, only China iPhones have this problem. I tried iPhones from other countries, they work fine.

@codeskyblue can u give me more details about using iproxy or a web link?
thanks.

@codeskyblue Thanks for your information.

Closing in favour of Wiki - Known issue

@marekcirkos In China iOS 10.x, apple has a new feature, "Apps Using WLAN & Cellular". If app not in this list, it cannot use WLAN. But webdriveragent is XCUITest, not an app. So WDA would not be allowed to use WLAN.

@noshuai Actually all XCUITests are wrapped in separate applications, so you should be able to add it to the list.

@sencho Is solved? I have a same problem, and I don't know how to do?Can u help me ?

@lijiarui12 ,not yet,we through USB.

@sencho ,Thanks for your help, but I have another question.
In my Xcode project about WebDriverAgent, there is no KissXML.framework and Peertalk.framework. I don't know why, how can I get the two framworks? If I no them, I will have the error as following:

2017-05-28 18:12:32.117 XCTRunner[5797:979556] Running tests... 2017-05-28 18:12:32.248 XCTRunner[5797:979556] The bundle “WebDriverAgentRunner” couldn’t be loaded because it is damaged or missing necessary resources. Try reinstalling the bundle. 2017-05-28 18:12:32.248 XCTRunner[5797:979556] (dlopen_preflight(/var/containers/Bundle/Application/44174EEE-318B-4E82-8782-597C2CC4330D/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/WebDriverAgentRunner): Library not loaded: @rpath/KissXML.framework/KissXML Referenced from: /private/var/containers/Bundle/Application/44174EEE-318B-4E82-8782-597C2CC4330D/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/WebDriverAgentLib Reason: no suitable image found. Did find: /private/var/containers/Bundle/Application/44174EEE-318B-4E82-8782-597C2CC4330D/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/KissXML.framework/KissXML: mmap() errno=1 validating first page of '/private/var/containers/Bundle/Application/44174EEE-318B-4E82-8782-597C2CC4330D/WebDriverAgentRunner-Runner.app/PlugIns/WebDriverAgentRunner.xctest/Frameworks/WebDriverAgentLib.framework/Frameworks/KissXML.framework/KissXML'
Can you help me?

You need to update WDA. master version does not use them anymore

@marekcirkos yeah,u'r right.Thank u.

@marekcirkos Sorry my English is bad.I use usb proxy to talk to device,The url which talk to device is "localhost:8100",not "DeviceIP:8100".Maybe you can descript it in the page https://github.com/facebook/WebDriverAgent/wiki/USB-support

@milkcandylmt You need set "capabilities.setCapability("usePrebuiltWDA", true);"in your Java Project. Then use usb proxy to talk to device.

@lijiarui12 OK,I'll try it.Thank u.

Its not relevant to add my question. I think you guys can help me out.
I need to automate ios over wi-fi. Please help me out

if i connect lightning connector which has 2's lightening port.
one i can use for my device and one i can connect to sync with MAC. Will this work??????

That connector has the below specification.

I don't know. Maybe try?

@marekcirkos @noshuai Is there any way to solve it? Our team have to automate over wifi.