1 00:00:00,000 --> 00:00:03,300 ‫-: Hi. Within this lecture we are going to see how 2 00:00:03,300 --> 00:00:08,300 ‫to run our simulator in order to simulate and test our code. 3 00:00:08,430 --> 00:00:12,570 ‫And so far we didn't write any code, but actually 4 00:00:12,570 --> 00:00:16,980 ‫we have just added a new label over here, right? 5 00:00:16,980 --> 00:00:19,890 ‫So we see the Hello Swift over here 6 00:00:19,890 --> 00:00:22,410 ‫and we are not gonna leave this as it is. 7 00:00:22,410 --> 00:00:25,230 ‫We are going to change this app a little bit. 8 00:00:25,230 --> 00:00:27,600 ‫We're going to build an app, 9 00:00:27,600 --> 00:00:31,440 ‫but for right now I'm going to show you how to create 10 00:00:31,440 --> 00:00:35,340 ‫an simulator and how to choose one and play one. 11 00:00:35,340 --> 00:00:38,070 ‫So if you don't see any options over here 12 00:00:38,070 --> 00:00:41,670 ‫you can go to add simulators. 13 00:00:41,670 --> 00:00:45,270 ‫If you click over here, you can choose the simulators 14 00:00:45,270 --> 00:00:48,448 ‫from this tab and you can choose whatever you want. 15 00:00:48,448 --> 00:00:52,650 ‫Right now I only have iPhone 8, X and XR 16 00:00:52,650 --> 00:00:56,219 ‫and I can delete or rename it in the way I want. 17 00:00:56,219 --> 00:01:00,870 ‫It doesn't matter which name I'm using because I can click 18 00:01:00,870 --> 00:01:05,070 ‫on this plus button and I can choose whatever phone 19 00:01:05,070 --> 00:01:07,930 ‫whatever iPad version I want 20 00:01:07,930 --> 00:01:11,880 ‫and I can rename those simulators 21 00:01:11,880 --> 00:01:14,580 ‫and I can create new devices. 22 00:01:14,580 --> 00:01:17,370 ‫As you can see, for rating system version 23 00:01:17,370 --> 00:01:19,830 ‫I have now iOS 13. 24 00:01:19,830 --> 00:01:24,240 ‫If I want, I can download more simulator run times 25 00:01:24,240 --> 00:01:29,240 ‫and I can have more operating system versions from here. 26 00:01:29,693 --> 00:01:34,590 ‫And in fact, I don't need any of the simulators right now. 27 00:01:34,590 --> 00:01:37,440 ‫I'm good to go with iOS 13. 28 00:01:37,440 --> 00:01:39,000 ‫So for example, 29 00:01:39,000 --> 00:01:42,660 ‫you can just create an iPhone seven like this. 30 00:01:42,660 --> 00:01:46,560 ‫And when you create this kind of devices, 31 00:01:46,560 --> 00:01:50,310 ‫you can choose one of them and you can run your code, 32 00:01:50,310 --> 00:01:54,540 ‫You can run your app inside one of these devices 33 00:01:54,540 --> 00:01:57,123 ‫as a simulator on your MacOS. 34 00:01:57,966 --> 00:02:00,030 ‫And it's very easy to do that. 35 00:02:00,030 --> 00:02:03,060 ‫You can go over here and choose just one. 36 00:02:03,060 --> 00:02:06,480 ‫And in the top option you will see something 37 00:02:06,480 --> 00:02:09,483 ‫called, No Devices Connected to my Mac. 38 00:02:10,332 --> 00:02:13,590 ‫And if you actually connect your iPhone using a USB, 39 00:02:13,590 --> 00:02:18,450 ‫you can choose your own iPhone and you can test your apps 40 00:02:18,450 --> 00:02:20,340 ‫on your own iPhone. 41 00:02:20,340 --> 00:02:21,990 ‫I'm not going to do that 42 00:02:21,990 --> 00:02:25,440 ‫because Apple has some kind of limitations. 43 00:02:25,440 --> 00:02:30,440 ‫Like, you can just run 10 apps per week on your own iPhone 44 00:02:30,780 --> 00:02:34,770 ‫if you don't have a developer account registered. 45 00:02:34,770 --> 00:02:37,440 ‫So for right now, we don't need that. 46 00:02:37,440 --> 00:02:39,360 ‫So not to complicate things, 47 00:02:39,360 --> 00:02:42,240 ‫I suggest you to try these apps, 48 00:02:42,240 --> 00:02:46,574 ‫try your apps on your simulators rather than your phone, 49 00:02:46,574 --> 00:02:49,916 ‫and there will be exceptions of that, obviously. 50 00:02:49,916 --> 00:02:54,595 ‫For augmented reality apps or for push notification tests 51 00:02:54,595 --> 00:02:56,640 ‫you will need your iPhone 52 00:02:56,640 --> 00:02:59,550 ‫or you will need a device like iPad. 53 00:02:59,550 --> 00:03:04,550 ‫And we are going to go into all of those matters later on. 54 00:03:04,560 --> 00:03:05,760 ‫But for right now, 55 00:03:05,760 --> 00:03:09,360 ‫just choose one of these predefined phones, 56 00:03:09,360 --> 00:03:13,462 ‫predefined simulators over here like iPhone XR. 57 00:03:13,462 --> 00:03:16,830 ‫And if you click on this round button, 58 00:03:16,830 --> 00:03:18,808 ‫if you click on the play button, 59 00:03:18,808 --> 00:03:21,450 ‫it will just compile your code 60 00:03:21,450 --> 00:03:25,770 ‫and it will display your app for you in the simulator. 61 00:03:25,770 --> 00:03:30,060 ‫Right now we don't have any code, but we have a label. 62 00:03:30,060 --> 00:03:34,020 ‫We can see how our label will look like 63 00:03:34,020 --> 00:03:38,106 ‫in the real iPhone XR using the simulator, right? 64 00:03:38,106 --> 00:03:42,360 ‫Once you do that, if you're starting for this first time 65 00:03:42,360 --> 00:03:43,800 ‫it can take some time, 66 00:03:43,800 --> 00:03:46,822 ‫like a couple of minutes maybe. 67 00:03:46,822 --> 00:03:48,570 ‫And you will see a screen like this. 68 00:03:48,570 --> 00:03:51,630 ‫So this is going to open your app. 69 00:03:51,630 --> 00:03:53,610 ‫This is going to open your phone first 70 00:03:53,610 --> 00:03:55,830 ‫and then install the app on your phone 71 00:03:55,830 --> 00:03:59,790 ‫in your simulator and then display displayed for you. 72 00:03:59,790 --> 00:04:02,160 ‫And this may take a couple of minutes. 73 00:04:02,160 --> 00:04:06,240 ‫As I said, this is being a little faster 74 00:04:06,240 --> 00:04:08,640 ‫for me because I have run this before. 75 00:04:08,640 --> 00:04:13,470 ‫And as you can see now I can see my Hello Swift label 76 00:04:13,470 --> 00:04:15,870 ‫in my phone and I can see exactly 77 00:04:15,870 --> 00:04:19,284 ‫what it will look like when somebody downloads to, 78 00:04:19,284 --> 00:04:24,090 ‫downloads this app to their, your iPhone XR model. 79 00:04:24,090 --> 00:04:29,090 ‫Okay, so we are going to test our apps using this simulator. 80 00:04:29,130 --> 00:04:30,870 ‫We're going to run some code. 81 00:04:30,870 --> 00:04:34,088 ‫We are going to play this on our simulators 82 00:04:34,088 --> 00:04:39,088 ‫and we will see how it will react under real circumstances. 83 00:04:39,288 --> 00:04:41,370 ‫And this is actually a phone, 84 00:04:41,370 --> 00:04:42,600 ‫you can use this, 85 00:04:42,600 --> 00:04:44,700 ‫like you can go to the internet with this. 86 00:04:44,700 --> 00:04:47,402 ‫You can just play around with this simulator. 87 00:04:47,402 --> 00:04:51,570 ‫But we are just using this simulator. 88 00:04:51,570 --> 00:04:55,740 ‫We are just using this phone for task purposes, okay? 89 00:04:55,740 --> 00:04:58,470 ‫But this is functioning iPhone simulator. 90 00:04:58,470 --> 00:05:00,150 ‫Like I can go to settings 91 00:05:00,150 --> 00:05:04,113 ‫and I can change whatever I want from here as well. 92 00:05:05,280 --> 00:05:08,850 ‫So I can close and I can open. 93 00:05:08,850 --> 00:05:13,710 ‫I can go back and front as in a regular phone. 94 00:05:13,710 --> 00:05:15,330 ‫So this is how we create, 95 00:05:15,330 --> 00:05:18,690 ‫this is how we work with the simulators. 96 00:05:18,690 --> 00:05:20,490 ‫Right now I'm going to stop here 97 00:05:20,490 --> 00:05:24,243 ‫and within the next lecture we are going to design our app.