maya90 — 2014-07-09T15:41:57-04:00 — #1
is there a way to view a website that's hosted on my computer on my iPhone, if iPhone is connected to the computer via UBS in standard fashion? posted question here
days ago but have not received a response...
i.e., can I point -- in browser in iPhone -- to a url on my comptuer?
ralphm — 2014-07-09T21:01:11-04:00 — #2
To do that, you'd probably have to set up your computer like a web server—so that you can connect to it remotely. (It's a common thing to do, but still a bit of a dark art, imho!—having neverunderstood how to do it.)
Other options would be:
- upload your code to some test location online
- use the iOS simulator on your Mac
mittineague — 2014-07-09T21:07:08-04:00 — #3
If you can hook the two up with a cable you could serve the site with a localhost for testing it, no?
maya90 — 2014-07-10T11:50:48-04:00 — #4
I don't quite understand your question... I do have localhost on my computer (Tomcat)
on my computer url to the site is "localhost:8080/photos...." so is it possible to point to this url from iPhone? (referencing my computer name before "localhost" or something like that?)
mainly remain just curious about this... simulator will also work, of course...
mittineague — 2014-07-10T12:18:59-04:00 — #5
As long as the server is up and running, and the two are "networked" together. Hopefully you have it set up so you don't need the port number, but there is a chance you do, the addresss would be something like
http://localhost [ : port if needed ]/[ site folder ]
http://localhost [ : port if needed ]/index.[ ext ]
maya90 — 2014-07-10T13:10:38-04:00 — #6
no, they are not "networked" together.. (connecting iPhone to computer with USB is not "networking", right?
how would I "network" them together?
maya90 — 2014-07-10T13:20:57-04:00 — #7
so I figured out how to "network" here,
but: does this "networking" only work thru an internet connection?
on iPhone, how do I connect to my wifi and my computer?
PS: and on airport in laptop, if I network, internet connection goes away.. I don't get this.. if iPhone is connected to computer thru USB cable, shouldn't I be able to "network" w/o an internet connection?
mittineague — 2014-07-10T13:38:47-04:00 — #8
A localhost server isn't the same as a hosted server with an IP address, DNS etc that have propagated.
As long as they're physically connected and the OSs don't clash try aiming a browser at localhost when you're certain the localhost is up and running.
You'll find that many here use localhost for Designing and / or Developing.
kakarot720 — 2014-07-10T16:06:55-04:00 — #9
I'm pretty sure this isn't an easy thing to do. When I connect my iPhone to my computer, the iphone definitely cannot see any web server or access any sites I have hosted locally by simply connecting the phone to the macbook with the USB cable. I googled it and came up with several "solutions" but was unable to get any of them to work.
sg707 — 2014-07-10T16:50:46-04:00 — #10
I can't verify this will work but you may want to try "Reverse Tethering". Basically, your phone will connect to Laptop as a Wifi router.
davidkilimanjaro — 2014-08-29T09:31:37-04:00 — #11
from the little knowledge i have of networking what you want to do is virtually impossible
all you can do is to upload your website to domain and u are done
the os are different
maybe u can try it using a windows 8 phone and a windows machine but still technically impossible as the phone doesnt have that capability
oddz — 2014-08-29T10:35:09-04:00 — #12
There is also the option of using [vagrant share if you're using [url=https://www.vagrantup.com/]vagrant](https://www.vagrantup.com/blog/feature-preview-vagrant-1-5-share.html). Super simple once you have a vagrant environment running. Vagrant share is pretty awesome all you have to do is update the vm's host file each time and restart the server than you can access your local vm from anywhere with about an 8 hour duration until you need to setup the share session again. It is relatively simple to just access you're local but everything becomes much more complex with vhosts and vagrant share makes it super simple. Simply put you should be using vagrant if your not already and this feature just pushes it over the edge. Sitepoint has a lot of useful articles for vagrant.
websitemedia — 2014-08-31T22:50:05-04:00 — #13
Yes. I use the following set up.
1 ) I use a local server with MAMP.
2 ) I use Adobe Edge Inspect CC on my laptop and on my ipad, ipad mini, iphone and on Google Chrome. This allows me to see the local url on any a ) smart phone ( iphone, droid, etc ), b ) tablet, c ) ipad. Adobe Edge Inspect CC is free for ipad, iphone, droid, ipad mini. Here is a link that explains what Adobe Edge Inspect CC is.
3 ) I also have WebStorm configured to live preview on my local server.
Above set up is how I make sure that the websites that I design are mobile friendly.
Hope this helps you.