how to get setup using XCode/Appium using Appium.app - appium

I am trying to automate the test cases in real apple device using appium but not able to do so.
Need help to setup the appium from appium.app not from terminal to test real apple devices.

There are currently issues with the current release of Appium.app (1.2.0). You cannot use Appium.app alone to run Appium.
You need to install Appium via Source or Appium-version-manager
You need to install XCode
You need to install XCode's command line tools
Follow these setup instructions.
Then follow these instructions to get the application ready for testing.
After that, run a simple test in your language of choice. Examples here
Once you get that working on the simulator, you need to prepare your application for testing on a real device by archiving the Application into an .ipa file signed with a Development certificate that contains your target device's UDID.
THEN, you can supply the udid and deviceName arguments to Appium server/desired_capabilities as defined in the desired_caps document.

Related

Running flutter app in real iOS device [Windows]

I've been searching similar questions but ended up with concerns regarding the actual deployment. I have no problems deploying ios version because I'm using codemagic.
My question here is if it is possible to perform flutter run if I connected an iphone? Like how I use my android device and have USB Debugging enabled.
There are cases that some functions work in android but doesn't in iphone. So if it possible to run my app in an iphone and debug it, I'll just buy an iphone instead of mac since my windows machine is very capable.
Technically you have to own a Mac to build iOS apps. You can use external service to do something similar to what you want though. You will never be able to plug your iPhone to your computer and update your app but you can build an app and install it on your iphone.
For example with Appollo. In this case you have to install Appollo from your CLI
pip install appollo
Then configure Appollo to work with your developer account.
Finally, you can build an IPA file
appollo build start --build-type ad-hoc
appollo build ipa
and you can then install this IPA on your physical device.
No, unfortunately you cannot do this because the one who builds the application for iOS is the Mac machine, not the Windows device. So, the problem here is not in connecting the mobile to Windows, but rather in the reliability of building iOS on Mac devices only.

Install ios-webkit-debug-proxy on Bitbar real device

I am trying to test an iOS application using appium on a Bitbar real device.
I start my test by executing an appium test and after the login I need to switch to WEB_VIEW context to continue testing. I did some research and found that I need to have ios-webkit-debug-proxy installed on the device to switch the context from NATIVE to WEB_VIEW.
Found this doc : http://appium.io/docs/en/writing-running-appium/web/ios-webkit-debug-proxy/#building-ios-webkit-debug-proxy-from-source on the same
But how do I install ios-webkit-debug-proxy and run those commands mentioned in the doc in a Bitbar device.
It is installed in virtual machines. You just have to set startIWDP to true in desired capabilities.

Appium error occurred while processing the command

I'm new to appium and i'm running some automation scripts on a real device. When i run that particular script on simulators. There are no issue. But when i try to run the same on real device then i get the below mentioned error.
An unknown server-side error occurred while processing the command.
Original error:
Bad app: /Applications/Appium.app/Contents/Resources/node_modules/appium/node_modules/appium-ios-driver/build/SafariLauncher/SafariLauncher.app.
App paths need to be absolute, or relative to the appium server install dir, or a URL to compressed file, or a special app name.
(WARNING: The server did not provide any stack-trace information)
Any type of help will be appreciated
Thanks in advance.
SafariLauncher is used when you are trying to automate the safari browser. The safari launcher has to be built for iPhone (real device). It looks like the safari launcher that is built in is built for simulator, which is why the fruitstrap/ideviceinstaller (app installer used by appium-ios) complains as bad app.
To compile the safarilauncher for your real device.
1. Download safarilauncher code from github
https://github.com/budhash/SafariLauncher
2. Compile the code using your developer provisioning profile (having wildcard as bundle id)
3. Place this safari launcher app for the real device automation.
To compile the safari launcher follow this link for detailed info:
https://discuss.appium.io/t/error-installing-safari-launcher-on-real-device-appium-v1-3-7/3793

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.

Calabash-ios: Run test physical device installed ipa without xcodeproj

I am new with calabash-ios and have a dummy question is:
How possibly could I run a calabash test with real device which have installed ipa file (included calabash framework) and without xcodeproj?
Problem is I am doing QA and Dev only gives me ipa file to test without source code.
UPDATE:
I am able to run the ipa file in console and cucumber by adding BUNDLE_ID. And make sure the CFNetwork.framework is including in app framework to establish the connection.
But I got another problem to run the scenario:
1. When I run the command below:
DEVICE_ENDPOINT=http://192.168.1.9:37265 NO_LAUNCH=1 BUNDLE_ID=com.example.appname DEVICE_TARGET=UDID cucumber
Then I got this error:
A JSON text must at least contain two octets! (JSON::ParserError)
features/my_first.feature:8:in `Then I touch "LOG-IN/ CREATE ACCOUNT"'
all other steps was skipped
Then I run the console code
DEVICE_ENDPOINT=http://192.168.1.9:37265 NO_LAUNCH=1 BUNDLE_ID=com.example.appname DEVICE_TARGET=UDID calabash-ios console
Then I run server_version
I got reply back that said connection SUCCEED
But when I run start_test_server_in_background
It took me too long to wait and I see the app my physical device kept crashed and launch again and again until it stop as:
Unable to start. Make sure you've set APP_BUNDLE_PATH to a build supported by this simulator version
Calabash::Cucumber::Launcher::StartError: Calabash::Cucumber::Launcher::StartError:
"Timed out waiting for UIAutomation run-loop Error while writing to fifo. RunLoop::Fifo::NoReaderConfiguredError.
2015-10-01 10:49:41.634 instruments[15640:10558880] WebKit Threading Violation - initial use of WebKit from a secondary thread.
2015-10-01 10:49:42.574 instruments[15640:10558978] Attempting to change event horizon while disengage
2015-10-01 10:49:42.577 instruments[15640:10558877] Attempting to change event horizon while disengage
Instruments Trace Error : Target failed to run: Permission to debug app
Anyone can help please! I tried to search some solution but they almost issue on simulator and they contain xcodeproj. As a QA, I dont have the source code, only .ipa file. :(
Thanks
You should set 3 variables:
$ DEVICE_TARGET=<UDID> \
DEVICE_ENDPOINT=http://<ip>:37265 \
BUNDLE_ID=com.example.YourApp cucumber
The device and the host computer should be on the same network.
The .ipa must be installed on your device.
You can do this in Xcode by dragging-and-dropping in the Device Manager window or with a third-party tool like ideviceinstaller (available with homebrew).
You should never set NO_LAUNCH.
http://calabashapi.xamarin.com/ios/file.ENVIRONMENT_VARIABLES.html#label-NO_LAUNCH
You also need to enable you device for develop and turn on UIAutomation in the Settings.app > Developer.
Enabling device for development
RunLoop::Fifo::NoReaderConfiguredError
UPDATE In response to this question, I rewrote the Testing on Physical Devices Calabash iOS wiki page. Wow, that content was ancient!
As long as the file is build with calabash then that is not a problem. You just call cucumber with APP_BUNDLE_PATH to where ever your .ipa file is and should be all set.
But you should be aware that .ipa needs to be build to match the target you run the tests on.

Resources