Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community!
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.Start your free trial
I am working on a mac and I would like to know how to launch the iPhone simulator as it is done in the video "Device-specific media queries: Part 1" of the "Media Queries" Depp Dive.
Thank you Michael
Chris Shaw26,676 Points
The first thing you will need to do is download Xcode from the Mac App Store which is free but is a chunky download so it may take some time to download depending on your internet speed, once it's downloaded it should install automatically.
Once it's installed complete the following tasks.
Open a new terminal window which you can do by typing
Type in the command under the heading below and press enter.
Open Safari on the simulator and enter the web address, please note that local paths do work as well, for example
/Users/<your username>/Projects/mysite/index.htmlwill work in the simulator.
Command to open the iPhone simulator
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app
If you need to change the device or orientation simply refer to Apple's iOS simulator documentation which has a lot of information.
Hi Chris, and Teame!
Thanks a lot for your help, I got it!
open /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone\ Simulator.app The file /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/Applications/iPhone Simulator.app does not exist.
I tried to put it into Terminal but all I got was this!! Can't figure out why??