Return to site

Open Iphone Simulator Mac

broken image


  1. Iphone Simulator Mac
  2. Ipad Simulator Mac

I'm sure plenty of folks know this, but like literally anything else in the world, plenty of folks don't. This is an incredibly handy feature of developing responsive sites and testing them on as real of devices as you can. Plus, it doesn't cost anything additional beyond your macOS computer.

Here's how to simulate a different iOS device with the iOS simulator: Open the iOS simulator, if it's not already open. From the Hardware menu, select Device, and then select the type of device you want to simulate. The simulator window will change to match the dimensions of the device you selected. To restore the original window with the iPhone case as a border, select iPhone. Meet Your Macinstructor. Explore iPhone, the world's most powerful personal device. Check out iPhone 12 Pro, iPhone 12 Pro Max, iPhone 12, iPhone 12 mini, and iPhone SE.

Step 1) Download Xcode

The iOS Simulator is an app that comes bundled with Xcode. Xcode is free and you get it from the app store.

Iphone Simulator Mac

Step 2) Open Simulator

It's in the main Xcode menu at Open Developer Tool > Simulator.

It will be a new icon in your dock. I like to move it so that it stays an icon in my dock, and I don't need to open Xcode again to find it and use it. Hp elitedisplay software.

(^ It's on the far right here.)

The window for the simulator is like a fake Apple device. You can simulate just about anything (Watch, AppleTV, iPad, etc) by going to Hardware > Device.

Open Iphone Simulator Mac

Step 3) Open Safari and go to a website

Easy enough to type something in. It understands keyboard input so you don't have to like use the mouse to click fake on-screen keys.

Important trick! Often times you are pasting a URL into the address field. To do this, you'll need to have the URL on your clipboard, activate the simulator, press ⌘-V to paste, then you can click to bring up the iOS paste menu and paste it. At least… that's what you used to have to do. I just recently upgraded to Xcode 10 and it seems like you can simply ⌘-V right into the URL bar now, so perhaps the weird work-around is fixed.

Step 4) Open Desktop Safari & Web Inspector

You'll need to go to Settings > Advanced and check the Show Debug Menu option. Then you'll see the option to open the web inspector for the Simulator right from that menu.

With the Web Inspector open, you can debug inside the Simulator just like you could right in a desktop browser with DevTools.

Actual Devices

Simulators are pretty great because they are easy and just a few clicks away. But if for whatever reason you want to test on a real device, you also can do that. As long as: http://rdlvys.xtgem.com/Blog/__xtblog_entry/19181380-things-3-3-7-1#xt_blog.

  • The device is connected to your computer (lightning to USB), and it's 'trusted'.
  • You have an 'inspectable' application open, like Safari.

It should show up in the same Debug menu in Safari and let you inspect the browser right on the real device. It's a bit surreal to watch the blue-boxes of Web Inspector showing up on your real device!

Ipad Simulator Mac

Looking for some useful browser extensions as well? Click here.

There are some features of iOS apps that don't work from the iOS simulator. Maybe you want to test how your application works with the device camera or send an SMS message from your application. For these examples and more you'll need to test and debug your app using a real device.

This post will walk through how to run the Xcode simulator on your iPhone or other iOS device and show you how to fix some common errors you'll see along the way.

How to select your iPhone as the 'Simulator' Device

Simulator is in quotes here since this will create an actual app on your phone; it's no longer a simulation. Open up a project in Xcode and click on the device near the Run ▶ button at the top left of your Xcode screen.

Plug your iPhone into your computer. You can select your device from the top of the list.

Unlock your device and (⌘R) run the application. You'll see Xcode install the app and then attach the debugger. The application should pop up on your phone.

Troubleshooting Common Errors

The first time I tried to connect my iPhone to Xcode it didn't work. According to my best friend, Stack Overflow, I'm not the only one who has had issues. Let's share the fixes to some common errors you might encounter.

'Signing Requires a Development Team'


Xcode requires that you've connected a Team to your project in order to run the simulator on a device. You can do this from the 'General' tab of your Project Settings. As of Xcode 7 this can be any Apple ID.

