Best practices for WebGL on Mobile

I see in that here in the forum many try to run their Unity-WebGL App on mobile browsers, although this is not yet fully supported by Unity.

What do you do that your apps run?
Are there some settings?

My apps crash on loading, even small test apps, that don’t use much memory.

Then you need to figure out the cause. Build with full stacktrace exception support (Player Settings) and a development build. Create an empty project and build that to verify it’s not something odd. Use different browsers.

Be sure to use the Universal Render Pipeline for WebGL in general, more so for mobile, since that’s most efficient.

And for sure always test ALL browsers that you want to support, which should be all those that have at least 5% market share. With WebGL you are effectively trying to support three desktop and two mobile platforms multiplied by the number of browsers commonly used on each platform. Even on iOS you ought to test with Chrome and Firefox, even though both are built on the same WebKit tech stack.

It’s pretty common that one combination of these just won’t work, keep crashing or have visual issues for whatever reason.

Hint: If it’s happening it’s going to be with Safari on iOS. And if not, it’s most likely Safari on Mac OS. :stuck_out_tongue:
(poking fun but not kidding though :eyes:)

did you read How to profile and optimize a web build | Unity

Feel free to check out my Thread about WebGL on Mobile Devices (especially Iphones)

On Android it runs (but poorly)

On ios I get that page reloading.
Is there a way to see the stacktrace on ios without connecting to a mac?

Did you ever figure this out?

Check my Tutorial on how to Build and Test Unity games for Mobile WebGL platform.
There is also an extended text version.