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
Related
I'm using Expo to code my apps with React-Native. I can test my apps on Android devices running them from the Expo client app or building an APK and running it as standalone.
On iOS I can run my app from the Expo client but I couldn't find a way to run the app as standalone. In this case, I would like to test the "native" facebook login functionality.
Is it possible to run an app as standalone (without using the Expo client) on iOS?
Note: I'm trying to avoid going through TestFlight for this, that will make my workflow painfully slow. I am using Mac OS.
Run expo build:ios -t simulator to create an iOS standalone simulator build.
Wait for build to finish, then download and unpack YourAppName.tar.gz
Start an iOS simulator and run xcrun simctl install booted YourAppName.app
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.
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.
I know starting from Xcode 4.2 it is possible to run UIAutomation scripts through command line. I've tried this and is working perfectly fine for me in simulator. I'd like to know how to get this run in an actual device.I searched and got the command for running on device as,
instruments -w <device_id> -t /Developer/Platforms/iPhoneOS.platform/Developer/Library/Instruments/PlugIns/AutomationInstrument.bundle/Contents/Resources/Automation.tracetemplate
application -e UIASCRIPT
script -e UIARESULTSPATH <results path>
What exactly should I give in the application, is it the path to ipa or something else?
Advance Thanks
You need to give it the path to the .ipa file. It actualy only needs the app name so you can just pass in the app name.
Very Important : The app needs to be installed on the device, Instruments will not install the app on the device, it will only run a installed app on the device
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.