Search code examples
androidunity-game-enginevirtual-device-manager

Does the inability to reproduce a Unity AppCrash error on a virtual device prove anything about the real device?


I've been trying to reproduce an error for an android application that a colleague built. Our client has the application crashing on their phone every time they run it. I suspect that the error is related to the graphics API being targeted by the application (it's a unity app), but can't be sure yet.

In order to track down the problem, I'm using the Android Virtual Device emulator from Android Studio to make a virtual version of the exact device the client is seeing the crash on (it's an old Samsung running Android 4.4.4 which I don't have access to).

Does the fact that the application does not ever crash or produce any error on the virtual device prove anything about my idea of where the error is coming from?

In other words, how sure can I be that the Android Virtual Device is accurately reproducing the real device - particularly in terms of its graphics and processor (which I believe to be the root of the error)?

Bonus: Would the CPU (ABI) or the graphics rendering settings change anything here in terms of replication fidelity?


Solution

  • When debugging, it won't hurt to:

    • Attempt the same actions on a real Android device of any sort,
    • Attempt the same actions on an AVD as you described.

    If you cannot reproduce it using the above, you have only validated that those test cases do work. But not being able to reproduce the error is not proof of its cause. It is, at best, a narrowing of the search space. But how large is the search space?

    To answer this, in general, I believe that AVDs are not good at reproducing device errors of this sort. The search space that the AVD will not accurately replicate is large:

    • Rendering or GPU errors,
    • Architecture or native library errors,
    • Memory errors, and
    • Almost any logic error you might find on the AVD but won't because your configuration is different.

    Therefore, if you cannot reproduce the error and don't appear to have the means to install the app on a similar device, I agree with @james-poag that you could:

    • Ask the user for device logs if they are technical. You may use adb as a standalone tool these days.
    • Visit the user and plug their device into Android Studio.
    • Ask them to report the bug using Google Play if they see the Force Close dialog. You can then review the details via the Google Play console.
    • Ask the developer to include log uploading.
    • Include a crash reporting tool such as Fabric Crashlytics (which is excellent, IMO).

    FWIW, I think your suspicion is most likely correct, but you will not have a way to prove that until you get more details.

    Note: I think that your question has been downvoted because your title is too general. Perhaps consider editing it to reflect the particulars of testing a Unity app on an AVD.