How to install an APK file on an Android phone?

后端 未结 10 1676
梦毁少年i
梦毁少年i 2020-12-12 12:24

I have a simple \"Hello Android\" application on my computer (Eclipse environment), and I have built an APK file. How do I transfer the APK file to my Android phone for test

相关标签:
10条回答
  • 2020-12-12 13:03

    Put the APK file into the tools folder in the Android SDK and give the path to tools in the command prompt and use the command:

    adb install "name".apk file
    
    0 讨论(0)
  • 2020-12-12 13:07

    I was using the command prompt to manually install the .apk file on my device (Nexus 7) but the following should work in theory on any android device (after enabling the device for developer mode). This method was becoming cumbersome so I created a simple batch file so now all I have to do is double-click it and it installs for me (device must be plugged in to my development machine). Just create a text file and save it as .BAT with the following text (customize to accommodate your file paths):

    cd C:\{**path to your install location**}\sdk\platform-tools
    
    adb install C:\{**path to your .apk file**}\{**project/apk file name**}.apk
    
    0 讨论(0)
  • 2020-12-12 13:08

    For debugging:

    • Enable USB debugging on your phone (settings -> applications -> development).
    • Connect your phone to the computer, and make sure you have the correct drivers installed.
    • In Eclipse, run your project as an Android application (right click project -> run as -> Android application).

    Installing the APK file:

    • Export the APK file, make sure you sign it (right click project -> Android tools -> export signed application package).
    • Connect your phone, USB debugging enabled.
    • from the terminal, use ADB to install the APK file (adb install path-to-your-apk-file.apk).
    0 讨论(0)
  • 2020-12-12 13:09

    Directly connect your Android device and select the USB debugging option in the device. Eclipse will itself find your device, and then just run the code.

    Or alternatively, paste your APK file in the Android SDK platform-tools folder and from the command prompt install it like this:

    D:......../platform-tools> adb install yourfile.apk.
    
    0 讨论(0)
提交回复
热议问题