How do you install an APK file in the Android emulator?

前端 未结 30 1705
滥情空心
滥情空心 2020-11-22 14:53

I finally managed to obfuscate my Android application, now I want to test it by installing the APK file and running it on the emulator.

相关标签:
30条回答
  • 2020-11-22 15:24

    Drag and drop ".apk" file into the emulator window.

    0 讨论(0)
  • 2020-11-22 15:27

    In Genymotion just drag and drop the *.apk file in to the emulator and it will automatically installs and runs.

    http://www.genymotion.com/

    0 讨论(0)
  • 2020-11-22 15:28

    go to the android-sdk/tools directory in command prompt and then type

     adb install fileName.apk (Windows)
    
     ./adb install fileName.apk (Linux or Mac)
    
    0 讨论(0)
  • 2020-11-22 15:28

    Download apk file from browser and then just click on it (notification area). Installation will start automatically.

    0 讨论(0)
  • 2020-11-22 15:29

    Nowadays, you can simply drag and drop the Android apk to the emulator and it will automatically starts installing.

    0 讨论(0)
  • 2020-11-22 15:29

    Best way is to create a app, which opens the apk file on the emulator. You have to copy the .apk file to the download folder of your emulator. Then replace yourAppName.apk with your .apk name.

    here is the code

    public class MainActivity extends Activity {
    
        @Override
        protected void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
            setContentView(R.layout.activity_main);
    
    
    
            Intent intent = new Intent(Intent.ACTION_VIEW);
            intent.setDataAndType(Uri.fromFile(new File(Environment.getExternalStorageDirectory() + "/download/" + "yourAppName.apk")), "application/vnd.android.package-archive");
            intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            startActivity(intent);
    
    
        }
    }
    
    0 讨论(0)
提交回复
热议问题