gpt4 book ai didi

How do I test my three.js project on iPhone(如何在iPhone上测试我的Three.js项目)

转载 作者:bug小助手 更新时间:2023-10-28 13:43:06 27 4
gpt4 key购买 nike



I created a new AR project, it's pretty simple, the user enters the website and has some AR stuff with their phone camera. The only problem is I don't know how to test my website on iPhone every time I add new code, for now I have an online free hosting and I just upload my changes there, but it's too time consuming. Is there a way to have my website directly on my iPhone?

我创建了一个新的AR项目,非常简单,用户进入网站,用手机摄像头拍摄一些AR内容。唯一的问题是,每次我添加新代码时,我都不知道如何在iPhone上测试我的网站,因为现在我有一个在线免费主机,我只是在那里上传我的更改,但这太耗时了。有没有办法把我的网站直接放到我的iPhone上?


更多回答

use a local web server. Either a NAS with an integrated web server or a virtual web server such as XAMPP. Then you can simply develop on the web server directly and do not need to copy files for testing

使用本地Web服务器。具有集成Web服务器或虚拟Web服务器(如XAMPP)的NAS。然后,您可以直接在Web服务器上直接进行开发,而不需要复制文件进行测试

优秀答案推荐

I use VSCode with Live Server extension on a PC connected to a wireless LAN.

我在一台连接到无线局域网的PC上使用带有Live Server扩展的VSCode。


Live Server serves the website you're developing on a port (e.g. 5500) of your computer.

Live Server在您的计算机端口(例如5500)上为您正在开发的网站提供服务。


I write code on PC, launch Live Server, and from my phone (connected to the same wireless LAN) I browse to my PC IP adress on local Wireless LAN, followed by the port number (something like http://192.186.1.161:5500), and I can use the web app on my phone. Live Server has live reload: every time I modify some file on VSCode, the web page is reloaded on the (phone or PC) browser, showing the updated version.

我在PC上编写代码,启动Live Server,然后从我的手机(连接到同一个无线局域网)浏览到本地无线局域网上的PC IP地址,然后是端口号(类似于http://192.186.1.161:5500),和我可以在手机上使用Web应用程序)。Live Server实时重载:每次我在VSCode上修改某个文件时,网页都会在(手机或PC)浏览器上重新加载,显示更新后的版本。


For AR web app you probably have to serve it on secure (https) connection: Live Server can do this, but you have to create your own SSL certificate. I used the openssl executable that comes with git.

对于AR Web应用程序,你可能必须在安全(HTTPS)连接上提供它:Live Server可以做到这一点,但你必须创建自己的SSL证书。我使用了git附带的openssl可执行文件。


Even if you don't use VSCode, there are many server applications that you can run on your PC and do the same thing.

即使你不使用VSCode,也有许多服务器应用程序可以在你的PC上运行并做同样的事情。


更多回答

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com