Challenge - 5 Problems
Mobile Build Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate2:00remaining
What is the output of this Unity Android build script snippet?
Consider the following C# script snippet used in Unity to set Android build options. What will be the value of
PlayerSettings.Android.minSdkVersion after running this code?Unity
using UnityEditor;
public class BuildSettings {
public static void ConfigureAndroid() {
PlayerSettings.Android.minSdkVersion = AndroidSdkVersions.AndroidApiLevel24;
PlayerSettings.Android.targetSdkVersion = AndroidSdkVersions.AndroidApiLevel30;
PlayerSettings.Android.minSdkVersion = AndroidSdkVersions.AndroidApiLevel21;
}
}Attempts:
2 left
💡 Hint
Look at the order of assignments to minSdkVersion.
✗ Incorrect
The code first sets minSdkVersion to 24, then to 21. The last assignment overrides the first, so the final value is AndroidApiLevel21.
🧠 Conceptual
intermediate1:30remaining
Which Unity setting controls the iOS app's display orientation?
In Unity's build settings for iOS, which setting determines whether the app runs in portrait or landscape mode?
Attempts:
2 left
💡 Hint
Think about orientation and autorotation.
✗ Incorrect
The
allowedAutorotateToPortrait boolean controls if the app supports portrait orientation on iOS.🔧 Debug
advanced2:30remaining
Why does this Android build fail with a keystore error?
This Unity C# snippet is used to configure Android signing. Why will the build fail with a keystore error?
Unity
PlayerSettings.Android.keystoreName = "user.keystore"; PlayerSettings.Android.keystorePass = "password123"; PlayerSettings.Android.keyaliasName = "userkey"; PlayerSettings.Android.keyaliasPass = "wrongpass";
Attempts:
2 left
💡 Hint
Check if passwords match the keystore credentials.
✗ Incorrect
If the keyaliasPass does not match the password for the key alias inside the keystore, the build will fail signing.
📝 Syntax
advanced1:30remaining
Which code snippet correctly sets the iOS build number in Unity?
Select the code snippet that correctly sets the iOS build number to "42" in Unity's PlayerSettings.
Attempts:
2 left
💡 Hint
Check the data type of buildNumber property.
✗ Incorrect
The buildNumber property is a string, so it must be assigned a string value like "42".
🚀 Application
expert3:00remaining
How to automate Android APK build with custom keystore using Unity Editor scripting?
You want to write a Unity Editor script that builds an Android APK and uses a custom keystore for signing. Which code snippet correctly sets the keystore and triggers the build?
Attempts:
2 left
💡 Hint
All keystore credentials must be set before building.
✗ Incorrect
To sign the APK correctly, you must set keystoreName, keystorePass, keyaliasName, and keyaliasPass before calling BuildPipeline.BuildPlayer.