Skip to content

Latest commit

 

History

History
52 lines (31 loc) · 2.81 KB

File metadata and controls

52 lines (31 loc) · 2.81 KB

Reference Sheet - Unity - Building to Android

Steps

  1. Android environment setup
  2. Accept Android SDK license (via Terminal: $ANDROID_HOME/tools/bin/sdkmanager --licenses)
  3. Make keys (see this video)
  4. Build and Run

Terminology

Term Definition
SDK Software Development Kit, stored in /Users/<username>/Library/Android/sdk
JDK Java Development Kit, stored in /Library/Java/JavaVirtualMachines/jdk1.8.0_144.jdk/Contents/Home
NDK Native Development Kit, stored in /Users/<username>/Library/Android/android-ndk-r10e
Gradle Gradle is an Android build system which automates a number of build processes.

Debugging

  1. Connect the Unity Profiler (setup instructions)
  2. Run the Android Device Monitor using Terminal /Users/owmundy/Library/Android/sdk/tools/monitor or through the Android SDK Tools
  3. Install and use ADB using Terminal
    • view devices adb devices
    • get pid for app adb shell ps | grep <app name>
    • display log (filters for only Unity) adb [logcat](https://developer.android.com/studio/command-line/logcat) -s Unity
    • display log (other filters) adb [logcat](https://developer.android.com/studio/command-line/logcat) -s Unity ActivityManager PackageManager DEBUG
    • save log to file adb [logcat](https://developer.android.com/studio/command-line/logcat) -s Unity ActivityManager PackageManager dalvikvm DEBUG > logcat.txt

Tips and Common Issues

  • You can download Android Studio to manage SDKs, etc., however (as of Jan 2019) Unity requires >= r13e when using IL2CPP
  • Check that AndroidManifest files are the same version.
  • Errors mentioning arryoutfoindex - See this StackOverflow question
  • Errors mentioning Package signatures do not match the previously ... - You have switched signatures (likely by changing to/from development build) and your original build is not 100% deinstalled on the Android device. See this StackOverflow question for a solution.

Sources