Appium Beginner Tutorial 15 | How to setup iOS Automation on Mac OS

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome I am Jacques Hoff and today we are going to learn from scratch how to set up a u.s. automation testing on Mac OS and this is going to be very easy and very interesting and do not worry if you have no prior knowledge on this topic I will go very basic step-by-step so we need Java we need IBM we need Xcode Xcode command line tools webdriver agent real devices or simulators and then we need an ID to create our project so let's get started and step number one is we should have Java on our system and you can install Java JDK so I will go to my terminal I have pressed command space bar to bring this spotlight search and I will say terminal and here I will say Java space hyphen version so this should give me my my Java version and you can see Java 8 is setup I can also check the compiler version by saying Java C space hyphen version and this shows me the compiler version of Java now in case it is not set up you can go to my website which is automation step-by-step comm and you can go to the online courses here and here you will find a tile for Java so if you go if you scroll down you will find this programming section where we have Java and this will take you to the YouTube playlist on my channel and here you will find our video on how to install or update Java on Mac so just in case you are having any issues with Java you can watch this I will also provide this link here and all these nodes will be available to you with this video so you can check this in the description section of the video and then once you have Java you can install homebrew so home to you is the package manager for Java and we can use home view to install other packages and again to get home view you can just go to Google and say home view and it will take you to this website of home view which is through dot SH you can go here and it will take you to home view so you can see the system missing package manager for Mac OS and to install home view you just have to run this command on terminal so using this command you can install home view so we'll also make this available in the notes this is the command and also this website URL so it is very easy for you to follow so this is the second step and then third step is we can install node GS and NPM so now we can use view to install node and once you install node NPM will be available so you can just install node and once you have this if you say node space hyphen V and NPM space hyphen V you should get the version of node and NPM now in my case I already have it if you do not get the version you can just use blue install node or you can go back to the online courses link on my website and you will find course on mobile testing and there PM here so in this playlist on rpm you will find this video on how to install a p.m. on Mac OS I have explained how to setup node in this video and also how to install a p.m. so step number 3 installing node and step number 4 installing a p.m. are already covered in this video just in case you do not have it you can watch these videos here so I will also provide the link here so you can install a p.m. by using NPM install minus iere p.m. on the terminal or you can also get a p.m. desktop client which is optional so either of these two you can get and this is explained in this video so this is step number four and once you have done these four steps then we come to Xcode now step number five is we have to get Xcode and Xcode is the development environment on Mac and we use it to create iOS apps or to automate iOS apps and you find all the resources tools and files that we require for creation and automation of iOS apps so to get Xcode you can go to your app store there are multiple ways you can go to app store and in the App Store you can search for Xcode so you can go here and say Xcode and search for it and it will show you Xcode and you can see this is here now in case you do not have it on your system you will have a link to get here in my case because I already have I am just getting an update link and in most of the latest Mac operating system and Mac devices Xcode is already present so you can check you might already have Xcode if you do not have you can just get it from here and Xcode is a very heavy file it is like multiple GBS of ug B's file and it can take some time to setup on your system it can take several hours so in case you do not have Xcode you have to wait to get Xcode so you can get it from here or you can also go to your browser and you can just say download Xcode and you can go to this site apple developer and you can download Xcode from here so this is you can get it from here or you can also go to download for Apple developers website so this is download for Apple developers and you can go here and again you can get Xcode from here so any of these will work so here you can just now in case you do not have an Apple ID you can create an Apple ID I will just show you how to do that you can go here and here if you go to if you go to this App Store so let me just go to app store again and here if you go to cute links you will see this account so you can go here and here in case you do not have an app Apple ID you will have a link to create an Apple ID and you can get it from here so you can do that but the straightforward way is just go to app store and get Xcode so once you have Xcode then we go to the next step which is step number six where we need to install Xcode command line tools and we just have to run this command on terminal so I will go to my terminal and here I will just copy and paste this command and run this now here it is saying it is already installed because I had run this command earlier in your case if you are doing it for the first time it will run and install the Xcode command line tools so this was step number 6 step number 7 is we have to create Apple ID now in case you have already created earlier like I showed you it is ok or you can go to Xcode and then create an Apple ID so now I will open Xcode on my system so this is Xcode app and once Xcode is open we will go to the Preferences so this is Xcode now once you open your Xcode let me just show you here this is the Xcode window so here we have options to get started with a playground create a new Xcode project or clone an existing project and here it shows you some of your preserves now in your case if you have started for the first time this will be empty so do not worry you will just see this window and now you can go to here menu Xcode and go to preferences and here you can go to accounts and then you can create an Apple ID in my case it is already created so you can create it here or you can also click on this plus button to create more IDs so if you click here you can just select Apple ID and continue and then you can create an Apple ID which is free so you can do it like this and once you have an Apple ID created we need to install Carthage now this is required to launch webdriver agent reject that I will show you in the next step but for now just say blue install Carthage on the terminal so I will again go to my terminal and I will clear everything and say pre-installed Carthage so with the help of home view it will install Carthage on this system and you can also just search for Carthage so this is very good practice that if you do not know the usage of any of these tools or utilities you can always go to Google and search for what is the Carthage so I should say brew install Carthage or yeah so here I will get a get a pitch for Carthage and you can see this is say is a simple decentralized dependency manager and you can find all the details here why do we need it and you can see this documentation and the installation steps are also given here just in case you face any issues you can always go here and read it so now here let us see and looks like this is done so we now have Carthage on our system now the next step is we have to initialize webdriver agent project so now on terminal we have to go to the webdriver agent folder now this will be available in your happy em folder wherever you have installed IBM now if you have installed a pin through desktop client you can go to this location so if you go to this location so all these nodes will be available to you just in case you find it difficult you can copy this from the nodes or description I will go to the finder and I will press command shift and G key on my keyboard that is command shift + G and I will paste this location and I will say go and you can see it is here so this is the webdriver agent project which is present here in your IBM folder so in your application happy m dot f contents resources app node modules f PM node modules IPM xeo a test driver and webdriver agent so this is in case you are using a IBM desktop client in case you have installed rpm through NPM like npm install' manusia p.m. you will find it here so this is the location so here again I will go to my finder and press command shift + G key on my keyboard and I will get it from here now looks like this is not a PM is not installed from the command line or NPM so I will just say NPM install - GF p.m. quickly so that it installs err p.m. so let us just wait for this to get installed and while this is getting installed I should also show you XC UI test driver so this is what we use in our us automation so this is for use for iOS and this is the PM page for that so a Pimm's primary support for automating I US air base via the X UI test and here you can read all the documentation just in case you want to read and let us just wait for this installation and sometimes it is very interesting to see the logs we usually skip the log so you can see when we install a PM it installs a chrome driver and you can see all this is for chrome driver and then you will find a selendroid driver so it installed as a Solyndra driver it checks for that Java is installed so this is required so in case you do not have Java it will not install a p.m. and then you will see here it also installs a p.m. Windows driver but because we are on Mac so it is saying not installing bin Abdul vs. did not detect our windows system and now this is done so now I will just say F p.m. - we look at the appium version and you can see atom 1.1 3.0 is installed and now I can go back to this step go to the folder of IBM which is installed through NPM and if I go to my finder command shift G and go here let me just see this so this is user local bin lip and I will just again try it out so it's not going here let me go to the terminal and I will say which a p.m. so this should show me the location of a p.m. and I can try it out here I will say here CD and I will use this user local lip node modules a p.m. then okay node modules and then we have a p.m. XC UI test driver yes it is here and then the driver agents yes so this is the location the finder was having some difficulty I will again check and yes now it is able to go here so yes we have to go to this location and then we have to run the command mkdir - be resources web driver agent bundle so after going to this location so make sure that you have changed directly to this location and then say this command and after this we have to run this command which is scripts bootstrap dot H minus T and this command will run only once you have Carthage installed so if you do not have Carthage this will throw some error so I will again run this and here I am getting some issue it is saying no JSON object decoded so if I look at the logs I do not get any other information so this can happen for the appium version as well so if I see my happy immersion which I have just installed it is 1.1 3.0 let me try to uninstall and install another version so I will say NPM uninstall - gee appium this should uninstall NPM from the system and then I will install another version of appium so you might also get this error and you can troubleshoot like this so if I say p.m. - we have M is not installed and now I will say NPM install - she happy m and to install a specific or specific version I will say 1.1 2.1 so this is what I need there is some issue I will exit from here and I will open a new command line or a new terminal and I will say NPM install - g AP m at 1.1 2.1 you might have to try with some different versions so i believe this is a stable version so we should be able to run our command with this happy immersion and it is now installing and yes so this should be done in a moment and it is installing chromedriver now if you are going to the location where you have installed your FM desktop client and doing the same steps that is absolutely okay so you can do that way as well so again it is now getting selendroid driver and yes this is done some mo steps are left yes it's not installing bin Abdul verses this is not a Window System and it's done so if I now clear this and say a p.m. - V I have the version 1.1 2.1 now i will again go to the location of webdriver agent and I will again run the command mkdir and this resources and now I will run the command script sport step - dot s H minus T and looks like they should work now so let us wait for this to get completed and yes so this is required when we run and build our webdriver agent project we will need this in case you do not do this you will get an error and it will tell you that you need to do this before you can build and run your webdriver agent project so now this is done and we are done with this step we are done with step number 9 which is initialized webdriver agent project and now we can open the project in Xcode so you can go to the location wherever you have your project so this is the same location actually the same location which is this one this location where we were running all these commands you can physically go on the finder you can physically go on this location webdriver agent and here you will find this webdriver agent dot Xcode project and you can right click and open with Xcode so we have to open this project with Xcode and you can see this is now opening in Xcode so you can see all this project is loaded and here you can see this is the project and if you have any issues you will find it here so you can see all these things are here so if I click on any of these warnings I am getting all these warnings I will say perform changes so everything is ok now and if I see this there are some other things which I will just see there is no runtime issues we have not yet built the project and this is the project so we have opened the project in Xcode and we have done this now so this is again the same location where you will find this project that we have already seen so you have done step number 10 now and now under the Xcode project under this project we have to select these targets webdriver agent lab and webdriver agent runner and then we have to go to the general tab and select select automatically manage sign-in so I will show you if you go here if you go here and I will select this the driveragent lip so here you will get the targets so here I will select webdriver agent lip under the targets and then go to the general tab and here I will say automatically manage sign in and enable automatic and here I have to select a team now you if you do not see anything you can always go to add account and you can give your Apple ID and then create a new team in my case it has already created so I will just select this team here and that's it it's done now again I will do the same thing I will go to the driver agent Runner and do the same thing I will select webdriver agent run on the targets and go to the general tab here general tab here and then I will say under sign in I will say automatically sign in I will say enable automatic and here I will select the team and let us see what happens now so here I am getting this error failed to create provisioning profile the app ID comm dot Facebook dot webdriver a gentleman cannot be registered so if you are getting this here something similar here you can go to build settings and under build settings you will see this product bundle identifier and you will see this is given here and you can change it and give any random name here so for example I will just change this to comm dot track off dot webdriver agent runner and now I will go back to general and let us see so this is again showing me the same thing I can say enable automatic and use my team and I will say try again it is still showing me the issue I will do this again I will go here I have already changed it you can give any random name here actually and go to general and looks like now it is okay so yes now it is okay we have we don't have any issues or errors here so this is done and after this so I have also mentioned this here because we usually get this error if you get this error you have to manually change the bundle identifier which I have shown you now we can do a clean build and run off the project so if you go to product you will find this clean and the keyboard shortcut is shift command and Kiki so you can click clean here you can see clean succeeded again I will go to product and I will say build and it will now build that widget so you can see it is compiling the project now and if we have build succeeded we can then run our project so the first time it can take some time because we are doing it for the first time here so yes this is yes so you can see bill succeeded so now we have this project ready now if you go here if you select if you go to products folder and you will see there is our app here so this is a iOS app you can also create new apps in Xcode however we should not be worrying about creating the apps because we are doing testing and while you are doing testing on any iOS app you will get a dot IPA file or a dot a PP file so here you can see this is our dot a PP file and this is a test step and these files dot IPA or dot a PP we will get from the dev team so the dev team will provide you the file and using that file you can get the application and you can do the testing in case of Android we had our dot apk file and we have seen it in the earlier sessions in case of iOS we have dot IPA or dot appv a PP file so I will just select this here you can see this is here as well I can select this here and then you can see I can run it on any of these devices or simulator so here if you have any device connected to your Mac operating system you will find the device here in my case I do not have but I have these simulators that I can use so you can either directly go from here or you can just select your app and then you can select a simulator here so you can see any of this simulator will work and you can also go to windows you can go to a window menu and here you will find devices and simulators you can go here and here it will show you a list of all the devices all the real devices in my case I do not have it you can also click this plus button to add a device now it is saying no device found because I have not connected any device if you have connected your device with the USB cable you can find it here in case you are using a real device then you connect you will find there option you will find the prompt to trust the connection you can trust it and then you can go to the settings and iOS developer and also you can enable xui test there so here I do not have anything so I will go to simulators and I had the simulators if I go to any of the simulators you can see I am getting the identifier so this is the UDID that we will need in case we are doing scripting in the framework and you can also click on this plus button to add more simulators so here you can add more simulators and I will just cancel it for now and just to check it I will use iPhone 8 and I will say run you can also press command R or you can click on this Run button and let us see what happens I have some warnings but that should be fine it should open the our simulator it says will succeeding succeeded and it is now launching the simulator so you can see this is coming up and yes you can see the simulator so you can use the simulator you can see all these buttons also we can use and then the UI also we can use here it is starting the simulator the first time it will take some time but then it will eventually start it and this is just for example in the project we do not need to do it this way we can directly give the ID of the simulator and it will start and I will show you that so this is how you can get it also if you want to get the UDID so you can see so here you can finally check everything is running fine by using this code or you can also do or run from here that we have already done so here if you go to your command line or terminal I will open a new tab by pressing command T on my keyboard and here I will say so this is the command instruments - s devices this will give you all the devices and simulators on your system and you can also get the ID of those devices so let us just wait and if you are working with a real device you can also use this iOS deploy so you can just get npm install iOS deploy and then say IUS deploy - see on the terminal to get the details of the real device so you can see this command has given us all the devices which are present in this system including DL devices and emulators and every emulator or simulator has this ID so it is called D these are all simulators and you can also get the IDs from here okay so you can see it has started the app and here now we also have this application so this is the test application which was there in this project which is integration app and it has started this so you can now start it like this and if you go to the simulator window so this is simulator if you go to the window you can increase or decrease the size and then if you go to Hardware you can see orientation and home block and everything and here you can see a device list and you can also start other devices so you can start Apple watch or iOS or Apple TV any devices you can start from here as well okay so this was the step and this is a command that you can use to also test from command line and you just have to change the UDID with the device you ready for example if I go to the command if you go to the terminal and I see this is iPhone 6 and this is the UDID of iPhone 6 I can copy this and here this is the UDID I will just use this command and in place of UDID I will give this and I will copy this go to my command line and run this and this should start the simulator so you can see this is running on iphone six-plus and you will find a simulator starting so you can see iPhone 6 is starting here this is iPhone 8 and this is where we have started iPhone 6 so this is good to run this command so you will see you do not have any errors in the setup so at the end you will see some test cases and test with messages so to verify everything is working fine the first time it takes some time so you can see it is taking some time because we are doing it for the first time and this is running fine until now so let's wait for the final message where we can see some test execution or test suit and test case messages that will verify that our setup is correct and then we can start using us automation with IBM so simulators are a little slower than real devices and yes it has finally started so this is iPhone six-plus and yes this is working fine so looks like so everything is ok and yes you can see we have got this message so this is what I was waiting for so you should get something like this start test at this and set up and test suite all that started at this particular time and this started and passed everything is fine so if you get a final message and information like this that means everything is working fine and now your Mac is ready for doing automation on iOS devices and now we can start creating our project so now the next step is we have to start creating our project and there are some desired capabilities that we have to add we have already seen this in the earlier sessions when we worked with Android devices similarly we will have to set up some desired capabilities and we can open eclipse and create our project but before we do that here are some differences that I will provide you in the nodes and you can watch these things and you can go through these differences and then in case you are working with a real device there are some other tools and utilities that you can also get so we have authorized iOS this is a utility which pre authorizes to run UI automation scripts on iOS devices we have this lip eye mobile device again this is a library to communicate with iOS devices and then we have this eye device installer or iOS deploy so I used two pi we have already seen here in case you want to get the details of the real device you can get this and here you can get AI device installer or if this does not work you can get iOS deploy and this again is replica debug proxy this is to access the views on real devices so this is some extra information and this will also be available in the notes and now the project creation part I will do in the next video in the next session so we will start afresh project on Eclipse Java and we will start automation on iOS devices on a Mac computing system so I hope this session was very useful for you while you are doing the setup you might face some issues which I have not faced whenever you face any issues always copy your message or copy your error and go to Google and search for it and you will always find information and you will be able to troubleshoot and in case you find something that you are not able to solve or troubleshoot or get to answer you can always put that in the comment section below this video and I will try to help you so I hope the session was very useful for you to subscribe to this channel to keep receiving more videos on automation testing DevOps and CI and I will meet you in the next session thank you for watching
Info
Channel: Automation Step by Step
Views: 98,456
Rating: undefined out of 5
Keywords: how to setup ios automation on mac, how to do ios mobile automation on mac os, ios setup on mac, how to configure mac for mobile automation, how to prepare mac for ios automation testing, mobile automation testing tutorials, mobile automation testing using appium, mobile automation testing using selenium, how to install xcode on mac, how to run webdriveragent project, appium for ios automation
Id: -_6C_-CMqSk
Channel Id: undefined
Length: 35min 34sec (2134 seconds)
Published: Wed May 22 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.