How to set different proxies for multiple iPhone simulators on same Mac machine? - ios

I need to set different proxies for multiple iPhone simulators on the same mac machine, because I need to test an app on multiple simulators at the same time and track their network requests separately.
For the android app, above requirement can be easily met by android emulator + adb tool.
But for the iOS app, iPhone simulator share same network settings of the mac OS, only one proxy can be set.
NOTE: It's the same app running on different simulators. If using same proxy, it's hard to know which simulator the requests come from.
Is there any solution to set different proxies for multiple iPhone simulators?
thanks.

Related

Run tests on different devices using Appium in parallel mode

So, is it possible to run one test on different devices with different OS (on android and ios) using one Appium server instance? Or I need to up different Appium instances on different ports?
I can't found any information about devices that work on different systems, only for the same one (f.e. 2 android devices or 2 ios).
Thanks!

so if we need to setup an auto tests (Appium) of an iPhone app from our Win 10 setup - what are all of our options?

for Android - we just run the emulator and hook them up
but for iPhone what are our options?
can we also run some iPhone emulator?
or hook up an actual iPhone via USB?
or have our code connect to virtual (or real) MacOS that has an iPhone emulator (connected to by Appium)
or for that matter/similar to above - connect to a 3rd party service that will serve up an emulation for us to test? what are the best services?
are these all the options?
thank you ...
There is no difference from such point of view between android and iOS.
Yes, you can basically use all of the options.
The most simple way is to run emulator on your machine and test it. If you have such resources, you can test on real devices (the best way). Since you can run iPhone emulator even on Windows there is no need to run emulator on MAC.
Regarding 3rd party services, there is an AWS farm that uses real mobile devices, but i have never tried it, i think it is the most expensive way

The iOS Simulator is a Virtual Machine or a Emulator?

The iOS simulador that installs with Xcode is a VM or a emulator like Android does?
It's neither a Virtual Machine nor an Emulator. It's a simulator, in another words it's a standard mac application which mimic the behaviour of iOS devices. It mimics most of the features of an actual devices, but lacks some major features. So you need to use a real device for testing some of the real world scenarios.
You can read more about simulators here : About Simulator
I would like to quote some key information from the above linked page:
What is Simulator
Simulator allows you to rapidly prototype and test builds of your app
during the development process. Installed as part of the Xcode tools,
Simulator runs on your Mac and behaves like a standard Mac app while
simulating an iPhone, iPad, Apple Watch, or Apple TV environment.
Think of the simulator as a preliminary testing tool to use before
testing your app on an actual device.
Need of actual device for Testing
Simulator is a useful tool, but it should not be the only way you test
an app. Because the simulator is an app running on a Mac, it has
access to the computer’s resources, including the CPU, memory, and
network connection. All of these resources are likely to be faster
than those found on a mobile device. As a result, the simulator is not
an accurate test of an app’s performance, memory usage, and networking
speed. For this same reason, always test the performance of your app’s
user interface on a device. In Simulator, your app’s user interface
may appear to run both faster and smoother than on a device.
Also keep in mind that some user interface elements can be easier to
interact with in Simulator using a mouse than when trying to interact
with the app through touch on a device.
Finally, there are some hardware and API differences in Simulator.
These differences may affect your app when testing in Simulator.

Test multiple iOS Devices with Xcode Server

It is possible to test multiple IOS devices with OSX Server and Xcode Server.
https://developer.apple.com/videos/wwdc/2014/
Continuous Integration with Xcode 6
I hope I have understood the problem correctly.
The Problem with test multiple IOS devices is. That instruments can run only one device at a time.
With XCode Server it should bepossible to run more then one device at the same time.
Has anyone tried this?
Can Appium handle multiple sessions out of the box or Appium changes are required?
https://developer.apple.com/library/ios/documentation/IDEs/Conceptual/xcode_guide-continuous_integration/000-About_Continuous_Integration/about_continuous_integration.html#//apple_ref/doc/uid/TP400132921

multipeer connectivity test on iphone and a simulator simultaneously

Hello I was searching in all topics of the forum about how can i test an app which uses multipeer connectivity framework. Can someone tell me how can i test an app by using an iPhone device and a simulator simultaneously, player one for device and player two on the simulator and vice versa. I already test the app by using two simulators one per mac - user on a mac and its working but it is not convenient to continuously switch users to test an app.
I tried all the alternatives, running once in simulator and one on device at the same time,make second target, nothing happened.
Thanks in advance
If you put your iPhone and your Mac on the same WiFi network they should able to discover each other without any problem.
Yes you can test your app on Device an Simulator simultaneously.
I'm developing an app with Multipeer Connectivity right now and communication between
Iphone and Simulator works fine.
I'm running it on a MacBook Air.
All you have to do is to make sure, that Bluetooth is enabled on your Mac.
You can do this in System Preferences -> Bluetooth.
In addition to testing on WiFi, you can also test your app based on "Multipeer Connectivity framework" on simulator and any IOS device using Bluetooth, As long as simulator and devices are connected in same Personal area network.
For example, on Iphone you can turn on Personal Hotspot (in your phone General settings) to connect your phone with your mac in same personal area network via bluetooth or WiFi and then try testing your app sharing messages between simulator and Iphone using any personal network based on Bluetooth or WiFi.
All the combination will work as long as app using "Mutlipeer connectivity framework" are on same personal area network.

Resources