Open the Team menu that currently says 'None' and select your team. If you don't have a team, select 'Add an Account…' and create one with your Apple ID.

Xcode claims your device is locked when it isn't

Mac

Step 3) Open Safari and go to a website

Easy enough to type something in. It understands keyboard input so you don't have to like use the mouse to click fake on-screen keys.

Important trick! Often times you are pasting a URL into the address field. To do this, you'll need to have the URL on your clipboard, activate the simulator, press ⌘-V to paste, then you can click to bring up the iOS paste menu and paste it. At least… that's what you used to have to do. I just recently upgraded to Xcode 10 and it seems like you can simply ⌘-V right into the URL bar now, so perhaps the weird work-around is fixed.

Step 4) Open Desktop Safari & Web Inspector

You'll need to go to Settings > Advanced and check the Show Debug Menu option. Then you'll see the option to open the web inspector for the Simulator right from that menu.

With the Web Inspector open, you can debug inside the Simulator just like you could right in a desktop browser with DevTools.

Actual Devices

Simulators are pretty great because they are easy and just a few clicks away. But if for whatever reason you want to test on a real device, you also can do that. As long as: http://rdlvys.xtgem.com/Blog/__xtblog_entry/19181380-things-3-3-7-1#xt_blog.

  • The device is connected to your computer (lightning to USB), and it's 'trusted'.
  • You have an 'inspectable' application open, like Safari.

It should show up in the same Debug menu in Safari and let you inspect the browser right on the real device. It's a bit surreal to watch the blue-boxes of Web Inspector showing up on your real device!

Ipad Simulator Mac

Looking for some useful browser extensions as well? Click here.

There are some features of iOS apps that don't work from the iOS simulator. Maybe you want to test how your application works with the device camera or send an SMS message from your application. For these examples and more you'll need to test and debug your app using a real device.

This post will walk through how to run the Xcode simulator on your iPhone or other iOS device and show you how to fix some common errors you'll see along the way.

How to select your iPhone as the 'Simulator' Device

Simulator is in quotes here since this will create an actual app on your phone; it's no longer a simulation. Open up a project in Xcode and click on the device near the Run ▶ button at the top left of your Xcode screen.

Plug your iPhone into your computer. You can select your device from the top of the list.

Unlock your device and (⌘R) run the application. You'll see Xcode install the app and then attach the debugger. The application should pop up on your phone.

Troubleshooting Common Errors

The first time I tried to connect my iPhone to Xcode it didn't work. According to my best friend, Stack Overflow, I'm not the only one who has had issues. Let's share the fixes to some common errors you might encounter.

'Signing Requires a Development Team'


Xcode requires that you've connected a Team to your project in order to run the simulator on a device. You can do this from the 'General' tab of your Project Settings. As of Xcode 7 this can be any Apple ID.

Open the Team menu that currently says 'None' and select your team. If you don't have a team, select 'Add an Account…' and create one with your Apple ID.

Xcode claims your device is locked when it isn't

This fun bug has been happening since at least Xcode 6. There are a lot of potential solutions in this Stack Overflow post. Here's what worked for me: http://ckoduf.xtgem.com/Blog/__xtblog_entry/19156120-the-best-audio-editing-software-free-download#xt_blog.

  1. Unplug your iPhone
  2. Reset Location & Privacy on your iPhone. Found under Settings >> General >> Reset
  3. Plug in your iPhone
  4. Hit Trust when prompted to Trust This Computer

You can learn more about how trusting computers works from Apple's support.

'iPhone is Busy'

The unsatisfying answer for this one is to just wait. Western digital for mac and pc.

If you don't have a sword fighting partner, you can try the following:

  1. Unplug your device
  2. Restart both Xcode and your iPhone
  3. Plug in your device

That worked for me, but a lot of folks had luck with 'Solution #3' from this Stack Overflow post.

Activate your Debugging Superpowers

The Jasonette docs FAQ has some more tips if you have other related issues. Now that you've got your application running on a device you can make the most of your testing and debugging experience with these tips:

If you have any questions or run into any other issues, feel free to reach out to me on Twitter @kelleyrobinson.





broken image