Running UIAutomation scripts on multiple iOS devices via Instruments command line - ios

Are there any way to run UIAutomation scripts in multiple connected iOS devices? Currently I use instruments with -w switch along with UDID of each device?
I appreciate your ideas.

Related

Using Frida on XCode Simulator

Does anyone has experience with setting up Frida to work with XCode Simulator? I have been searching online but this is the closest thing I've got (https://programmersought.com/article/54464074345/)
However, when I compile and run the app on simulator, I did not see what was described in "quick smoke test". Any help is very appreciated !
As iOS simulator is essentially running apps on your native mac OS host, you can interacts with apps directly as if they are running on your machine.
In a nutshell:
Don't use -U argument as iOS simulator is not a USB device
frida-ps should give you a list of running processes, including the apps running on the simulator.
The rest of the APIs should work in the same way they do for mac OS host.

How to check runnung apps on iOS device using shell script on Mac

I want to get list of the currently running apps on my iOS device, connected to the Mac. Is there a way to do that through shell ?

Does Appium need Xcode for run automated testing on iOS device?

I'm trying to run automated testing on iOS devices without installing Xcode, but seem like it doesn't work.
So I just want to know that Does Appium really need Xcode for run automated testing on iOS device? and why?
Xcode needs to be present for Appium to work.
Appium's command life-cycle, works as :
Selenium webdriver picks a command form the code like (Element.click) and sends it in form of JSON via http request to the Appium server. Appium server knows the automation context like the iOS and Android and sends this command to the Instruments command server which will wait for the Instruments command client (written in node.js) to pick it up and execute it in bootstrap.js with in the iOS instruments environment. Once the command is executed the command client sends back the message to the Appium server which logs everything related to the command in its console. This cycle keeps going till the time all the commands gets executed.
Appleā€™s instruments binary, which Appium uses to launch the iOS simulator, by default uses the currently-selected Xcode, and the highest iOS SDK installed with that version of Xcode.
Appium uses the appium-xcuitest-driver to test iOS devices using the Xcode UI Testing protocol. Under the hood, it will launch the WebDriverAgent on the iOS device, which does the heavy lifting.
There is 3rd party, commercial software which allow you to launch Appium tests on iOS devices without having to use Xcode. Such examples are Mobile Center from MicroFocus, Appium Studio from Experitest, or the quamotion/appion-docker-ios docker image.
Yes you need xcode to run you test on ios. And yes it supports native, hybrid as well as browsers.

How can i automate 'Settings' app in real iOS devices?

I tried with Appium, UI Automation and Monkey Talk to automate native app automation for real iOS device. Mentioned tools are not supporting real iOS native app automation.
Is there a (freeware) tool that automates native apps of real iOS devices?
You can try the following in your Terminal:
instruments -v -w YOUR_DEVICE_ID -t /Applications/Xcode.app/Contents/Applications/Instruments.app/Contents/PlugIns/AutomationInstrument.xrplugin/Contents/Resources/Automation.tracetemplate /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator.sdk/Applications/Preferences.app -e UIASCRIPT /Users/mytests/Documents/xCode/Shell-Script/YourTestScript-App.js
The above command is a 1 liner.
But you need to write your own test script called YourTestScript-App.js

Reset iOS app from commandline

I'm building a tool for building an iOS app and running UIAutomation on it. So far I've been targeting the iOS Simulator and I've run into a hiccup moving to running on real devices.
I have a feature where the tool reinstalls the app between each test, so that it always runs from an uninitialized and known state, which currently uses xcrun simctl uninstall and obviously doesn't work for real devices. I'm looking for something similar for real iOS devices.
Another working solution would be to reset the app through some nifty command.
I'm not interested in any UI based solutions, it has to run from a commandline.
iDeviceInstaller supports uninstalling/installing on real devices.
Uninstall:
/usr/local/bin/ideviceinstaller -U <app_bundleID> -u <device_UDID>
Install:
/usr/local/bin/ideviceinstaller -i <pathToIPA> -u <device_UDID>
We wrote an automation bridge in Illuminator that should allow you to send arbitrary commands to your application (in both the simulator and on real hardware).
It is accessed via the command line through a ruby script.

Resources