Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Are there instructions for installing a Unity app on Android?

Discussion in 'Android' started by Jessy, Jun 30, 2015.

  1. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    I have found
    http://docs.unity3d.com/Manual/android-sdksetup.html
    and
    http://docs.unity3d.com/Manual/android-BuildProcess.html

    Neither is getting me to the point where my app, fully-functional on iOS, becomes the same, on Android. I have no idea what an Android or Galaxy Tab S is, but this is what I have been provided, to build onto. I have found many videos, but they are all Windows-based. I use OS X. I have gotten to the point where I have an APK file, but I don't know what to do with that.

    This doesn't work:
     

    Attached Files:

  2. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,816
    Surely the Build and Run command in Unity on OSX will automatically install the APK onto the connected device and run it? It does on Windows.

    Alternately, you can install an APK installer app on your device. I use this one
    https://play.google.com/store/apps/details?id=mobi.infolife.installer&hl=en

    And then copy the APK onto the Downloads folder on your device when it's connected to your Mac, open the installer app and choose to install the newly copied APK.
     
    Jessy likes this.
  3. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    Thank you for the link; I will try it.

    Build and Run doesn't make any sense, because it asks for a location to which to build.

    Edit: Worked, it did.
     
    Last edited: Jul 1, 2015
  4. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,816
    Yep, it's asking for a location to put the built APK file. Once it's been put there it will automatically run command line utils in the background to deploy it to your device.
     
    Jessy likes this.
  5. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    How is someone to know where that location should be? "Downloading" is what my grandfather calls transferring files. That folder worked. Perhaps Android is aimed at a more mature audience.

    And, perhaps it is assumed you've installed some other Android app. That seems like it might be reasonable, but, for as few steps as exist, the documentation should cover them.
     
  6. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    That location can be anywhere you want on your pc or wherever, it's not until after the apk file is built (at that location, which you could copy from there over to any number of devices and install manually from), that the apk is then "pushed" to the device and installed right away.

    Edit: I usually have them inside the project folder, outside of assets, with generic names like "testbuild" or "releasecandidate".
     
    Jessy likes this.
  7. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,816
    I usually put them in a builds folder under my root project folder, and that builds folder is ignored in my git repository, as you certainly don't want to be checking builds into a source repo each time.
     
    Jessy likes this.
  8. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    I actually do push builds to my repo, but I guess that might be wasteful on larger apk's and/or if your making frequent commits. I've never thought about keeping a folder for them though, makes sense.
     
  9. Jessy

    Jessy

    Joined:
    Jun 7, 2007
    Posts:
    7,325
    That describes my iOS workflow. However, I understand how to work with Xcode projects, and the Objective-C plugins I write. (Well, I understand that I edit them in Xcode, and copy them back to the Unity project, which works, but seems wrong.) I don't currently have any idea what happens with the Android plugins I got from the Asset Store.
     
  10. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,816
    When you're working in a team of developers and every time you do a pull you need to pull down a 100mb file that someone checked in, it can get frustrating pretty quickly. There is no need to check in builds to a repository, that's what build servers are for.
     
  11. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,816
    Android plugins are simply Java plugins that are written and compiled using Eclipse, Android Studio or some other Java IDE. Unity converts your code and project into Java, then links in all the Java plugins included in your Plugins/Android folder, and builds it out.

    The APK is a zip file, if you change the extension to .zip, you can unpack it and see what's in there.
     
  12. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    Ahhh ok, see I'm usually a solo act, haha, and try damn hard to keep my apk under 50mb, but I do get what your saying.
     
  13. Meltdown

    Meltdown

    Joined:
    Oct 13, 2010
    Posts:
    5,816
    Even if you're a a solo act, I still see no reason to ever check your builds into your repository.
    If you want a reference as to a specific point, i.e beta-release-3, just tag your commit. You can then checkout this commit at any time and do a build knowing all was in the beta-release-3 state at that point.
     
  14. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    Your right. I'll have to start doing that on my gitignore. Guess I just never think of my repos as anything but a backup, while there's more to it. I do the same thing on local backups, just rar the whole project folder, builds included.
     
  15. joostbos

    joostbos

    Joined:
    Feb 4, 2015
    Posts:
    63
    The way I install an Android app on my device is build the apk file on the PC, store it in my Unity project folder. Copy the apk file to Google Drive and then open Google Drive on my Android phone and tap on the apk. file. It then installs the app. You do need to set your security settings on the phone to allow installing packages from unknown sources. Since I'm using Google Drive, there is no need to connect the device to the computer.
     
  16. MD_Reptile

    MD_Reptile

    Joined:
    Jan 19, 2012
    Posts:
    2,664
    I sometimes do the same thing, only with dropbox (and the app on the device) and in some cases it usually only cost me an extra minute or two of time between hitting build and installing.