Home > Article > Development Tools > Detailed explanation of how to use vscode to write code for development on iPad
Can I develop on iPad? The following article will introduce to you how to turn the iPad into a productivity tool in seconds - use vscode to write code for development on the iPad. I hope it will be helpful to you!
#With the popularity of tablet computers, most people’s living habits and life scenes are inseparable from the use of tablet computers, such as watching TV series and watching short videos. Play mainstream games, etc., but these are just entertainment scenarios. What if you want to integrate the tablet into work or production scenarios, such as editing documents, making worksheet, and writing code?
So after buying iPad, in order to avoid "productivity before buying, iQiyi after buying". We can build a code server on Linux, and then use an iPad to remotely access the code server through a browser or app. Use the resources of the server to run the code, and the iPad front-end only needs to be responsible for writing the code and running it, making the iPad a perfect mobile development tool! !
Moreover, in order to achieve remote mobile development anytime and anywhere, we used cpolar intranet penetration to break through the limitations of the local area network and realize that we can also use iPad to write code and develop in the public network environment! !
The iPad becomes a productivity tool in seconds! Write code with vscode on iPad. [Recommended learning: vscode tutorial, Programming teaching]
Prepare a virtual machine, either Ubuntu or centos. Here we take the VMware Ubuntu system as an example.
Download the code server service
Visit in the browser: https://github.com/coder/code-server, Copy the download command
Open the ubuntu command line and execute it
curl -fsSL https://code-server.dev/install.sh | sh
If you need to enter the ubuntu login account password, enter the password That’s it, then wait for the installation to complete
The following information indicates that the installation is successful
Then enter the following command to set up code-server Login password
export PASSWORD=”000000”##Check the IP address and use it for LAN access
ifconfigAfter setting the password, start the code- server service, enter the following command:
code-server --host= “0.0.0.0”The address and port number information appears to indicate success Then open the browser to access through the LAN
http:/ /192.168.30.128:8080/, welcone code-server appears, indicating success. Enter the password we set and log in.
cpolar official website:
curl -L https://www.cpolar.com/static/downloads/install-release-cpolar.sh | sudo bash
curl -sL https://git.io/cpolar | sudo bash
cpolar version
cpolar authtoken xxxxxxx##Simple penetration test
cpolar http 8080
sudo systemctl enable cpolar
sudo systemctl start cpolar
sudo systemctl status cpolar
Normally displayed as
active, it means that the service is in the normal online startup state
Click Tunnel Management on the left dashboard - Create Tunnel. Since port 8080 is configured in code-server, we need to create an http tunnel pointing to port 8080:
Tunnel name: Customizable, be careful not to repeat##After creating, click the status on the left - Online Tunnel List, view the public network address, copy it down
##3. Test remote accessSince the tunnel created using cpolar above uses a random temporary public network address, the address will change within 24 hours, which is not conducive to long-term remote access. Therefore, we can configure a second-level subdomain name for it. This address is a fixed address and will not change randomly [ps: cpolar.cn has been filed]
It should be noted that configuring a fixed second-level subdomain name requires Upgrade cpolar to the basic package or above.
Log in to the cpolar official website, click Reserve on the left, select to reserve the second-level subdomain name, set a second-level subdomain name, click Reserve, and copy the reserved second-level subdomain name after the reservation is successful
Access the local port 9200, open the cpolar web ui interface, and click the tunnel on the left Management - Tunnel List, find the vscode tunnel, click Edit on the right
Modify the tunnel information:
Click Update
servediter for code-serverThis software needs to connect to the server, open the browser on ubuntu to access the local 9200 port, and log in to the cpolar web ui interface. Click Tunnel Management on the left - Create Tunnel
Create
##After the tunnel is successfully created, click Status on the left - Online Tunnel List, and copy the generated public network address.
After the download is successful, click to open it. Since the software is paid, you can freely choose to purchase it. Choose free trial here and choose the last one. free
Enter relevant information
Parameter introduction:code-server URL: fill in the front The successfully configured http public network address [the address accessed by the ipad browser]
After entering the information, click save in the upper right corner and it will automatically connect. The vscode interface appears to indicate that the connection is successful
Since the ssh port 22 tunnel we created earlier selected a random temporary address, the address will be in 24 Changes within hours. In order to make the connection using vscode on our iPad smoother, we need to fix the public address of ssh.
Note that you need to upgrade the cpolar package to the professional package or above.
Log in to cpolarofficial website backend, click Reserve on the left, Find the reserved TCP address:
ClickReserve
The fixed TCP address is retained successfully. The system generates the corresponding public network address fixed port number and copies it
Visit http://127.0.0.1:9200/ with your browser and log in to the cpolar web UI management interface, click on the left Tunnel management on the dashboard - Tunnel list, find the codeserver tunnel, click Edit on the right
to modify the tunnel information and configure a fixed TCP port address:
Click Update
prompts that the tunnel update is successful. Click the status on the left dashboard - Online Tunnel List. You can see that the public network address of the tunnel you just modified has been updated to a fixed TCP port. address and copy it.
On iPad, open servediter for code- Server software, modify the host parameters to the fixed TCP port address we just configured successfully.
Click the i
logo in the upper left corner
Select self Host Server
Change the Host value to the tcp address we just reserved on the official website
After changing, click save in the upper right corner. After clicking, it will automatically connect, and the vscde interface will appear to indicate success. At this point, the tutorial is over, use iPad to start happy programming! The public network address will no longer change randomly.
For more knowledge about VSCode, please visit: vscode Basic Tutorial!
The above is the detailed content of Detailed explanation of how to use vscode to write code for development on iPad. For more information, please follow other related articles on the PHP Chinese website!