What does switch platform mean?

Hello guys,
i am new to Unity and I developed an app with my Window-PC that uses MQTT to turn an LED on, on my Mikrocontroller.

So I did the app on my windows-PC and then went to the build settings and chose iOS and then switched the platform and build it. Then I copied the files to my macbook so that I can create the app on my iPhone.
Everything worked, just MQTT not. But that is maybe another question I will maybe ask, but my main question:

What does switch platform mean? Is it like then unity thinks i am on a iOS Device when I start my game in unity? And it acts exactly like it is in my iPhone? Is there a difference when switich platform on my Windows-PC to iOS and then building it there, and not on my macbook?

Would be really happy for help!

Switching platform changes the platform you are building for, ergo, what hardware the final built program is intended to run on.

It may changes some aspects of the editor, but it’s still just the same Unity editor.

Refer to the documentation: Unity - Manual: Build Settings

Thank you! Why is there the extra step to switch to a platform and then build it? Why is there not just a build button where you chose the platform and it combines these aspects? I maybe understand it more if I get this question

Because reasons. Each platform has their own quirks and switching platform sets up the editor with these quirks in mind so that testing the game in the editor is as close as it can be to testing on the target platform.

These is of course no replacement for actually testing on your target platform.

1 Like