0
0
Unityframework~10 mins

Mobile build (Android/iOS) in Unity - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the build target to Android in Unity.

Unity
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Android, [1]);
Drag options to blanks, or click blank then click option'
ABuildTarget.StandaloneOSX
BBuildTarget.iOS
CBuildTarget.StandaloneWindows
DBuildTarget.Android
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing iOS or desktop build targets instead of Android.
2fill in blank
medium

Complete the code to set the build target to iOS in Unity.

Unity
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.iOS, [1]);
Drag options to blanks, or click blank then click option'
ABuildTarget.Android
BBuildTarget.iOS
CBuildTarget.StandaloneWindows64
DBuildTarget.StandaloneLinux64
Attempts:
3 left
💡 Hint
Common Mistakes
Using Android or desktop build targets instead of iOS.
3fill in blank
hard

Fix the error in the code to build an Android player.

Unity
BuildPipeline.BuildPlayer(scenes, path, [1], BuildOptions.None);
Drag options to blanks, or click blank then click option'
ABuildTarget.Android
BBuildTarget.StandaloneWindows
CBuildTarget.iOS
DBuildTarget.WebGL
Attempts:
3 left
💡 Hint
Common Mistakes
Using iOS or desktop build targets in Android build code.
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps scene names to their build index if the index is greater than 0.

Unity
var sceneDict = new Dictionary<string, int> { { [1], [2] } };
Drag options to blanks, or click blank then click option'
A"MainScene"
B1
C0
D"IntroScene"
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 as build index which does not satisfy the condition.
5fill in blank
hard

Fill all three blanks to build an iOS player with development build option.

Unity
BuildPipeline.BuildPlayer([1], [2], [3], BuildOptions.Development);
Drag options to blanks, or click blank then click option'
Ascenes
B"Builds/iOS"
CBuildTarget.iOS
DBuildTarget.Android
Attempts:
3 left
💡 Hint
Common Mistakes
Using Android build target or wrong path string.