juicycleff / flutter-unity-view-widget

Embeddable unity game engine view for Flutter. Advance demo here https://github.com/juicycleff/flutter-unity-arkit-demo
BSD 3-Clause "New" or "Revised" License
2.13k stars 515 forks source link

Any way to export to iOS/android with command line ? #445

Open jpsarda opened 3 years ago

jpsarda commented 3 years ago

I'm trying to develop a flutter/Unity app, and I would like to improve the workflow. I have scripts to build/publish the app. Unity Export to iOS/android is the only thing I can't do by script. Would it be a way to export for iOS/android with command line ?

camao-apo commented 3 years ago

Hi,

Its quite simple you need to use the correct parameters to the Unity:

$unityProjectType = $ProjectType -eq "ios" ? "Build.DoBuildIOS" : "Build.DoBuildAndroidLibrary"

/Applications/Unity-$UnityVersion/Unity.app/Contents/MacOS/Unity -batchmode -nographics -silent-crashes -projectpath $unityProjectFullPath -executeMethod $unityProjectType -username $Username -password $Password -quit

Its a sneak peak from my PS script. But it is not finished yet. There are some variables here but they are quite simple, so you should figure this out.

I find out that the the iOS build is more problematic, because of the changes to the .pbxproj file (export generate completely new iOS project every time, with new ID) and this generates a lot of problems.