I realize that I2CPP comiple to android is very slow. But I have a question that, each time I build, it will export something on my pc, to a build folder. The question is why not just directly build it to my mobile but not put anything on PC, since the package on pc looks quite large, and I have no ideas why it is so large.
The building progress is too slow, I check the documentation it said it is due to write and read from disks. But I have no ideas why transforming from c# to c++ needs to write to hard disks? Can’t it all be done in memory?
To sum up, I feel building in I2CPP to android mobile is too slow and I think this is not because the package is big, it is because there are some issues about the implemenation of Unity building pipeline.
Because it can’t. You always need to compile locally, then transfer. This is true for any device, be it mobile or console or web or embedded devices.
Since the compilation process creates “artifacts” they will be stored on the system that makes the build. Part of doing so is to have the already processed artifacts already available for subsequent (incremental) builds. You’ll notice that the first clean build takes a lot longer than subsequent incremental builds, often by orders of magnitude ie 30 minutes clean build and 5 minutes incremental build.
It could, in theory, but you’d eventually want to write all these artifacts to disk for subsequent builds.
And the build process needs to work on systems with low memory too. Consider the amount of output, this may be upwards of several GiB and this is only the resulting data - not accounting for any additional memory occupied during the build process. So depending on the size of the project most systems would quickly struggle to keep all the compilation state and output in memory, particularly those with 16 GiB RAM or less.
The 120 MB are likely compressed, both executable and data.
The APK doesn’t contain the temporary build artifacts stored only on your machine as they are only needed to speed up the next build.
And unless the APK is a debug build, it woud not contain the debug symbols (ie names of types, fields, and their line numbers, etc).
Those are just the most obvious differences.
Analogy: If you want to build something like a Table, you need a lot more space to build it than the 3x2 meters the table occupies in space once it’s completed. You also need the tools to process the raw resources, you need the space to move the resources and tools around, and it takes significantly more time and steps to manufacture a table than one might think.