This method allows greatly save time to view the application on your mobile device. With it you can get rid of the need to export and compile the application, it takes a lot of time.
First you need to make an adjustment in C2.
Go to settings --> Tab Preview --> The default is port 50000, but I put 80 (It's easier to register an address on mobile devices). Next to the LAN has a button, click on it and select your local IP. Click OK, close the construct (required) and proceed to system settings.
Call Run... (press Win+R) --> Write there firewall.cpl
In the window that opens, go to the Advanced Settings (Дополнительные параметры).
Click Inbound Rules (Правила для входящих подключений) and then New Rule...(Создать правило...).
Then follow the screenshots
For the port (usually manages connections to TCP port and UDP)
TCP protocol. If the settings construct open port 80, then 80 and write here.
Allow all connections
Then he offers to write his name for this rule. I wrote LocalPreview.
After creating find it in the list, open it, go to the Advanced tab (Дополнительно) and click the Configure button (Настроить).
In the opened window set everything as in the image below. This is for security. So that no one from the outside could not connect to you.
Remove the check mark from the "Remote Access"(Удаленный доступ)
We proceed to the settings on the phone. To begin, open any project in C2 (administrator) and click Preview. After open Chrome on your mobile device. Prescribe your IP. If you do not specify port 80, then a colon after the IP and write port, all with no spaces.
After the project is open go to a menu Chrome and click Add to Home Screen
(Добавить на главный экран)
This method is sufficient to set up a time. After opening any project in C2, you can view it through the label.Important!
- For the first preview of each project must press preview at the C2.
- If you do not close the preview on the device and press a key on the C2 preview again, the preview on the mobile device itself is updated. It is very convenient !!!
- Preview only works for the first open source project. If you have open at once two or more projects, it is necessary to prescribe for each rule in the system and create shortcuts on your mobile device
- To go in Debug mode it is necessary already during the preview button to poke in the C2 Debug
- C2 Run as administrator
I know English is not very good so used Google Translate.