1

When i just run my program through eclipse on my device it gets installed (since i can open it again from my apps browser). However i cannot find the .APK anywhere. Is there a way to pre determine where my .APK goes? Otherwise how can i find the folder of an app from the app browser (using galaxy s4)?

I have tried searching for files using the ES file explorer app without results.

Madmenyo
  • 8,389
  • 7
  • 52
  • 99

3 Answers3

3

In your Eclipse, it will be under the /bin folder.
In your device, your app will be in /data/app folder.

Does Android keep the .apk files? if so where?

Try this code in your app:

public class Testing extends Activity {
    private static final String TAG = "TEST";
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        File appsDir = new File("/data/app");

        String[] files = appsDir.list();

        for (int i = 0 ; i < files.length ; i++ ) {
            Log.d(TAG, "File: "+files[i]);

        }
    }
Community
  • 1
  • 1
An SO User
  • 24,612
  • 35
  • 133
  • 221
  • @MennoGouw the folder is a protected folder. You wont see the content. – An SO User Aug 23 '14 at 14:29
  • Cannot get this to run, it does not recognize "Bundle" and "Activity" and i cannot import this either. The post you linked to is more then 4 years old. – Madmenyo Aug 23 '14 at 14:47
  • @MennoGouw Basics of the OS are not going to change. I do not know why you cannot import. Have you installed the SDK properly? – An SO User Aug 23 '14 at 14:49
  • Using LibGDX i do not have direct access to the android sdk. – Madmenyo Aug 23 '14 at 14:51
  • I havent used LibGDX so I cannot comment. :/ – An SO User Aug 23 '14 at 14:52
  • Well it is probably possible to add direct access to the android SDK but i'm afraid of breaking things again. I just find it weird that there is an app on my phone and i have no way to locate it. It would help if google made android more transparent. – Madmenyo Aug 23 '14 at 14:54
  • @MennoGouw add the given code to your Android project. You can use Android code in the Android backend for any Libgdx project. Android does not, by default, let users see much of the content on the device, so Little Child is likely still completely correct. – P.T. Aug 23 '14 at 20:41
0

Its in /bin/ directory in your project path

Mohammad Ersan
  • 12,304
  • 8
  • 54
  • 77
  • Yeah but where is it on my device? Since i can run at when detached from computer and restarted it should be somewhere on my device... – Madmenyo Aug 23 '14 at 14:28
  • @MennoGouw Android system installs APK files into `/data/app` directory, but you can't browse this directory, you need a rooted device to list files under. – Mohammad Ersan Aug 23 '14 at 14:33
  • Then why is mine not there? I run it from eclipse, no publishing just running using my connected phone as the device. – Madmenyo Aug 23 '14 at 14:34
  • Where it should be as stated by you. /data/app/ – Madmenyo Aug 23 '14 at 14:35
  • when you run the apk from eclipse, the adt compiles the classes into apk file, and store it on your computer into /bin directory in your project path. – Mohammad Ersan Aug 23 '14 at 14:37
  • but the mobile device install it to `/data/app` and this directory is not accessible since its protected directory, you need a rooted device to show the list of content of this directory!! – Mohammad Ersan Aug 23 '14 at 14:38
  • That is great, now to the question. Where does my device store it when i run it trough Eclipse. Since i can still run it after i disconnected my device and restarted. Even when i am out of range of my wifi network and disabled mobile data. – Madmenyo Aug 23 '14 at 14:39
  • :\ I've told you, its in /data/app and you can't read the directory from your computer or your phone file explorer apps... – Mohammad Ersan Aug 23 '14 at 15:59
-1

It is in your bin folder bin/appname.apk

Hasnain
  • 274
  • 2
  • 14