Hello guest! Login or Register

How to preview on a local network

24 votes

Step 3: preview on LAN


In order for Construct 2 to share its preview over the local network, you must start it with administrator permissions on Windows Vista and newer. To do this, right-click its shortcut or EXE file and select Run as administrator. You'll have to do this every time you run Construct 2 when you want to preview on the LAN.

Running Construct 2 as administrator
You'll see a security alert about allowing administrator permissions to Construct 2. Click Yes.

Now Construct 2 is ready to preview on the LAN. Open a project and preview it. (If you're not running Construct 2 with administrator permissions, you may see an error message here - try going back and starting Construct 2 with administrator permissions again.) Notice the address bar should now have your local IP address, e.g. 192.168.1.3:50000, whereas before it would have been localhost:50000.

In the browser
Now, get another device on your LAN. It can be a phone, tablet (like an iPad), a laptop, or another desktop connected to the same LAN. Enter that address to the device's browser, e.g.:

http://192.168.1.3:50000/

You should now see your preview running!

Try changing something obvious in the project and preview again. Both your PC's browser and the second device should simultaneously refresh, showing the new version of your project. This can make it really quick to test games on devices like iPads and phones - there's no need for the full 'export project' process. This is also invaluable for instantly testing your touch events are working for touchscreen devices.

This should make life much easier when developing for mobiles and tablets! Having Wifi networks makes this especially convenient. Also, there's no limit on how many devices can preview on LAN - if you like, you can have several devices all previewing, and when you preview again they will all simultaneously refresh, allowing you to quickly test on a range of devices.

Finally, don't forget this should work for desktop computers and laptops on the LAN as well. If you have team mates working on a PC next to you, they can use the same process to preview your project on their computer too. This could be helpful in testing on a range of browsers, including those on Mac and Linux.

Happy testing!

Note: if you're still having trouble on Windows XP, try this tutorial by user 'cacotigon' for some extra tips.

This tutorial is on multiple pages

Total of 3 edits. Last edit by Ashley on 29 February 2012 5:56 PM
Posted by

1
SocialLie (9.8K) Thursday, January 19, 2012 at 5:23:40 PM
I really liked this. I wanna test. Good Work people o/
1
tavitooo (2,137) Thursday, January 19, 2012 at 5:48:52 PM
Yeah in this moment I will test!!. thanks guys!! you simplify life!!!
1
Velojet (7.6K) Thursday, January 19, 2012 at 8:25:16 PM
That is brilliant, Ashley. Quite a thrill to see it running on another device on my LAN!

Your tutorial made it very easy to set up, thanks.

Just one little glitch - when I tried typing in my LAN address in the Preferences dialog, it wouldn't allow me to enter a dot (.) I got 'Unacceptable Character You can only type numbers here.' I got around it by accepting the suggested '192.168.2.10' - which I could then change, without complaint about unacceptable characters.
1
Ashley (47.6K) Thursday, January 19, 2012 at 10:43:53 PM
@Velojet - oops, thanks, fixed for next build!
0
smitchell (6K) Thursday, January 19, 2012 at 11:15:08 PM
I just tested this, got everything working. so i typed in my ip address like you said, Something like this: http://http://192.168.0.3:50000/ But when i go on my iphone and have a look nothing loads up, And apple give me a error. Something to do with there server being unresponsive.
1
Ashley (47.6K) Thursday, January 19, 2012 at 11:18:08 PM
@smitchell, did you mean to have http twice there? You only need it once.
1
smitchell (6K) Thursday, January 19, 2012 at 11:21:14 PM
Yeah typo whilst writing comment. On device there was only 1
1
Ashley (47.6K) Thursday, January 19, 2012 at 11:37:44 PM
Are you sure you got the right IP, set up the firewall right and ran C2 as admin?
2
Velojet (7.6K) Friday, January 20, 2012 at 12:38:32 AM
... and @smitchell, does that URL work in preview mode on your desktop machine? i.e. in C2, you click 'Run layout' and in your desktop browser you see your game, and then you enter on your iPhone the URL that's in the address bar of your desktop browser ? Do you still get the same timeout error?
1
Wink (4.6K) Friday, January 20, 2012 at 3:54:34 AM
This works great! When I preview on LAN all sounds are working on my Samsung Galaxy S running the Gingerbread OS. This has never happened before with a PhoneGap build.

I was wondering if I will now have sound when I make a PhoneGap build?
0
dinofun (362) Saturday, January 28, 2012 at 5:19:09 PM
Awesome. Works great on Android Bionic. @smitchell-my phone initially wasn't on Wi-Fi, instead it was looking for the preview thru Verizons cloud. Once I enabled Wi-Fi it took right off.
0
dinofun (362) Saturday, January 28, 2012 at 5:47:20 PM
Just another comment on this feature. I notice that if my phone is on and I'm working with Construct 2 on my desktop and I click "preview" on the desktop...it automatically updates and refreshes on the phone. If that isn't worth the price of the license, I don't know what is. No more constant uploading to a website to check/test. Pretty dang cool!
0
smitchell (6K) Saturday, January 28, 2012 at 7:45:17 PM
Yeah i figured this out in the end anyways. I just played with my local settings and it ended up working :)
0
andreas (342) Wednesday, February 01, 2012 at 7:31:04 PM
I had the same problem as smitchell. turns out my home network was categorized as a public one, it therefor didn't work when I unchecked the public option like in the tutorial. simply changed the settings of my network to become private. works great now :)
0
farsmile90 (1,035) Wednesday, February 29, 2012 at 5:31:41 PM
work fine with my galaxy tab. but it's have a little bit slowly and lagging...


You need to Login to post a comment!
Login to your account, or register a new account