Bird
Raised Fist0
Unityframework~20 mins

Mobile build (Android/iOS) in Unity - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Mobile Build Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ Predict Output
intermediate
2: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;
    }
}
AAndroidApiLevel19
BAndroidApiLevel24
CAndroidApiLevel30
DAndroidApiLevel21
Attempts:
2 left
💡 Hint
Look at the order of assignments to minSdkVersion.
🧠 Conceptual
intermediate
1: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?
APlayerSettings.iOS.targetDevice
BPlayerSettings.iOS.allowedAutorotateToPortrait
CPlayerSettings.iOS.cameraUsageDescription
DPlayerSettings.iOS.buildNumber
Attempts:
2 left
💡 Hint
Think about orientation and autorotation.
🔧 Debug
advanced
2: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";
AThe keyaliasPass is incorrect, causing a signing failure.
BThe keystoreName path is missing, so Unity cannot find the keystore.
CThe keystorePass is too short and invalid.
DThe keyaliasName is missing, so the build cannot sign.
Attempts:
2 left
💡 Hint
Check if passwords match the keystore credentials.
📝 Syntax
advanced
1: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.
APlayerSettings.iOS.buildNumber = "42";
BPlayerSettings.iOS.buildNumber = (int)"42";
CPlayerSettings.iOS.build = "42";
DPlayerSettings.iOS.buildNumber = 42;
Attempts:
2 left
💡 Hint
Check the data type of buildNumber property.
🚀 Application
expert
3: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?
A
PlayerSettings.Android.keystoreName = "mykeystore.keystore";
PlayerSettings.Android.keystorePass = "storepass";
PlayerSettings.Android.keyaliasPass = "aliaspass";
BuildPipeline.BuildPlayer(new[] {"Assets/Scenes/Main.unity"}, "Builds/MyApp.apk", BuildTarget.Android, BuildOptions.None);
B
PlayerSettings.Android.keystoreName = "mykeystore.keystore";
PlayerSettings.Android.keystorePass = "storepass";
PlayerSettings.Android.keyaliasName = "myalias";
BuildPipeline.BuildPlayer(new[] {"Assets/Scenes/Main.unity"}, "Builds/MyApp.apk", BuildTarget.Android, BuildOptions.None);
C
PlayerSettings.Android.keystoreName = "mykeystore.keystore";
PlayerSettings.Android.keystorePass = "storepass";
PlayerSettings.Android.keyaliasName = "myalias";
PlayerSettings.Android.keyaliasPass = "aliaspass";
BuildPipeline.BuildPlayer(new[] {"Assets/Scenes/Main.unity"}, "Builds/MyApp.apk", BuildTarget.Android, BuildOptions.None);
D
PlayerSettings.Android.keystoreName = "mykeystore.keystore";
PlayerSettings.Android.keyaliasName = "myalias";
PlayerSettings.Android.keyaliasPass = "aliaspass";
BuildPipeline.BuildPlayer(new[] {"Assets/Scenes/Main.unity"}, "Builds/MyApp.apk", BuildTarget.Android, BuildOptions.None);
Attempts:
2 left
💡 Hint
All keystore credentials must be set before building.

Practice

(1/5)
1. What is the main purpose of the Build Settings window in Unity when creating a mobile app?
easy
A. To write the game code for mobile devices
B. To switch the platform to Android or iOS and start the build process
C. To design the user interface of the app
D. To test the app on a desktop computer

Solution

  1. Step 1: Understand Build Settings role

    The Build Settings window lets you choose the target platform like Android or iOS for your app.
  2. Step 2: Recognize build initiation

    It also allows you to start building the app file for the selected platform.
  3. Final Answer:

    To switch the platform to Android or iOS and start the build process -> Option B
  4. Quick Check:

    Build Settings = Platform switch + build start [OK]
Hint: Build Settings = choose platform + build app [OK]
Common Mistakes:
  • Confusing Build Settings with coding or UI design
  • Thinking Build Settings is for testing only
  • Assuming Build Settings runs the app on desktop
2. Which of the following is the correct way to switch your Unity project to Android platform?
easy
A. File > Build Settings > Select Android > Click Switch Platform
B. Edit > Preferences > Android > Enable
C. Window > Android > Activate
D. Assets > Import Package > Android

