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! While you're at it, check out some resources Treehouse students have shared here.
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 trialMichael Bourgeois
12,713 PointsiPhone simulator
Hello,
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
3 Answers
Chris Shaw
26,676 PointsHi Michael,
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
Terminal
into spotlight.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.html
will 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.
Michael Bourgeois
12,713 PointsHi Chris, and Teame!
Thanks a lot for your help, I got it!
Michael
Chris Shaw
26,676 PointsYou're welcome
Charlie Person
8,692 Pointsopen /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??
Chris Shaw
26,676 PointsYou need Xcode before you can use the simulator, you can download it from the Mac App Store for free.
Tommy Gebru
30,164 PointsTommy Gebru
30,164 PointsHey Chris, do you see the bug? the line of code or command you typed out has spilled out from the post and onto the column to the right outside of the forum post.
Chris Shaw
26,676 PointsChris Shaw
26,676 PointsTeame Gebru Fixed, I'm on a 1600px+ display so I didn't see that, thanks for spotting it.
Josuel Garcia
6,069 PointsJosuel Garcia
6,069 PointsChris your a genius man you should just work for treehouse you know all the answers.