Using selenium-grid and 2 iPhones connected via USB to a macmini.
Trying to run tests on both of them at the same time(parallel tests) results in hang.
1) Start 2 appium processes on the command line waiting on different ports.
2) Start 2 python/ruby/node/whatever prompt and obtain a valid driver object for one of the phones.
3) At the same time as doing driver.page_source or driver.find_element, attempt getting another driver object in the other language-prompt
Observe that it will hang in the attempt. Not sure what's conflicting. o_O
Was hoping to connect as many iOS devices as the macmini has ports to do parallel-testing.
I see the highly suspect code now...
Line38 of instruments.js.... sock = '/tmp/instruments_sock';
What I'm going to try is append YYYYMMDDHHMMSS or some kinda unique hash.
Stay tuned....
EDIT: ...well that didn't work...must be something else
i believe it's an os-level limitation. apple only allows one instance of instruments to be running at a time, and each version can only talk to one device at a time. you'll need to parallelize across machines unfortunately.
Apple!!!!!! (╯°□°)╯︵ ┻━┻
EDIT: hmm, I can launch multiple instances of instruments on my machine in that it won't be prevented from doing it like how iOS Simulator really doesn't want to run more than once. What I'm suspecting right now is in the instruments dir there are a few hardcoded strings to "/tmp/instruments_sock".
I will try having 2 copies of the appium git repo, but one of them change any instance of /tmp/instruments_sock to /tmp/instruments_sock2 in any of the js code.
EDIT: I think you're right ;-)
Connection peer refused channel request for 'com.apple.instruments.UIAutomation'
Still thinking about what is error means and how/if there's a way around it.
If you can figure a way around this you will be our hero. So by all means pour all your energies into it! In my understanding it's just a hard limitation on Instruments, so I'll go ahead and close this but I welcome magical pull requests in the future!
A little bird told me this was possible. No clue how.
Maybe someone at @facebook knows?
Yeah, that same little birdie also told me that someone at a particularly large social website might know....
(well, not exactly the same)
interdasting...
Guys - Any solve for this yet??
I have been trying for two days but not able to run multiple instruments on one machine- did any one gave this a try??
@gauravrocks
Nope. This is still something that doesn't have a solution afaik. I'm hoping projects like libimobiledevice.org or http://darling.dolezel.info/en/Darling will "emulate" XCode & Instruments on linux good enough to bypass the limitation or at least make the whole infrastructure more cost-effective by not legally being required to be on OSX hardware for OSX-virtualization. Or some knight in shining armor(facebook employee) comes out of nowhere with the answer.
I've been trying all kinds of stuff, causing instruments to behave in different ways. None of which have allowed multiple instances. =/ Research has lead me to believe that instruments calls into an XPC Service that is registered by XCode.
Example: With XCode and Instruements not running I do this:
rm -rf ~/Library/Developer/Xcode/iOS\ DeviceSupport/
rm -rf /private/var/folders/2z/jm8fgtjj7z95vycv5p419txr0000gn/C/com.apple.DeveloperTools/
rm ~/Library/Prefrences/com.apple.dt.InstrumentsCLI.plist
Then edit the following file in random ways: /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/Plugins/AutomationInstrument.bundle/Contents/Resource/PlugIn.xml
Or even duplicate the "AutomationInstrument.bundle" folder but changing the "A" in AutomationInstrument to a "B" everywhere I can find it, even in binaries with hex-editor. Then make a copy of the instruments binary and edit any "Automation" to be "Butomation"..... none of this worked... but I haven't given up completely. Every once in awhile I try random nonsense like the above to make instruments behave erratically.
Apple hasn't announced a fix.
any updates here?
@aluedeke
Not that I know of. I've attacked this issue in every way imaginable short of becoming an Apple employee and getting them to fix it. I've even told everyone I know with connections inside Apple to please have this fixed.
Any new updates yet since we are in 2015 now?
@luonglne
Not that I know of, unfortunately. I wish Apple would fix it, or open source it or something. All I know is on this site: http://www.libimobiledevice.org/ , and do a search for the word "instruments". You'll see it mentions that people over at http://mirell.com/ are working on it. I might try sending an email to one of the addresses on the site.
EDIT: @luonglne I just sent an email to their tech-support asking about it.
@luonglne @bootstraponline @jlipps
I got an email reply from the CEO. A very, very, good email reply. They actually did it. They reimplemented UIAutomation for Windows, OSX, Linux from iOS4 to present. Multiple devices controlled from a single host. Currently in private-beta, they plan to announce it later on this year.
cc @Jonahss
Is there any way for one of the appium devs to join the private beta? It'd be awesome if appium could support this in time for the launch announcement.
Is libimobiledevice open source? If it's free, do we know it will remain free?
It's open source. If their Instruments support is in "private beta" it probably won't be free?
Somewhere along the way I got the impression that only parts of the project are open source. That could be totally wrong tho.
Yeah, I think it was a confabulation.
@Jonahss Correct, I was told there will be licensing fees.
@bootstraponline I asked to be notified of any updates. I suppose Saucelabs could formally introduce themselves to the company and request some kind of partnership and/or private-beta admission.
Won't do Appium much good, though, except for using the open source bits.
@0x1mason I think it's worth Sauce talking with them to find out the details. Maybe they'd be willing to work something out.
@0x1mason I dunno, assuming the fee isn't astronomical I would think buying a couple of license for say 25 linux boxes with 4 devices each might not be too bad? Do a little beta with customers, experiment with pricing. If their linux-instrument-client works well I feel like the profits would be higher than the license costs. Everyone wants to test on mobile, nobody wants to deal with setting up the infrastructure. Take it from me, I spent nearly 2 years trying to get that stuff to work in my office. Eventually it did work, but my time would have been better spent just writing tests and sending selenium commands to Saucelabs.
@tokunbo It certainly sounds like it could help Sauce, just don't see how a licensed product could be worked into Appium. @bootstraponline Agree that we should definitely find out more.
@0x1mason Oh, true. The appium of this github repo won't have linuxtruments(yup, that's what I'm saying now). The users of this repo would have to stick to single devices on a macosx hardware, maybe instructions on how to add the licensed linuxtruments after git cloning would be included.
@tokunbo from where I can download or buy the beta version.Do you have the link?
+1
@tokunbo we would like to talk to the libimobiledevice developers but have never been able to contact them. Could you try connecting us?
@ankit4aug @saikrishna321
I sent an email to the company. http://mirell.com/ , specifically the tech-support email listed there. I asked if I could get the software. They replied they have it in private beta; which I took for _"We're not going to give it you just yet."_ I did tell them to let me know if there's ever a chance for me to try out the software.
@Jonahss
I was never able to contact libimobiledevice people either. I only tried the URL that was listed for "instruments", which sent me to mirell.com, which got me that email reply that the software exists and is in use by some limited people somewhere.
I don't want to be too troublesome for them. I assume if they were going to give me the software they would have the first time I asked for it. I do plan on asking again after some respectful time has passed. Maybe 3 weeks to a month. Looking at my original github comment talking about the reply it looks like 12 days have passed since then.... so probably this friday March 6th, or Friday march 13th I'll send another email.
@Jonahss Ah, the libimobiledevice folks are different from the instruments company. I could actually try them now....
@Jonahss I tried pinging them on their IRC channel... silence. However, looks like the project is still alive & well. https://github.com/libimobiledevice/libimobiledevice ,has a commit from Jan 29, 2015 and the end of their README they list their IRC & twitter which appear to still be going too.
@Jonahss
Just fyi, I pinged them again in attempts to get more info and asked specifically for the linux version. I also mentioned that the folks behind appium would love to try it out too.
Subscribing to this issue for further details
This guide doesn't address the multiple iPhones testing issue at all, sorry
Any updates on this issue or any workaround where in we can achieve running parallel tests on ios using Appium.
Also If anyone can explain how saucelabs or other commercial tools achieve this if it is an os level restriction?
Sauce Labs achieves this by running each iOS test on a dedicated VM (that's used only for that test, then destroyed)
@jlipps not being able to run appium tests on different ios devices in parallel is quite annoying and inefficient. we are trying to contact the guys from mirell since several weeks and didn't get a satisfying answer. did you ever thought about moving away from ui automation and using another approach (like compiling a test driver lib into an ipa at compile time or enhancing an already compiled ipa with an test driver lib). As far as i can say this is the way how commercial testing tools are doing there test for ios. this would also have some additional benefits like being able to run tests from windows machines.
@aluedeke
I don't want to compile stuff into the app under test. Depending on your situation it might even be near impossible to get the devs to compile appium into their app for you. I think appium is the best approach by far; the only hurdle is this parallel thing and mirell claims to have a solution. If we could just get our hands on it, this whole discussion would be totally different.
@tokunbo it is actually possible to enhance a already compiled ipa file with a test driver lib. it wouldn't be necessary that dev's add the testing lib while building the ipa. fortunately there is currently no open source solution i am aware of which is capable of doing that.
@aluedeke A google search brings me to this: http://stackoverflow.com/questions/25719216/inserting-or-adding-new-library-load-command-in-ios-binary-file-ipa
That looks like some serious sorcery to me; not sure I'd be comfortable testing an app that has had this kind of tampering to it. I do admit though, if people got that working... it's a cool hack.
@tokunbo fully agree that this feels like rocket science. But using an reverse engineered version of the ios instruments protocol has actually the same complexity.
Probably @FunkyM can provide an update about his plans/status with his instruments implementation.
If you use Appium with iOS simulators, your app is already undergoing
swizzling with instruments-without-delay. Library injection, function
redirection, etc isn't uncommon and is a common tool used in
virtualization. Eg, you hook an OS's IO API so that file writes go
somewhere other than where they're supposed to go.
We're going to experiment with some of the library injection techniques in
the coming months. That won't solve the multiple device problem tho. When
we have time we might also look into what we can do with libimobiledevice.
On Apr 9, 2015 3:38 PM, "Tokunbo George" [email protected] wrote:
@aluedeke https://github.com/aluedeke A google search brings me to
this:
http://stackoverflow.com/questions/25719216/inserting-or-adding-new-library-load-command-in-ios-binary-file-ipaThat looks like some serious sorcery to me; not sure I'd be comfortable
testing an app that has had this kind of tampering to it.—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-91337245.
@0x1mason True if you're using the simulators. I actually disable the instruments-without-delay as the last time I tried that(over a year ago) I started suspecting it was causing app crashes and my tests were scheduled to run overnight; didn't care how long the test took to run. I still hope for the day of multiple physical devices with pristine apps installed. At most, perhaps rooted/jailbreaked devices to allow some permissions for some sorcery custom UIAutomation-receiver in the physical device but still leaving the actual .ipa alone.
I guess I'd feel better if I could see the source-code of merill's linux implementation, at least that way everyone knows what exactly was tampered with and my suspicions don't run wild with every odd behavior I see. I should just look into USBport sniffing on macosx and see if I can write a C program on linux to do even just one super-simple UIAutomation-related command.
Any updates multiple IOS devices testing,
I can see this post started since 2013, is this issue still not fixed by apple or anyone, Can anyone help I am facing this issue, not able to proceed.
I am able to connect two devices using
ios_webkit_debug_proxy -c e9d021d7ee90f440ed3e415719e8c2c4202ad7cb:27753
ios_webkit_debug_proxy -c 56ac8a0ec68bee56622bf787713578fdbd69a2da:27754
and two appium nodes
Node 1:
node main.js --safari -a 192.168.57.137 -p 27754 --bootstrap-port 27754 --nodeconfig /Users/nesag/desktop/hub/IOS.json -U 8c208456f82efa57550d1858a709558f0cd0d2d6 --show-ios-log
Node 2:
node main.js --safari -a 192.168.57.137 -p 27753 --bootstrap-port 27753 --nodeconfig /Users/nesag/desktop/hub/IOS6.json -U e9d021d7ee90f440ed3e415719e8c2c4202ad7cb --show-ios-log
When I trigger 2 tests simultaneously from Visual Studio, only one test is running in single device and other appium node is throwing the below error, can anyone please suggest
Error Log:
info: [debug] Cleaning up appium session
error: Failed to start an Appium session, err was: Error: Command failed: /bin/sh -c ideviceinstaller -u 8c208456f82efa57550d1858a709558f0cd0d2d6:27753 -i /var/folders/mh/0qzhsjy9449ccxw8xl75vzshk02zy3/T/11554-3896-fozdfc/node_modules/safari-launcher/build/Release-iphoneos/SafariLauncher.app
info: [debug] Error: Command failed: /bin/sh -c ideviceinstaller -u 8c208456f82efa57550d1858a709558f0cd0d2d6:27753 -i /var/folders/mh/0qzhsjy9449ccxw8xl75vzshk02zy3/T/11554-3896-fozdfc/node_modules/safari-launcher/build/Release-iphoneos/SafariLauncher.app
at ChildProcess.exithandler (child_process.js:751:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1015:16)
at Socket.<anonymous> (child_process.js:1183:11)
at Socket.emit (events.js:107:17)
at Pipe.close (net.js:485:12)
info: [debug] Responding to client with error: {"status":33,"value":{"message":"A new session could not be created. (Original error: Command failed: /bin/sh -c ideviceinstaller -u 8c208456f82efa57550d1858a709558f0cd0d2d6:27753 -i /var/folders/mh/0qzhsjy9449ccxw8xl75vzshk02zy3/T/11554-3896-fozdfc/node_modules/safari-launcher/build/Release-iphoneos/SafariLauncher.app\n)","killed":false,"code":2,"signal":null,"cmd":"/bin/sh -c ideviceinstaller -u 8c208456f82efa57550d1858a709558f0cd0d2d6:27753 -i /var/folders/mh/0qzhsjy9449ccxw8xl75vzshk02zy3/T/11554-3896-fozdfc/node_modules/safari-launcher/build/Release-iphoneos/SafariLauncher.app","origValue":"Command failed: /bin/sh -c ideviceinstaller -u 8c208456f82efa57550d1858a709558f0cd0d2d6:27753 -i /var/folders/mh/0qzhsjy9449ccxw8xl75vzshk02zy3/T/11554-3896-fozdfc/node_modules/safari-launcher/build/Release-iphoneos/SafariLauncher.app\n"},"sessionId":null}
actually yes i did a test and its working out (tested it with 2 real devices on the same host) with latest xcode version. to make appium work configure also different tmp directories (--tmp) for appium.
Thanks for the reply @aluedeke
But still I am not able to make it work, with the below appium nodes, I am now able to get the Safari Launcher injected into the devices when I trigger the tests at the same time(Prallel test).
But one of the device is not launching the safari and test failed because of the time out, other device test is just passed.
node main.js --safari -a 192.168.57.137 -p 27754 --bootstrap-port 27754 --nodeconfig /Users/nesag/desktop/hub/IOS.json -U 8c208456f82efa57550d1858a709558f0cd0d2d6 --show-ios-log --tmp /tmp
node main.js --safari -a 192.168.57.137 -p 27753 --bootstrap-port 27753 --nodeconfig /Users/nesag/desktop/hub/IOS6.json -U e9d021d7ee90f440ed3e415719e8c2c4202ad7cb --show-ios-log --tmp /tmp
Thanks @aluedeke
I have just tried and succesfully run multiple real devices from a MAC. I used to start a virtual node for a real device.
I think this was an Apple restriction on instruments but now we are free.
No more virtual nodes, parallels, virtualbox.
If you come to Turkey i will buy a coffee for you :)
@Nesaganesh change tmp folder path for every appium.
@suayipozmen I have tried changing the tmp folder path, still not working.
I don't know how yours is working with multiple devices prallely
See Running on OS X: iOS for iOS requirements and setup instructions.
Versions: 6.0, 6.1, 7.0, 7.1, 8.0, and 8.1
Devices: iPhone Simulator, iPad Simulator, and real iPhones and iPads
Support for automating multiple apps in one session: No
Support for automating multiple devices simultaneously: No
https://github.com/appium/appium/blob/master/docs/en/appium-setup/platform-support.md#ios-support
Please let me know is this is fixed by apple, or is there any way we can overcome this problem
@Nesaganesh i have changed temp folder paths for you.
node main.js --safari -a 192.168.57.137 -p 27754 --bootstrap-port 27754 --nodeconfig /Users/nesag/desktop/hub/IOS.json -U 8c208456f82efa57550d1858a709558f0cd0d2d6 --show-ios-log --tmp /tmp/ios/
node main.js --safari -a 192.168.57.137 -p 27753 --bootstrap-port 27753 --nodeconfig /Users/nesag/desktop/hub/IOS6.json -U e9d021d7ee90f440ed3e415719e8c2c4202ad7cb --show-ios-log --tmp /tmp/ios6/
@suayipozmen Thanks for the reply.
I have changed in the same way, but this is not the problem I believe.
Test triggers only for the port number 27753, Its not working for 27754 or any
I used 27753 for first device and 27754 for second device
ios_webkit_debug_proxy -c e9d021d7ee90f440ed3e415719e8c2c4202ad7cb:27753
ios_webkit_debug_proxy -c 56ac8a0ec68bee56622bf787713578fdbd69a2da:27754
Please help :-(
Are you using master?
Have you run reset.sh --real-safari?
@raldred Thanks for the reply, I have tried but no luck.
I don't think the problem is with appium side, I believe its in ios_webkit_debug_proxy, can we have different port numbers like '27753' , '27754' mentioned below
ios_webkit_debug_proxy -c e9d021d7ee90f440ed3e415719e8c2c4202ad7cb:27753
ios_webkit_debug_proxy -c 56ac8a0ec68bee56622bf787713578fdbd69a2da:27754
I am using
hub>java -jar selenium-server-standalone-2.45.0.jar -role hub maxSession=5 -newSessionWaitTimeout 25000 -port 4444
Node1:
node main.js --safari -a 192.168.57.137 -p 27754 --bootstrap-port 27754 --nodeconfig /Users/nesag/desktop/hub/IOS.json -U 8c208456f82efa57550d1858a709558f0cd0d2d6 --show-ios-log --tmp /tmp/ios/
Node2:
node main.js --safari -a 192.168.57.137 -p 27753 --bootstrap-port 27753 --nodeconfig /Users/nesag/desktop/hub/IOS6.json -U e9d021d7ee90f440ed3e415719e8c2c4202ad7cb --show-ios-log --tmp /tmp/ios6/
My Json file:
{
"capabilities":
[
{
"platformName":"ios",
"browserName":"Safari",
"DeviceName":"Matthew's iPhone",
"maxInstances": 1
}
],
"configuration":
{
"cleanUpCycle": 2000,
"timeout": 300000,
"browserTimeout": 60000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"hub":"http://192.168.57.137:4444/grid/register",
"host": "192.168.57.137",
"maxSession": 5,
"port": 4445,
"hubPort": 4444,
"hubHost": "192.168.57.137",
"url": "http://192.168.57.137:4445/wd/hub",
"register": true,
"registerCycle": 5000,
"role": "node"
}
}
@aluedeke Hey there, would you mind trying to see if you can control 2 native-apps at the same time on 2 different devices? If that works could you share the exact version & build of your XCode as well as the version of OSX you're running? If not, I'd be interested in the error message you receive.
Thanks,
You're right. as of Xcode 6.3.2, multiple instruments sessions can be started from a single host. About time.
The Appium 1.5 milestone will make it super easy to support multiple sessions without having to set a bunch of environment variables or handle multiple ports manually.
@Jonahss @jlipps @bootstraponline
This marks a victory after a very long battle....

That's really great news. Thanks for the update :-)
Xcode 7 also has a bunch of good news related to testing. Open source swift is cool as well.
https://developer.apple.com/xcode/
I'm in shock apple actually improved instruments. It's about time.
@bootstraponline I'm taking credit for that because a few weeks ago an Apple recruiter contacted me on LinkedIn and I gave him a link to this github issue. :-P

(....but that probably had nothing to do with it)
amazing!!!
@aluedeke Can you please tell me how to run tests with two simulators in parallel ? i'm triggering in parallel using Parallel GNU and the i start the appium server as below
appium --session-override -p 62488 -bp 56556 --tmp /tmp/ios6s/
appium --session-override -p 62775 -bp 55942 --tmp /tmp/ios5s/
@suayipozmen how did u get to run the tests in parallel for ios...
As commented above i use the Parallel GNU to start the tests in multiple thread .I see the tests running in sequence not in parallel though .. can u pls help me on this
@saikrishna321 As discussed in the thread, this is not a problem in appium.
It is an OS-level limitation that wont allow you to run more than one instance of instruments for a given user. Note that you can still run another instance using different user. So a simple solution would be to create the appium node using different user.
user1: appium node 1
user2: appium node 2
and the tmp dirs needs to be different for each node
finally, create the driver instance as you normally do (either by individual nodes or grid)
what do you think of this workaround @jlipps ?
@marloncruz no there is no limitation on OSX. you can start many instruments instances at same time without any trouble. Every appium instance starts an instruments by using a different tmp folder and a unique port.
You should assign one mobile device or simulator to one appium.
We can use 6 iphone devices on the same mac by using usb hub an 6 appium instances are running and registered to our hub. They can run parallel tests.
@saikrishna321 i think you can not start tests in parallel because appium can do it if you configure them correctly. see above comments.
@suayipozmen Thanks a lot for your reply.
I have configured them correctly. every appium session runs on a different port as
appium --session-override -p 62488 -bp 56556 --tmp /tmp/ios6s/
appium --session-override -p 62775 -bp 55942 --tmp /tmp/ios5s/
and my tests are picking up the correct appium ports into the http://127.0.0.1:port/wd/hub
Can you please tell how u start the tmp folder with unique port ?
(Every appium instance starts an instruments by using a different tmp folder and a unique port. )
@saikrishna321 your appium configuration seems true. i think you can not send tests to appiums parallel.
You should use selenium grid to handle multiple nodes.
@suayipozmen how is selenium grid gonna act different from appium parallel?
i dont use appium parallel but i have solved this issue by registering
appium servers to a selenium grid.
On Wed, Oct 28, 2015 at 2:32 PM, Sai Krishna [email protected]
wrote:
@suayipozmen https://github.com/suayipozmen how is selenium grid gonna
act different from appium parallel?—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-151829205.
@suayipozmen thanks a lot .. would b great if u can put some steps on how to get this done ?
U have all the node registered in the same mac OSx system ? Does it launch multiple sims as well ?
Hope i'm not asking for more :smile:
we use only real devices not simulators. All iphone devices are connected
to the same mac mini over usb ports.
Start one appium node per device and all appium nodes are registered to the
remote selenium grid server.
All test cases use remote driver and send tests to selenium grid. Selenium
grid decides which test will run on a device by using desired capabilities
that given in appium starting json. Selenium driver does its job.
On Wed, Oct 28, 2015 at 2:46 PM, Sai Krishna [email protected]
wrote:
@suayipozmen https://github.com/suayipozmen thanks a lot .. would b
great if u can put some steps on how to get this done ?U have all the node registered in the same mac OSx system ? Does it launch
multiple sims as well ?Hope i'm not asking for more [image: :smile:]
—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-151832831.
@suayipozmen :+1: Awesome thanks .. can u post your config.json as well .. pls
{
"capabilities": [
{
"browserName": "HTC_ONE",
"version": "4.4.3",
"maxInstances": 1,
"takesScreenshot": true,
"isMobile": true,
"udid": "FA3A2W912766",
"platform": "ANDROID"
}
],
"configuration": {
"maxSession": 1,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"hubHost": "seleniumgrid.ipaddress",
"hubPort": 4444,
"url": "http://5.27.79.208:8989/wd/hub",
"host": "5.27.79.208",
"port": 8989,
"register": true,
"registerCycle": 5000,
"testPlatform": "local-appium",
"videoRecorderType": "ADB"
}
}
On Wed, Oct 28, 2015 at 3:03 PM, Sai Krishna [email protected]
wrote:
@suayipozmen https://github.com/suayipozmen [image: :+1:] Awesome
thanks .. can u post your config.json as well .. pls—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-151837471.
@suayipozmen how about your ios capabilities over json look ?
Sorry i have sent android one. ios configurations is same but only platform
is MAC.
On Wed, Oct 28, 2015 at 6:36 PM, Sai Krishna [email protected]
wrote:
@suayipozmen https://github.com/suayipozmen how about your ios
capabilities over json look ?—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-151902866.
@suayipozmen thanks for clarifying. i confirmed parallel test works on multiple ios devices using different temp folder. however i notice that the execution feels like running in series (but maybe that depends on the host machine) - and running on different user eliminates this problem for me.
@saikrishna321 here is my json
{
"configuration": {
"registerCycle": 5000,
"hubHost": "gridserver.local",
"url": "http://testmac.local:45501/wd/hub",
"register": true,
"host": "testmac.local",
"role": "node",
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"timeout": 90000,
"maxSession": 5,
"port": "45501",
"hubPort": 4445
},
"capabilities": [
{
"platform": "MAC",
"browserName": "iPad",
"version": "9.0.1",
"maxInstances": 1,
"deviceName": "iPad"
}
]
}
I tried by placing two temp directories one for device and another for emulator appium server instances. That configuration worked for me..
For emulator:
"$appium_server -p 6001 -bp 4001 --full-reset --native-instruments-lib --tmp ~/tmp1
For device:
"$appium_server -p 6002 -bp 4002 -U $ios_udid --native-instruments-lib --full-reset --tmp ~/tmp2
@priyankshah217 can you try launching two sims ?
@suayipozmen Can you clarify the steps you are taking to test on multiple iOS devices from a single Mac? Specifically about running ios-webkit-debug-proxy's on two ports.
I'm able to get two iOS devices to open safariLauncher in parallel, but due to what I assume is a ios-webkit-debug-proxy issue only one of the devices can execute the test.
Thanks for your time, any help is appreciated.
Liam
I deployed and launched app on two devices connected to a single mac
machine, but when i try to perform an action on one of the devices i get
below error,
warn: [DEPRECATED] The name locator strategy has been deprecated and will
be removed. Please use the accessibility id locator strategy instead.
info: [debug] Waiting up to 0ms for condition
info: [debug] Pushing command to appium work queue:
"au.getElementByName('Shared Device')"
info: [debug] Sending command to instruments: au.getElementByName('Shared
Device')
info: [debug] [INST] 2015-11-17 06:48:18 +0000 Debug: Got new command 3
from instruments: au.getElementByName('Shared Device')
info: [debug] [INST] 2015-11-17 06:48:18 +0000 Debug: evaluating
au.getElementByName('Shared Device')
info: [debug] [INST] 2015-11-17 06:48:18 +0000 Debug: evaluation finished
info: [debug] [INST] 2015-11-17 06:48:18 +0000 Debug: Lookup returned
[object UIAButton] with the name "Shared Device" (id: 0).
info: [debug] [INST] 2015-11-17 06:48:18 +0000 Debug: responding with:
info: [debug] [INST] 2015-11-17 06:48:18 +0000 Debug: Running system
command #4: /Applications/Appium.app/Contents/Resources/node/bin/node
/Applications/Appium.app/Contents/Resources/node_modules/appium/submodules/appium-uiauto/bin/command-proxy-client.js
/tmp/instruments_sock 2,{"status":0,"value":{"ELEMENT":"0"}}...
info: [debug] [INST] 2015-11-17 06:48:51 +0000 Error: Script threw an
uncaught JavaScript error: JSON Parse error: Unexpected EOF on line 2614 of
bootstrap-3951b122240c0ac8.js
info: [debug] [INST] 2015-11-17 06:48:52 +0000 Stopped: Script was stopped
by the user
info: [debug] [INST STDERR] 2015-11-17 12:18:52.108 instruments[1017:74594]
Attempting to change event horizon while disengage
info: [debug] [INST] Instruments Trace Complete (Duration : 80.555046s;
Output : /tmp/appium-instruments/instrumentscli0.trace)
info: [debug] [INSTSERVER] Instruments exited with code 0
a
On 12 November 2015 at 14:14, liamFerris [email protected] wrote:
@suayipozmen https://github.com/suayipozmen Can you clarify the steps
you are taking to test on multiple iOS devices from a single Mac?
Specifically about running ios-webkit-debug-proxy's on two ports.I'm able to get two iOS devices to open safariLauncher in parallel, but
due to what I assume is a ios-webkit-debug-proxy issue only one of the
devices can execute the test.Thanks for you time, any help is appreciated.
Liam
—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-156034953.
Venkatesh Prasad Singh
@liamFerris you can start two ios-webkit-debug-proxy's on two ports. But it is not stable i see.
After a while it is died so we start a watchdog and when it dies starts a new one.
@VenkateshPS your problem is expected because you are using appium.app and i see you have not set an external tmp folder. I only use appium as a node.js module.
@suayipozmen
I created external tmp folder. Please explain what is difference in using
appium.app and using it as node.js module.
On 17 November 2015 at 13:16, suayipozmen [email protected] wrote:
@liamFerris https://github.com/liamFerris you can start two
ios-webkit-debug-proxy's on two ports. But it is not stable i see.
After a while it is died so we start a watchdog and when it dies starts a
new one.@VenkateshPS https://github.com/VenkateshPS your problem is expected
because you are using appium.app and i see you have not set an external tmp
folder. I only use appium as a node.js module.—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-157301256.
Venkatesh Prasad Singh
i dont know the difference. can you try same scenario with node.js version.
On Tue, Nov 17, 2015 at 11:23 AM, VenkateshPS [email protected]
wrote:
@suayipozmen
I created external tmp folder. Please explain what is difference in using
appium.app and using it as node.js module.On 17 November 2015 at 13:16, suayipozmen [email protected]
wrote:@liamFerris https://github.com/liamFerris you can start two
ios-webkit-debug-proxy's on two ports. But it is not stable i see.
After a while it is died so we start a watchdog and when it dies starts a
new one.@VenkateshPS https://github.com/VenkateshPS your problem is expected
because you are using appium.app and i see you have not set an external
tmp
folder. I only use appium as a node.js module.—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-157301256.
Venkatesh Prasad Singh
—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-157317081.
I was able to launch the apps on both my devices after i created external
tmp folder.
but now i get _Didn't get a new command in 60 secs, shutting down..._
Is there a way i can increase the time out for the server.
On 17 November 2015 at 15:04, suayipozmen [email protected] wrote:
i dont know the difference. can you try same scenario with node.js version.
On Tue, Nov 17, 2015 at 11:23 AM, VenkateshPS [email protected]
wrote:@suayipozmen
I created external tmp folder. Please explain what is difference in using
appium.app and using it as node.js module.On 17 November 2015 at 13:16, suayipozmen [email protected]
wrote:@liamFerris https://github.com/liamFerris you can start two
ios-webkit-debug-proxy's on two ports. But it is not stable i see.
After a while it is died so we start a watchdog and when it dies
starts a
new one.@VenkateshPS https://github.com/VenkateshPS your problem is expected
because you are using appium.app and i see you have not set an external
tmp
folder. I only use appium as a node.js module.—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-157301256.
Venkatesh Prasad Singh
—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-157317081.—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-157319349.
Venkatesh Prasad Singh
Good news. I am happy to hear someone can launch 2 devices at same time.
I was in doubt about my grid configuration :)
Did you send any command to devices? Why it is waiting a new command that long.
thanks got it --command-timeout
On 17 November 2015 at 15:28, Venkatesh PS [email protected] wrote:
I was able to launch the apps on both my devices after i created external
tmp folder.but now i get _Didn't get a new command in 60 secs, shutting down..._
Is there a way i can increase the time out for the server.
On 17 November 2015 at 15:04, suayipozmen [email protected]
wrote:i dont know the difference. can you try same scenario with node.js
version.On Tue, Nov 17, 2015 at 11:23 AM, VenkateshPS [email protected]
wrote:@suayipozmen
I created external tmp folder. Please explain what is difference in
using
appium.app and using it as node.js module.On 17 November 2015 at 13:16, suayipozmen [email protected]
wrote:@liamFerris https://github.com/liamFerris you can start two
ios-webkit-debug-proxy's on two ports. But it is not stable i see.
After a while it is died so we start a watchdog and when it dies
starts a
new one.@VenkateshPS https://github.com/VenkateshPS your problem is
expected
because you are using appium.app and i see you have not set an
external
tmp
folder. I only use appium as a node.js module.—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-157301256.
Venkatesh Prasad Singh
—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-157317081.—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-157319349.
Venkatesh Prasad Singh
Venkatesh Prasad Singh
hey appium currently doesn't work reliable when running on multiple phones checkout https://github.com/appium/appium-instruments/issues/50
we dont have any issues since last 4 months. We have 2 mac mini and 9 iphone devices all running without any problem.
@aluedeke I will be watching this issue. Thanks for your notice.
Can any one tell me how you are connecting ios-debug-proxy which will run in 27753 port, I believe this is apple restriction on multiple devices connecting same time, If they have over come this issue then how ?
node main.js --safari -a
cd /Users/name/ios-webkit-debug-proxy && ios_webkit_debug_proxy -c '< UID_device1 >':27753
node main.js --safari -a
cd /Users/name/ios-webkit-debug-proxy && ios_webkit_debug_proxy -c '< UID_device2>':27754
Is this Correct ?, will this work ??
No. Tmp folders and ports should be different
17 Kas 2015 18:07 tarihinde "Nesa Ganesh" [email protected] yazdı:
IOS Device1
node main.js --safari -a -p 4463 --bootstrap-port 4463 --nodeconfig
/Users/name/Documents/Nodes/IOS5s.json -U '' --show-ios-log --tmp /tmp/ios/cd /Users/nesag/ios-webkit-debug-proxy && ios_webkit_debug_proxy -c '<
UID_device1 >':27753
IOS Device1node main.js --safari -a -p 4463 --bootstrap-port 4463 --nodeconfig
/Users/name/Documents/Nodes/IOS5s.json -U '< UID_device2>' --show-ios-log
--tmp /tmp/ios/cd /Users/nesag/ios-webkit-debug-proxy && ios_webkit_debug_proxy -c '<
UID_device2>':27753Is this Correct ?, will this work ??
—
Reply to this email directly or view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-157415372.
node main.js --safari -a -p 4463 --bootstrap-port 7764 --nodeconfig /Users/name/Documents/Nodes/IOS5s.json -U '' --show-ios-log --tmp /tmp/ios1/
cd /Users/name/ios-webkit-debug-proxy && ios_webkit_debug_proxy -c '< UID_device1 >':27753
node main.js --safari -a -p 4464 --bootstrap-port 7765 --nodeconfig /Users/name/Documents/Nodes/IOS5s.json -U '< UID_device2>' --show-ios-log --tmp /tmp/ios2/
cd /Users/name/ios-webkit-debug-proxy && ios_webkit_debug_proxy -c '< UID_device2>':27754
will this work now
Hi all,
I am having the same issue as Nesaganesh. I need to be able to start multiple iOS-webkit-debug-proxy-launcher but they all need to connect to a remote debugger listening on different ports. I have seen posts where this is possible via an env variable and possible command line option. How can I start multiple remote debuggers listening on different ports for the proxy to connect to?
Update, partial workaround. I found that if you set REMOTE_DEBUGGER_PORT var in the shell that you launch appium server from that sets the debugger port. In another terminal you can launch the iso-webkit-debug-proxy to connect the the debugger port of the appium server.
I have 3 different iOS devices running ui automation in parallel now, but it is not exactly stable.
@suayipozmen I've kept trying for nearly 2 days but still get errors as long as parallel testing is launched. And could you please provide exact appium version?
@marloncruz I've also tried running with different users but no luck.
below is my local config:
Appium version 1.4.13/1.4.16/1.5.0 beta-7
node appium --nodeconfig /Users/{User name}/selenium-server/iphone5s.json -p 6001 -U 7211b9754480c6ad07744002a1f832f78d57933e --show-ios-log --no-reset --tmp ~/tmp1
node appium --nodeconfig /Users/{User name}/selenium-server/iphone6s.json -p 6002 -U 2402f0125ca3c4debbe3cd8a76098ccad6d9cc7a --tmp ~/tmp2
If there are 2 sessions, the 1st one must be blocked as long as the 2nd is created.
@jlipps I'm eager to know if multi devices testing will be supported on iOS by Appium. Because I think there must be some tests need parallel testing like end to end test, e.g. phone1 making call to phone2. It's easy on Android but I don't have a clue on iOS. I found quite a lot of people above saying it's available now, Is it true,officially?
I also would like to know. I tried to run tests in parallel on 2 iOS physical devices with Appium connected to the selenium grid and instruments kept crashing.
In my earlier post I mentioned about ios-debug-proxy, which will run only in 27753 port, I believe this is apple restriction on multiple devices connecting same time.
cd /Users/name/ios-webkit-debug-proxy && ios_webkit_debug_proxy -c '< UID_device1>':27753
cd /Users/name/ios-webkit-debug-proxy && ios_webkit_debug_proxy -c '< UID_device2>':27754
Its not picking up the 2nd device ios_webkit_debug_proxy, If people overcome this issue then multiple IOS device are possible.
@Nesaganesh Appium's default port is 27753 and cannot be overridden - please see this issue: https://discuss.appium.io/t/override-appiums-ios-webkit-debug-proxy-default-port/7019
@Nesaganesh, @gregorywringle, @dumplincat
I was having trouble with this and finally got it working.
./reset.sh --ios --real-safari
REMOTE_DEBUGGER_PORT=27753
node appium --session-override --nodeconfig /path/to/iPodTouch.json --show-ios-log --tmp /tmp/ios/ -p 4623 --bootstrap-port 4464 --webkit-debug-proxy-port 27753 --full-reset --native-instruments-lib --safari > logs/log_iPodTouch.txt &
REMOTE_DEBUGGER_PORT=27754
node appium --session-override --nodeconfig /path/to/iPad.json --show-ios-log --tmp /tmp/ios6/ -p 4523 --bootstrap-port 4465 --webkit-debug-proxy-port 27754 --full-reset --native-instruments-lib --safari > logs/log_iPad.txt &
REMOTE_DEBUGGER_PORT=27753
./ios-webkit-debug-proxy-launcher.js -c 68c00893cac31e29d314142ba5ba985b20f09f95:27753 -d > logs/log_iwdpl.txt &
REMOTE_DEBUGGER_PORT=27754
./ios-webkit-debug-proxy-launcher.js -c a7bd67f34fa1b94651c832041b4dee720dc2cbc1:27754 -d > logs/log_iwdpl2.txt
I used every argument that people had suggested in this thread, plus the --webkit-debug-proxy-port which I think is essential. I doubt that all the arguments are necessary, just as of yet I haven't went through and tested which can be removed.
Hope this helps,
Liam
@liamFerris have you tried testing native/hybrid iOS apps in parallel?
@gregorywringle I haven't and I don't really have any iOS apps to try it with.
The above configuration sorted out the issues with instruments and the issues with ios-webkit-debug-proxy so I imagine that there shouldn't be much of an issue on native/hybrid apps.
If you do end up trying it let me know how it goes :+1:
@liamFerris Thanks for the suggestions, Liam. To make sure my trying effective, I'd like to confirm the following:
@dumplincat
Hope the testing goes well,
Liam
@saikrishna321 I'm able to run on two real devices parallely. Did you tried it?
appium -p 6001 -bp 4001 --native-instruments-lib --full-reset --tmp ~/tmp1 --nodeconfig ../path to/nodeconfig.json
appium -p 6002 -bp 4002 --native-instruments-lib --full-reset --tmp ~/tmp1 --nodeconfig ../path to/nodeconfig.json
nodeconfig.json
{
"capabilities":
[
{
"browserName": "iPod touch",
"version": "8.4",
"maxInstances": 1,
"platform": "MAC"
}
],
"configuration":
{
"cleanUpCycle":2000,
"timeout":30000,
"proxy": "org.openqa.grid.selenium.proxy.DefaultRemoteProxy",
"url":"http://localhost:4730/wd/hub",
"host": "localhost",
"port": 4730,
"maxSession": 1,
"register": true,
"registerCycle": 5000,
"hubPort": 4444,
"hubHost": "localhost"
}
}
@SrinivasanTarget thats awesome.. Can you confirm if you tested native or hybrid app over ios, as i'm interested to know how you set webkit proxy ?
I have a FW for running android tests in parallel without setting you the grid please take a look https://github.com/saikrishna321/AppiumTestDistribution
I'm planning to support iOS as well, for which i would want to know how the webkit proxy works..
@saikrishna321 I have tested the hybrid app but only the native context so far. Will try the webview's as well and update you.
@SrinivasanTarget are you running the two devices from the same mac machine?
i know there is a solution fur running multiple ios simulators on one mac machine that was created by facebook (take a look at https://github.com/facebook/FBSimulatorControl)
but didn't hear of a solution for physical devices.
@doronzRumble Its two real devices connected to one mac.As said above need to check out for webviews (Will check it out soon) and i'm still wondering how does kill all instruments command doesn't kill the first one when a second session is initiated.
@SrinivasanTarget could it be that you have more than one xcode installed?
Nope, have only one xcode installed. v7.2 @doronzRumble
Now am able start the webkit-debug proxy with different port-number and also able to run the iOS-hybrid application test in parallel.
Follow the below steps to do setup
1.Checkout the Appium source code from Github (https://github.com/appium/appium)
2.Navigate to checked-out Appium folder and run the reset.sh file (./reset.sh)
3.Once the above installations are done, start the Appium server with below command
./bin/appium.js --address "127.0.0.1" -p 4723 --app "/Users/Desktop/Payload/sample.ipa" --udid "DEVICE UDID" --tmp "/Users/Desktop/Payload" --webkit-debug-proxy-port 27756
4."tmp" path should be unique for all the servers
5.Specify the webkit-debug-proxy port-number like this while starting the server "webkit-debug-proxy-port 27756"
6.Start the iOS-webkit-debug proxy with below command.Make sure the webkit-proxy port-number should be same as what we gave, while starting the Appium server
./bin/ios-webkit-debug-proxy-launcher.js -c DEVICE UDID:27756 -d
@acdurai Awesome! will give a try.
@acdurai i'm just curious to know why you need to run .reset.sh. I already have version 1.4.16 installed through node.
@saikrishna
Once u run the ./reset.sh it will download all the necessary files in same appium checked-out folder
@acdurai wont these files b a part of appium server which is downloaded from v1.4.16 ? n which version r u running ?
@SrinivasanTarget @priyankshah217 i was trying to execute parallel tests on iOS device, i see instruments hangs for the second device.
I'm starting appium server using AppiumLocalService ( have set tmp path different, passed device UDID and also --native-instruments-lib)
Am i missing something more ?
@saikrishna321 Did u added bootstrap port(diff port number's) as server argument while creating a local service?
This has got to be the longest github thread ever.
@tokunbo :)
I don't mind long thread if it has relevance. At least it's not wacky like issue 920 for sinatra. I'd imagine Appium would be likewise worthy of such praise.
@SrinivasanTarget i see Boot Strap port under the AndroidServerFlag not under IOSServerFlag
Below is the current code to start the server
public AppiumServiceBuilder appiumServerIOS(String deviceID, String methodName) throws Exception {
System.out.println("Starting Appium Server");
System.out.println(deviceID);
File classPathRoot = new File(System.getProperty("user.dir"));
input = new FileInputStream("config.properties");
prop.load(input);
int port = ap.getPort();
AppiumServiceBuilder builder = new AppiumServiceBuilder()
.withAppiumJS(new File(prop.getProperty("APPIUM_JS_PATH")))
.withArgument(GeneralServerFlag.LOG_LEVEL, "info")
.withLogFile(new File(
System.getProperty("user.dir") + "/target/appiumlogs/" + deviceID + "__" + methodName + ".txt"))
.withArgument(GeneralServerFlag.UIID, deviceID).withArgument(IOSServerFlag.USE_NATIVE_INSTRUMENTS)
.withArgument(GeneralServerFlag.TEMP_DIRECTORY,
new File(String.valueOf(classPathRoot)).getAbsolutePath() + "/target/" + "tmp_" + port)
.withArgument(GeneralServerFlag.SESSION_OVERRIDE).usingPort(port);
/* and so on */;
appiumDriverLocalService = builder.build();
appiumDriverLocalService.start();
System.out.println(appiumDriverLocalService.isRunning());
System.out.println(builder);
return builder;
}
@saikrishna321 Yup, sorry. Haven't tried it through Appium local service.Will give a try and update you.
@liamFerris Thank you for giving such concise directions on how to fix this error. You were right; including the webkit-debug-proxy port did fix all my errors. Now I'm able to run tests on at least 2 devices from one Mac through appium concurrently. Many thanks!
@liamFerris were u able to run 2 ios devices starting appium server using AppiumLocalService ?
@saikrishna321 No, I haven't used or experimented with AppiumLocalService. If you end up doing any experiments please report your findings, thanks.
@liamFerris i did a spike out of it running appium server pointing to two different tmp folder with different port numbers.. Its was very flaky, say like 3/10 it worked fine n after that instruments hangs. @SrinivasanTarget also gave it a try n still no luck .. So we replaced to start the appium server using ProcessBuilder, still it didnt work...
@saikrishna321 Finally able to execute on iOS devices parallely using TestNG parallel classes and AppiumLocalService. Good news is executed plenty of times parallely and instruments never hangs this time. Have a look at this repo,
https://github.com/SrinivasanTarget/AppiumIOSParallel
I think we can take it forward from here.Lets work on any of our repo's we have created.Anything is fine to make it better.
Thanks for sharing this with us! By the way, Does the method to test iOS devices in parallel work with simulators? I guess this is device only?
@alangithubtrader its device only :-)
@saikrishna321,
Thanks. But isn't it a lot slower (compare to simulator) running many tests on iOS device right now? Simulator has a work around here https://github.com/lawrencelomax/instruments-without-delay
Unless there's a work around which I am not aware of for the delay on iOS device when running tests?
SrinivasanTarget, i have eclipse ide and i am getting below error when it start @BeforeMethod 2nd time, when i comment out ".withArgument(GeneralServerFlag.TEMP_DIRECTORY,new File( String.valueOf(classPathRoot)).getAbsolutePath() + "/target/" + "tmp_" + port)" it works fine, any idea why i am getting below error
[31merror[39m: Unhandled error: Error: listen EADDRINUSE
at exports._errnoException (util.js:746:11)
at Server._listen2 (net.js:1139:19)
at listen (net.js:1182:10)
at Server.listen (net.js:1261:5)
at /usr/local/lib/node_modules/appium/node_modules/appium-uiauto/lib/command-proxy.js:228:20
at /usr/local/lib/node_modules/appium/node_modules/mkdirp/index.js:48:26
at FSReqWrap.oncomplete (fs.js:95:15) context: [POST /wd/hub/session {"desiredCapabilities":{"app":"/Users/vsandes/Desktop/searsAndroid_Apps/AppiumTestDistribution-parallel_ios/build/IPA_PATH.ipa","platformVersion":"9.0","bundleId":"bundle_id","h]
I have set PATH environment variable in eclipse.
Thanks
Vinit
@VinitSandesara It says port is already in use. Can we post issues only related to iOS parallel testing here? Rest please discuss/raise in our appium forum.
@SrinivasanTarget, This is related to iOS parallel testing only, i am taking an example of @saikrishna321 "https://github.com/saikrishna321/AppiumTestDistribution/tree/parallel_ios", I have connected one iOS device on which i am running few test methods but as soon as it start 2nd test method at @BeforeMethod it stuck and throws above mentioned error. What could be the solution for this ? If i have only 1 iOS device connected it will generate only one tmp folder and port number will remain same for all test method as there will be only one appiumserver running for all test method.
Thanks
Vinit
@VinitSandesara Have you connected more than one iOS device and tested this branch or is it you are trying to run your tests on single iOS device connected? If you tested on only one device connected then its not a parallel test scenario and we are least bothered about fixing it up for single device(only one device connected).
We are testing all possible parallel scenario's in that repo.So please hold on for a complete framework.
This might be duplicated, but just wanted to help. I invoke two instances of appium git repo (e.g. Appium_iOS9.2 & Appium_iOS9.1) one for each device with different OS. Also when invoking the instance I give a temp folder for each of them (eg. tmp_9.1, tmp_9.2) as part of the server start up arguments (--tmp). This seems to be working fine. Some times i get the "Not worrying since we use SafariLauncher" in that case, I get the terminal output and see if I have that error, if so I restart the appium instance all over, so my scripts dont stall for ever. This works 9/10 times so far. Hope this helps. Just to add more I have two instances of the webkitproxy running too and give that as part of the appium server startup argument. This is what I have for two devices in parallel.
Note - Have a code/sh file/manually to clear out the instruments tmp folder before you kick of the instance
./bin/appium.js --webkit-debug-proxy-port 27753 --port 4723 --udid
./bin/appium.js --webkit-debug-proxy-port 27754 --port 4724 --udid
i have framework build to run iOS tests in parallel across real devices without setting up grid. Please take a look
https://github.com/saikrishna321/AppiumTestDistribution
@saikrishna321 :+1:
@saikrishna321 nice video, but, can you do the same with IPHONE Real Devices???? not emulator, all from the same Mac?. Thanks!.
@nicomori yup this framework helps your run tests in parallel on real iOS devices and yes on a single Mac machine ...
This is tested by @SrinivasanTarget
Hi,
I've been following this long thread trying to figure out how to run tests on real iOS devices in parallel. Here is my setup:
Appium v1.5.2
OSX 10.10.5
Xcode 7.2.1
I followed the advice above and started two Appium and iOS WebKit debug proxy instances and separate tmp folders:
appium --webkit-debug-proxy-port 27751 --port 4721 --command-timeout 600 --session-override --tmp /Users/someuser/tmp/appium_4721.tmp
appium --webkit-debug-proxy-port 27752 --port 4722 --command-timeout 600 --session-override --tmp /Users/someuser/tmp/appium_4722.tmp
Now everything works great when running tests separately or sequentially, but as soon as two tests are running concurrently, things break. The instruments seem to be stepping over each other. I went as far as installing another copy of Xcode in a different path and set the $DEVELOPER_DIR environment variable to point to different copies of Xcode before I start each Appium instance, and I can see from Appium log that each instance does start the instrument from different Xcode copy.
But still no luck :(
As soon as I start test on the second instance of Appium while the first is running, I see this in the log of Appium instance 1:
[debug] [Instruments][INST STDERR] 2016-05-04 16:27:43.251 instruments[234:4187028] CoreSimulatorService connection interrupted. Resubscribing to notifications.
[debug] [Instruments][INST STDERR] 2016-05-04 16:27:43.252 instruments[234:4187036] CoreSimulatorService connection interrupted. Resubscribing to notifications.
[debug] [Instruments][INST STDERR] 2016-05-04 16:27:43.253 instruments[234:4187026] CoreSimulatorService connection became invalid. Simulator services will no longer be available.
and in the log of Appium instance 2:
[debug] [Instruments][INST STDERR] 2016-05-04 16:27:43.251 instruments[239:4187031] CoreSimulator is attempting to unload a stale CoreSimulatorService job. Detected Xcode.app relocation or CoreSimulatorService version change. Framework path (/Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework) and version (201.3) does not match existing job path (/Users/qa_test_automation/Applications/Xcode.app/Contents/Developer/Library/PrivateFrameworks/CoreSimulator.framework/Versions/A/XPCServices/com.apple.CoreSimulator.CoreSimulatorService.xpc/Contents/MacOS/com.apple.CoreSimulator.CoreSimulatorService) and version (201.3).
[debug] [Instruments][INST STDERR] 2016-05-04 16:27:44.263 instruments[239:4187031] Failed to locate a valid instance of CoreSimulatorService in the bootstrap. Adding it now.
[debug] [Instruments][INST STDERR] 2016-05-04 16:27:44.546 instruments[239:4187082] Connection peer refused channel request for "com.apple.instruments.server.services.capabilities"; channel canceled
It seems there is a conflict of CoreSimulatorService. Why would it need that if I am testing on real devices. I am no iOS/OSX developer, so I have no idea what's going on here. Any ideas or suggestions?
Thanks.
@dhuanggithub
This is working fine for me and that's why I had even given this workaround - I am not too sure what I've said below is accurate- could be wrong as well - can you try ports 27753 + 4723 for one combo and 27754 + 4724 for the other combo. From what I know 27753 (web kit proxy) & 4723 (appium) are the default / kick off ports and you can try incrementing from that - I still use appium 1.4.16 and dont see any issue. Being frank I run three in parallel and I dont see the instruments crashing. Can you try downgrading and give a try may be.
First, I started ios-webkit-debug-proxy
/bin/ios-webkit-debug-proxy-launcher.js -c udid:27756 -d
Then, I tried to start appium server
./bin/appium.js --address "127.0.0.1" --port 4727 --webkit-debug-proxy-port 27756 --udid xxx --command-timeout 600 --backend-retries 3 --session-override --orientation PORTRAIT --tmp ~/Documents/temp2
It returns appium.js: error: Unrecognized arguments: --webkit-debug-proxy-port 27756.
Could anyone help on this?
BTW, I don't test web app via browser, do I need to set this argument --webkit-debug-proxy-port 27756?
Thanks.
@sramgn
Thanks for the help. I tried using the ports 27753 and 27754 like you suggested. Unfortunately, it doesn't make a difference. I also started with Appium 1.4.16 without success, and that's why I was hoping the latest 1.5.2 would work.
Any other suggestion is welcome.
@dancyzheng
I don't think it's needed if you're testing native app. From Appium doc:
@dhuanggithub
I got the 1.5.2 working with two different real devices in parallel. The problem may be, that you have to specify a tmp folder, not a single file. Appium will create a subfolder appium-instruments in your tmp-folder and Instruments will create a Run 1 subfolder within.
Roughly written, I did something like appium [...] --port $port --tmp /tmp/appium/$port to start each instance.
Great that's exactly what I had mentioned too in my original post above. Have one for each instance so the instruments don't over write each other.
@JaNd3r
Even though I am using "--tmp /Users/someuser/tmp/appium_4721.tmp", it does create an folder named "appium_4721.tmp" and "appium-instrucments" (and all the files) inside it. So the temp folder name is not an issue. Thanks.
Has anyone tried running on multiple devices at Sauce Labs, I am doing a
POC, let me know if any one has done before?
I can do that locally on my setup by running Appium on two different ports.
Regards,
Venkatesh
On 1 June 2016 at 00:05, dhuanggithub [email protected] wrote:
@JaNd3r https://github.com/JaNd3r
Even though I am using "--tmp /Users/someuser/tmp/appium_4721.tmp", it
does create an folder named "appium_4721.tmp" and "appium-instrucments"
(and all the files) inside it. So the temp folder name is not an issue.
Thanks.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-222779566, or mute
the thread
https://github.com/notifications/unsubscribe/ALOq2wrh697NNfNbiEARpK0XoBSZ6vpGks5qHH94gaJpZM4AgFwE
.
Venkatesh Prasad Singh
Is Appium 1.5.2/1.5.3 stable for parallel execution on iPhone safari browers?
@liamFerris ---Can we set web_tool_kit debug proxy port in appum server side for Appium 1.4.3
@nicomori looks cool .. would be able to host a sample project which would help a lot here ?
For those of you who got parallel real iOS devices running on the same machine, what versions of Mac OS, Xcode, and Appium are you running? I am just having no luck getting anything running in parallel: two real device, one simulator and one real device, or two simulators. I am on
Mac Mini with OSX 10.10.5
Xcode 7.1.2
Appium 1.5.3
Maybe it's my machine. Maybe I should try it on a different Mac...
@dhuanggithub
Mac Mini with OSX 10.10.5
Xcode 7.2.1
Appium 1.5.3
I don't see why your not able to run on parallel devices, can you please tell us what your problem is?
@saikrishna321
Everything works fine if I run test on two devices sequentially, one after another. However, if I run one test on device1, and while the test is still running, I start test on device2, Appium would fail to start the instrument on device2. For example, you can see below that I am starting two Appium instances with different tmp folders and webkit ports:
Start Appium instance 1 with device 1:
Connected :27753 to iPad (1081ed23a68b9289ac30666e7d8e00f27ba23d69)
[Appium] Welcome to Appium v1.5.3 (REV bc98fd37882c64c896dc2243fcc6e129f170a32a)
[Appium] Non-default server args:
[Appium] address: 'x.x.x.x'
[Appium] port: 4721
[Appium] sessionOverride: true
[Appium] tmpDir: '/Users/qa_test_automation/Development/tmp/appium_4721'
[Appium] defaultCommandTimeout: 7200
[Appium] launchTimeout: 300000
[Appium] nativeInstrumentsLib: true
[Appium] Deprecated server args:
[Appium] -lt,--launch-timeout => --default-capabilities '{"launchTimeout":300000}'
[Appium] --native-instruments-lib => --default-capabilities '{"nativeInstrumentsLib":true}'
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
[Appium] launchTimeout: 300000
[Appium] nativeInstrumentsLib: true
[Appium] Appium REST http interface listener started on x.x.x.x:4721
Start Appium instance 2 with device 2:
Connected :27754 to iPhone (5719d1e03d5e19c351fb8619abed127dcbae6859)
[Appium] Welcome to Appium v1.5.3 (REV bc98fd37882c64c896dc2243fcc6e129f170a32a)
[Appium] Non-default server args:
[Appium] address: 'x.x.x.x'
[Appium] port: 4722
[Appium] sessionOverride: true
[Appium] tmpDir: '/Users/qa_test_automation/Development/tmp/appium_4722'
[Appium] webkitDebugProxyPort: 27754
[Appium] defaultCommandTimeout: 7200
[Appium] launchTimeout: 300000
[Appium] nativeInstrumentsLib: true
[Appium] Deprecated server args:
[Appium] -lt,--launch-timeout => --default-capabilities '{"launchTimeout":300000}'
[Appium] --native-instruments-lib => --default-capabilities '{"nativeInstrumentsLib":true}'
[Appium] Default capabilities, which will be added to each request unless overridden by desired capabilities:
[Appium] launchTimeout: 300000
[Appium] nativeInstrumentsLib: true
[Appium] Appium REST http interface listener started on x.x.x.x:4722
I then go ahead and start test on Appium instance 1. While that's running, here is the output from Appium instance 2 when I try to start a test on it:
...
[Instruments] Launching instruments
[debug] [Instruments] Attempting to run app on real device with UDID '5719d1e03d5e19c351fb8619abed127dcbae6859'
[debug] [Instruments] Found Insruments-Without-Delay: /usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-instruments/thirdparty/iwd7
[debug] [Instruments] Spawning instruments with command: '/Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /Users/qa_test_automation/Development/tmp/appium_4722/appium-instruments/instrumentscli0.trace -w 5719d1e03d5e19c351fb8619abed127dcbae6859 com.bytearc.SafariLauncher -e UIASCRIPT "/Users/qa_test_automation/Library/Application Support/appium/bootstrap/bootstrap-ca28f78c4bac49c4.js" -e UIARESULTSPATH /Users/qa_test_automation/Development/tmp/appium_4722/appium-instruments'
[debug] [Instruments] And launch timeouts (in ms): {"global":300000}
[debug] [Instruments] [INST STDERR] 2016-07-14 09:56:10.562 instruments[7867:1722876] WebKit Threading Violation - initial use of WebKit from a secondary thread.
[debug] [Instruments] [INST STDERR] 2016-07-14 09:56:10.922 instruments[7867:1722873] Attempting to change event horizon while disengage
[debug] [Instruments] [INST STDERR] 2016-07-14 09:56:10.981 instruments[7867:1722892] Attempting to change event horizon while disengage
**[debug] [Instruments] [INST STDERR] Instruments Trace Error : Target failed to run: Connection to the device lost while launching target.
[debug] [Instruments] Instruments exited with code 253**
[Instruments] Error launching instruments: Instruments crashed on startup
[debug] [Instruments] Attempting to launch instruments, this is try #2
[Instruments] Launching instruments
[debug] [Instruments] Attempting to run app on real device with UDID '5719d1e03d5e19c351fb8619abed127dcbae6859'
[debug] [Instruments] Found Insruments-Without-Delay: /usr/local/lib/node_modules/appium/node_modules/appium-ios-driver/node_modules/appium-instruments/thirdparty/iwd7
[debug] [Instruments] Spawning instruments with command: '/Applications/Xcode.app/Contents/Developer/usr/bin/instruments -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate -D /Users/qa_test_automation/Development/tmp/appium_4722/appium-instruments/instrumentscli0.trace -w 5719d1e03d5e19c351fb8619abed127dcbae6859 com.bytearc.SafariLauncher -e UIASCRIPT "/Users/qa_test_automation/Library/Application Support/appium/bootstrap/bootstrap-ca28f78c4bac49c4.js" -e UIARESULTSPATH /Users/qa_test_automation/Development/tmp/appium_4722/appium-instruments'
[debug] [Instruments] And launch timeouts (in ms): {"global":300000}
[debug] [Instruments] [INST STDERR] 2016-07-14 09:56:16.857 instruments[7872:1723378] WebKit Threading Violation - initial use of WebKit from a secondary thread.
**[debug] [Instruments] [INST STDERR] 2016-07-14 09:56:17.027 instruments[7872:1723201] Connection peer refused channel request for "com.apple.instruments.server.services.wireless"; channel canceled <DTXChannel: 0x7fdc5c8f83d0>
[debug] [Instruments] [INST STDERR] 2016-07-14 09:56:17.272 instruments[7872:1723208] Attempting to change event horizon while disengage
[debug] [Instruments] [INST STDERR] Instruments Trace Error : Target failed to run: Connection to the device lost while launching target.
[debug] [Instruments] [INST STDERR] 2016-07-14 09:56:17.273 instruments[7872:1723202] Attempting to change event horizon while disengage
[debug] [Instruments] Instruments exited with code 253**
...
Thanks!
Hi All,
So can we run multiple Ios simulator device parallel with appium on ios
Is this problem resolved or still we can achieve same with real ios device only
Please help
Thanks
@mohitsdet nope, parallel sim is not supported yet. iOS parallel real device works fine.
Hi @aluedeke,
Question regarding to multiple IOS real devices on same physical mac-mini.
Environment:
Appium: 1.5.3
I saw in this thread that it actually works.
I'm using server configuration: baseCmd + " -p " + port + " " + "--session-override " +
" -g " + logFileName + " " + bport + " " + "--default-capabilities " +
udidString + " --tmp /tmp/" + port + " > /dev/null 2>&1 &";
I starting a remote server (using SSH)
In some point the server throws the exception: org.openqa.selenium.remote.SessionNotFoundException: A session is either terminated or not started
Best regards,
Eitan.
@suayipozmen - I see that you actually succeed, maybe you have some comments. - thanks!
https://www.youtube.com/watch?v=aQqPVYoymRs&t=9s
http://ar.linkedin.com/pub/nicolas-mori/27/7a9/356/
2017-01-03 4:49 GMT-03:00 EitanBe notifications@github.com:
Hi @aluedeke https://github.com/aluedeke,
Question regarding to multiple IOS real devices on same physical mac-mini.
Environment:
Appium: 1.5.3I saw in this thread that it actually works.
I'm using server configuration: baseCmd + " -p " + port + " " +
"--session-override " +
" -g " + logFileName + " " + bport + " " + "--default-capabilities " +
udidString + " --tmp /tmp/" + port + " > /dev/null 2>&1 &";
I starting a remote server (using SSH)
In some point the server throws the exception: org.openqa.selenium.remote.SessionNotFoundException:
A session is either terminated or not started
- Do you have any idea what can be the reason the server throws the
exception?
(The app didn't crashed unexpectedly)- Any suggestions how it can be fix?
Best regards,
Eitan.—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-270064079, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ALqRprF6kOm9DLzlbwtm5Am_rb3Flg8bks5rOf19gaJpZM4AgFwE
.
I'm having the same problem as @dhuanggithub with a similar environment. When I run test in parallel (using different ports and tmp folders for each device), if instruments do not crash, the tests run fine. However, if instruments fail to launch in any device, if the device retry and successfully launch instruments, all other instances being used by the other devices are killed. Any thoughts?
EDIT: I was able to solve the issue here https://discuss.appium.io/t/instruments-crash-running-parallel-tests-in-physical-devices/15460
HI @dhuanggithub,
I was able to start the selenium hub and hosted my iOS appium node with the following command, appium --webkit-debug-proxy-port 27753 --nodeconfig /Users/mac/Desktop/node3.json --port 4725 --udid efb59f09e8e3685932394d9f9010012d** --backend-retries 3 --command-timeout 600 --tmp /Users/mac/Desktop/test/appium_iphone_9.2_tmp. The appium node is getting hosted successfully, but after few seconds the selenium hub marks the iOS appium node as down with the following messages,
13:10:34.366 INFO - Registered a node http://127.0.0.2:4725
13:10:54.378 INFO - Marking the node http://127.0.0.2:4725 as down: cannot reach the node for 2 tries
And the iOS appium node terminal has the following messages,
Grid registration error: Cannot find proxy with ID =http://127.0.0.2:4725 in the registry.
Please help me to sort this issue.
Sorry, man. I don't think I can help you. I haven't touched appium for a while since we abandon the project and went with a paid mobile automation suite instead. Such is the perils of open-source software.
Get Outlook for Androidhttps://aka.ms/ghei36
From: Suryakumarn
Sent: Sunday, June 4, 12:44 AM
Subject: Re: [appium/appium] appium won't work with multiple iPhones. (#273)
To: appium/appium
Cc: dhuanggithub, Mention
HI @dhuanggithubhttps://github.com/dhuanggithub,
I was able to start the selenium hub and hosted my iOS appium node with the following command, appium --webkit-debug-proxy-port 27753 --nodeconfig /Users/mac/Desktop/node3.json --port 4725 --udid efb59f09e8e3685932394d9f9010012d** --backend-retries 3 --command-timeout 600 --tmp /Users/mac/Desktop/test/appium_iphone_9.2_tmp. The appium node is getting hosted successfully, but after few seconds the selenium hub marks the iOS appium node as down with the following messages,
13:10:34.366 INFO - Registered a node http://127.0.0.2:4725
13:10:54.378 INFO - Marking the node http://127.0.0.2:4725 as down: cannot reach the node for 2 tries
And the iOS appium node terminal has the following messages,
Grid registration error: Cannot find proxy with ID =http://127.0.0.2:4725 in the registry.
Please help me to sort this issue.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHubhttps://github.com/appium/appium/issues/273#issuecomment-306024381, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AI07upWHrfiCtowps_5Wey_qGMuO0T6-ks5sAmBcgaJpZM4AgFwE.
Hi inthis video you can see 2 devices ios from the same server
you can see 2 devices ios from the same server
@nicomori on same appium session or different session with different ports ?
I maked this with 1 server o mac and 2 differents devices of corse with 2
differents ports.
El dom., 11 jun. 2017 14:48, Sai Krishna notifications@github.com
escribió:
you can see 2 devices ios from the same server
@nicomori https://github.com/nicomori on same appium session or
different session with different ports ?—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
https://github.com/appium/appium/issues/273#issuecomment-307627065, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ALqRpvwVdv1PM-CAdJyBfVSmuTI8qFrbks5sC-IjgaJpZM4AgFwE
.
Take a look at this article (https://www.atlantbh.com/blog/blog-parallel-mobile-testing-appium-part-2-ios/) - we automated this process through a bash script. Maybe the bash script includes something you missed in your setup, or you can use the script out of the box if it suits you.
Yes, it is working now. For android mobiles in Windows machine it works for two mobile with two different ip address. Whereas for MAC and ios devices, the same ip address had to be used with different ports. Thanks for your help everyone.
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
https://www.youtube.com/watch?v=aQqPVYoymRs