Solution

  1. Step 1: Locate platform switch option

    In Unity, switching platform is done via File menu, then Build Settings window.
  2. Step 2: Select Android and switch

    Inside Build Settings, you select Android and click the Switch Platform button to change.
  3. Final Answer:

    File > Build Settings > Select Android > Click Switch Platform -> Option A
  4. Quick Check:

    Switch platform = Build Settings > Android > Switch [OK]
Hint: Switch platform only in Build Settings window [OK]
Common Mistakes:
  • Trying to switch platform in Preferences or Window menus
  • Importing packages instead of switching platform
  • Assuming Android is enabled by default
3. Consider this Unity C# snippet for building an Android app:
BuildPlayerOptions buildPlayerOptions = new BuildPlayerOptions();
buildPlayerOptions.scenes = new[] {"Assets/Scenes/Main.unity"};
buildPlayerOptions.locationPathName = "Builds/Android/MyGame.apk";
buildPlayerOptions.target = BuildTarget.Android;
BuildPipeline.BuildPlayer(buildPlayerOptions);
What will this code do when run inside the Unity Editor?
medium
A. Do nothing because BuildPipeline.BuildPlayer requires more parameters
B. Throw a compile error because BuildTarget.Android is invalid
C. Build an iOS app instead of Android
D. Create an Android APK file at Builds/Android/MyGame.apk including the Main scene

Solution

  1. Step 1: Analyze BuildPlayerOptions setup

    The code sets scenes to include Main.unity and output path to Builds/Android/MyGame.apk targeting Android platform.
  2. Step 2: Understand BuildPipeline.BuildPlayer effect

    Calling BuildPipeline.BuildPlayer with these options builds the Android APK file at the specified location.
  3. Final Answer:

    Create an Android APK file at Builds/Android/MyGame.apk including the Main scene -> Option D
  4. Quick Check:

    BuildPlayerOptions + BuildTarget.Android = Android APK build [OK]
Hint: BuildPipeline.BuildPlayer + BuildTarget.Android = Android APK build [OK]
Common Mistakes:
  • Confusing BuildTarget.Android with iOS
  • Thinking BuildPipeline.BuildPlayer needs more parameters
  • Assuming code throws compile errors
4. You tried to build an iOS app but got an error: "Xcode project not found." What is the most likely cause?
medium
A. Your Unity version does not support iOS builds
B. You forgot to install Android SDK
C. You did not switch the platform to iOS in Build Settings before building
D. You did not connect an iOS device to your computer

Solution

  1. Step 1: Understand iOS build requirements

    Unity requires switching platform to iOS in Build Settings to generate an Xcode project.
  2. Step 2: Identify cause of missing Xcode project

    If platform is not switched, Unity won't create the Xcode project, causing the error.
  3. Final Answer:

    You did not switch the platform to iOS in Build Settings before building -> Option C
  4. Quick Check:

    Missing Xcode project = platform not switched to iOS [OK]
Hint: Always switch platform to iOS before building for iOS [OK]
Common Mistakes:
  • Confusing Android SDK with iOS build errors
  • Assuming Unity version lacks iOS support
  • Thinking device connection affects project generation
5. You want to build a Unity app that works on both Android and iOS devices. Which approach is best to manage builds efficiently?
hard
A. Use Build Settings to switch platform and build each app from the same project
B. Build for Android and rename the APK file to .ipa for iOS
C. Write platform-specific code only and build once for Android
D. Maintain separate Unity projects for Android and iOS

Solution

  1. Step 1: Understand Unity multi-platform support

    Unity allows building for multiple platforms from the same project by switching platform in Build Settings.
  2. Step 2: Evaluate build management options

    Maintaining one project and switching platform is efficient and avoids duplicate work, unlike separate projects or incorrect file renaming.
  3. Final Answer:

    Use Build Settings to switch platform and build each app from the same project -> Option A
  4. Quick Check:

    One project + switch platform = efficient multi-platform build [OK]
Hint: One project, switch platform in Build Settings for each build [OK]
Common Mistakes:
  • Creating separate projects wastes time and causes sync issues
  • Renaming APK to IPA does not create a valid iOS app
  • Building only for Android ignores iOS requirements
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard