- Home /
How do you test Android deployment ?
Hello,
I've just started small project for android with Unity 4.2. Could you please tell me how do you test the apk file ? I have a problem with the sdk emulator.
When I launch application on the editor, it"s perfect. When I test on android sdk emulator, the application is closed directly (without other message than : "unfortunatly, ...". I have reinstalled the sdk and create multiples adv, with the same result...I'm using Windows 8 64b and Unity 4.2.
Thanks for your help.Answer by Bunny83 · Aug 04, 2013 at 05:43 PM
If you really want to test your APK you have to deploy it on a real device.
This can be done in two ways:
If you have a working USB driver for your device, so the adb interface can work with it, just do a Build and run from Unity
If you don't have the right USB driver or can't get it working you can simply build the apk, put it somewhere your device can access it (dropbox, local file sharing, ...) and use a filemanager on your device to get the apk. In our company we use this one.
Note: You have to allow unsigned apks to be installed on your device. It's an option in your device settings. Also to get the first way working you have to enable the developer options and USB debugging on the device.
The first solution is always the better one since USB debugging also gives you direct access to the device log. However it's sometimes a bit tricky to get it working. On some newer devices they have hidden the developer options and you first have to unlock them by tapping the build number 7 times.
I know this is an old post but this guy is totally right. I hooked up my Galaxy S5 to my laptop and tried for like two hours to get the right drivers. No matter what, when i did "Build and Run" it would say that it couldnt detect any Android devices. Then I tried it on tons of emulators including: Andy roid, nox, bluestacks and android studios. None of them would do more then load a blank screen. I was so mad and didnt know why my apk file wasnt working. Then i went on my gmail on my computer, attached my apk file to it and emailied it to myself. Opened the email and attachment from my android and it was working perfectly in two $$anonymous$$. Easily the best way to do it!
For a handful Samsung devices you have to download the drivers from the Samsung website. Just google your device name and add drivers into the search.
Connecting to your PC might work O$$anonymous$$ though for your Galaxy S5.
Be sure to restart your PC though, drivers get loaded when the PC boots up so installing and then testing isn't enough.
If that doesn't work don't feel like you need to email the AP$$anonymous$$ to yourself if the device you want to test on shows up in the File Explorer. Just drag the AP$$anonymous$$ to your device there and browse for the AP$$anonymous$$ on your device via a File Explorer App.
Answer by voporak5 · Aug 04, 2013 at 05:02 PM
They've got this app called Unity Remote that you can download to your android device. Just run that bad boy with your device plugged into your comp and hit Play. You may have to plug it in, open it up and then close and open Unity back up. Problem is the Frame Rate can suck but nevertheless it's easier than making a build just to test.
Thanks for your reply, I didn't know Unity Remote. I have no device, I will install this on an emulator, and check why I can't install the apk package.
Note that you still play the game in the editor. Unity Remote is just a, well, remote control. You don't really test on your device that way. All you get is all the input the device is providing is routed to the editor.
The only way to really test a build is to copy it onto a real device, but i'm not sure if that's the OPs actual problem. $$anonymous$$aybe he doesn't have an android device?!
The simulator is not really suited for Unity. It's ok for native apps, but Unity requires a lot lowlevel hardware power which the simulator usually can't handle.
Thank you had so many issues spent 3 hours attempting to look up my solution finally reading yours when it said to restart unity I remembered older versions had that issue and as soon as I restarted unity it all worked thank you
Your answer
![](https://koobas.hobune.stream/wayback/20220613111522im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Distribute terrain in zones 3 Answers
Edit PlayerPrefs via Java Project Android? 0 Answers
Can't find android app 1 Answer
Why can I build the apk but I can't build and run? 0 Answers
Unfortunately, "GameName" has stopped. 0 Answers