- Home /
How to automate export of android project through command line, which is done by following menu item on UI: "File -> Build Settings -> Export" (shown in attached image)
I want to automate android project export via command line. Right now i am doing it manually with following steps:
Manual Steps:
- step 1. Open project in unity
- step 2. Select 'File -> Build Settings'
- step 3. Tick on checkbox 'export project'
- step 4. click on export button
- step 5. select destination folder and export the project.
I searched on internet and found one similar solution, which seems to be using menu item "Custom -> CI -> Build Android". The process I followed is given link: here
What this does is exports a similar project, but there are some differences.
The project exported by script has many new files in folder unityLibrary/src/main/assets/bin/Data, which are not present in project exported by UI.
Also one file which is present in project exported by UI: unityLibrary/src/main/assets/bin/Data/data.unity3d is missing in project exported by script.
Diff of files in unityLibrary/src/main/assets/bin/Data folder:
I need answers to below questions:
- What is the purpose of these extra files generated by the automated scenario?
- What is the purpose of the file data.unity3d, which is missing in the automated scenario?
- Can we modify the script to generate the same files as generated by manual scenario?
Answer by unity_MhnSJkMLkQzC1g · Apr 30, 2020 at 07:34 AM
Found the answers: What is the purpose of these extra files generated by the automated scenario? What is the purpose of the file data.unity3d, which is missing in the automated scenario?
The extra files generated are uncompressed form of data.unity3d file. The script i am using is setting "compression method" as "default", which means no compression.
This means, in my manual scenario, i am using LZ4 compression, and hence compressed file data.unity3d is generated, while the automation script is using default compression method, and hence it is generation uncompressed files.
Can we modify the script to generate the same files as generated by manual scenario?
I modified the script to have LZ4 compression, attaching the modified script (attachment has .txt extension, save it as .cs extensionlink text).
Your answer
Follow this Question
Related Questions
How to add compiler or linker flags for il2cpp invocation. 3 Answers
Exporting for Android 2.2 on Unity 4.3.4 0 Answers
CommandInvokationFailure: Failed to re-package resources when added GooglePlayGames plugin 2 Answers
Why is the font Futura md bt not displaying correctly / replaced on tablet? 0 Answers
Can you export a Unity game as an Android library? 2 Answers