Safari Launcher – Running Web Test on Real IOS Device
Appium Tutorial: Safari Launcher – Running Web Test on Real IOS Device
As Apple has his own monopoly and does not allow Appium to test the internal IOS Apps and the browsers directly. There’s a SafariLauncher app created by the community which helps in bringing up the Safari browser and perform Webapp testing using Appium. You also need to make sure before you start testing on Real device just try deploying the app through Xcode and if everything works fine then start your test execution.
The App source can be downloaded from here.
These are the some of the steps you need to follow in order to make the SafariLauncher app works fine:
- Make sure Iphone / Ipad is connected to the MAC
- Xcode should be installed
- Appium server should be up to date. I am using 1.3.4 at the moment.
brew install ios-webkit-debug-proxy
Connect proxy to the device:
ios_webkit_debug_proxy -c c84c5fd8fb6cd5e84247xx8c511b7cf8d9bef:27753 -d (sometimes you need to try re-installing the webkit if the execution is not successfull)
Make sure on your device settings you have enabled Safari web inspector as well.
Thanks for the Help
I am able to successfully performed the above task with your help. Many thanks for the same !!!! Thanks, Cory
Hi, I have installed Safari launcher in device and executed this code I am using appium verison-1.3.4 Java-client 1.6.1 DesiredCapabilities capabilities = new DesiredCapabilities(); capabilities.setCapability("deviceName", "iphone"); capabilities.setCapability("platformName", "IOS"); capabilities.setCapability("udid","ae45a072822834921de48f557402e96a0dc6cdae"); capabilities.setCapability(MobileCapabilityType.BROWSER_NAME, "Safari"); capabilities.setCapability("automationName", "Appium"); capabilities.setCapability("app", "io.appium.SafariLauncher"); capabilities.setCapability("safariAllowPopups", false); capabilities.setCapability("safariIgnoreFraudWarning", true); URL url = new URL ("http://127.0.0.1:4723/wd/hub"); AppiumDriver driver = new AppiumDriver(url,capabilities); driver.get("https://www.google.co.in"); but getting below exception Checking app install status using: /usr/local/lib/node_modules/appium/build/fruitstrap/fruitstrap isInstalled --id ae45a072822834921de48f557402e96a0dc6cdae --bundle com.bytearc.SafariLauncher info: [debug] Installing app using cmd: /usr/local/lib/node_modules/appium/build/fruitstrap/fruitstrap install --id ae45a072822834921de48f557402e96a0dc6cdae --bundle "/var/folders/xg/szl4n3m55cb0sk39kjqf54580000gq/T/1141114-10439-ev5jwh/submodules/SafariLauncher/build/Release-iphoneos/SafariLauncher.app" info: [debug] Cleaning up appium session error: Failed to start an Appium session, err was: Error: Unable to install [/var/folders/xg/szl4n3m55cb0sk39kjqf54580000gq/T/1141114-10439-ev5jwh/submodules/SafariLauncher/build/Release-iphoneos/SafariLauncher.app] to device with id [ae45a072822834921de48f557402e96a0dc6cdae]. Error [Error: Command failed: ] info: [debug] Error: Unable to install [/var/folders/xg/szl4n3m55cb0sk39kjqf54580000gq/T/1141114-10439-ev5jwh/submodules/SafariLauncher/build/Release-iphoneos/SafariLauncher.app] to device with id [ae45a072822834921de48f557402e96a0dc6cdae]. Error [Error: Command failed: ]
Hi , I can able to execute in simulator but not in real device..Can u please help me to resolve this issie.
You need to update the Java client jar to the latest one
Can anyone send here the code for Android, just like for IOS which is here.
help for fixing your problems
@Jagathes: There's a github repository with SafariLauncher, including the xcode project. You need a valid apple developer account. Create a provisioning profile for SafariLauncher and build your own signed app. Deploy it to your iphone with xcode. At your desired capabilities, put the bundle id of safari launcher into your 'app' settings, delete the browser property. Connect your device and now safari is launched. your problem is happening because fruitstrap is crashing, which is used by appium for deploying apps. @QA: for android testing on browsers, you need to enable the developer tools at you device, attach the udid of your device to your desired capabilities, browser name is 'browser'. Then you can start you tests