15

I'm new to android programming and followed a simple "hello world!" tutorial. It works on the emulator and also on my phone when it is plugged in my computer. However, I have no idea how to install it on my phone. I use Android Studio 0.8.6 and a Samsung Galaxy S4 using Android 4.4.2. I've tried to install the .apk file but when the installing is done, the option "open" is greyed out and the icon does not appear in my menu. Does anyone know how to actually install the app so it can be used without the phone being plugged in the computer?

Sorry if Im doing this wrong, this is my first post. Thanks.

Marty_01
  • 179
  • 1
  • 1
  • 10
  • Just to clarify, are you saying that are trying to install an app on your physical Android device without the use of a USB cable? – Andre Perkins Nov 04 '14 at 00:05
  • 1
    No, I want to run the app like any normal app when touching the icon on my phone. Now the app only works if I press run in android studio and my phone is connected to my computer. If I install it using the apk file, the option "open" is grey and the app won't appear anywhere on my phone after. – Marty_01 Nov 04 '14 at 00:09
  • Hmmm.... That is strange can you post the contents of your AndroidManifest.xml file? – Andre Perkins Nov 04 '14 at 00:12
  • I used this tutorial – Marty_01 Nov 04 '14 at 00:17
  • http://www.codeproject.com/Articles/801078/Hello-Android-The-Hello-World-Application#can_t_run_the_app // I checked manifests and they look the same. – Marty_01 Nov 04 '14 at 00:18
  • Yeah, your manifest file looks fine. I know you said the application runs when you press run in Android studio. Is it safe for me to assume that the app icon appears on your phone, if you were to close the app? – Andre Perkins Nov 04 '14 at 00:25
  • No, Android studio stores it in a map called data\temp so I think my phone removes it as soon as the app is ended. Is there a way to change the folder where the app is stored? – Marty_01 Nov 04 '14 at 00:30

4 Answers4

7

First, you have to export a full .apk for your application correctly, see instructions here, after that you need to somehow download that file to your device. You can upload it on any hosting (email attachment even, for example), I just think that's the simplest way install/run app without plugging your phone.

If something wrong occured when running, please re-check some option below:
- Check your log if any error shown
- Check your .xml files define your application layouts in folder: res/layout

rogerdpack
  • 62,887
  • 36
  • 269
  • 388
Fuong Lee
  • 175
  • 4
  • I used dropbox most of the times will that work as well? And I haven't seen the run proguard option. Either android studio is updated or im doing something wrong. There aren't any problems at all. The app installs nicely, but "open" is grey :S and it appears nowhere, only under settings->more->storage->application – Marty_01 Nov 04 '14 at 00:38
  • The original question was to install apk via Android Studio. Not about what are the other ways to install the app except Android Studio. – BTR Naidu Jun 02 '16 at 14:46
1

If you go to the bin folder you should find the .apk file there. But that .apk file is not capable of being uploaded to market. In order to get a fully working .apk file you should export it as an android project and once that is done you should start off by uninstalling the application from your phone since running it from pc through phone installs the apk there. Once it's uninstalled you can transfer the apk file you exported to your phone and install it.

  • How do you export it? I made a new map as output in generate signed apk wizard and I thought the resulting file is the one that should be uploaded. And the app isnt installed when I run it from my pc and if it is it is removed after I close it for some reason, it doenst appear under settings->more->storage->application – Marty_01 Nov 04 '14 at 00:45
  • So exporting is creating a signed APK? Because that is what I get when I google it. What do I need to do after I exported it? Putting the files on my phone and installing the app won't work. All tutorials I've seen so far make it appear that you only have to press run and the app is installed on your device. Is this true? – Marty_01 Nov 04 '14 at 09:12
  • Download a file manager where you can browse your files in your Android phone. Plug your phone into the computer and drag the .apk to a folder in your phone. Unplug the cable. GO to settings in your android phone and check "Unknown source" to be able to install the apk file. Now go to the file manager and find your .apk file and press it to come to the installer. – andrewjones Nov 04 '14 at 09:29
  • I tried astro file manager and Apk Installer to do that, but when the installation is done it says: V App installed and below Done in white on the lower left of the screen and open next to it is grey – Marty_01 Nov 04 '14 at 09:33
  • What phone do you have? Are you sure that you already haven't installed it? Check app manager in settings and see if it isn't installed already. – andrewjones Nov 04 '14 at 09:42
  • A Samsung Galaxy S4 using Android 4.4.2. And it is installed and I can find it in app manager, it just won't open and won't appear among my other apps. – Marty_01 Nov 04 '14 at 09:45
  • Try on another phone and see if it's the apk or the phone. – andrewjones Nov 04 '14 at 12:41
  • Unfortunately just "grabbing" the .apk in build\outputs\apk isn't enough you have to run the Android Studio command "build -> build apk" to get a full one apparently :\ – rogerdpack Oct 10 '17 at 21:43
0

Enable USB debugging on your device by going to Settings > Developer options.On Android 4.2 and newer, Developer options is hidden by default. To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.

Hope this will work

XB VISIONS
  • 45
  • 7
0

Download PdaNet+ and then connect your mobile phone to PC. Then in Android Studio when you click on run button, you will also get an option to install the android app which you are creating into mobile.

Mohd Talha
  • 17
  • 4