How to install an APK file on an Android phone?

后端 未结 10 1684
梦毁少年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 12:47

    outside device,we can use :

    adb install file.apk
    

    or adb install -r file.apk

      adb install [-l] [-r] [-s] [--algo  --key  --iv ] 
                                   - push this package file to the device and install it
                                     ('-l' means forward-lock the app)
                                     ('-r' means reinstall the app, keeping its data)
                                     ('-s' means install on SD card instead of internal storage)
                                     ('--algo', '--key', and '--iv' mean the file is encrypted already)
    

    inside devices also, we can use:

    pm install file.apk
    

    or pm install -r file.apk

    pm install: installs a package to the system.  Options:
        -l: install the package with FORWARD_LOCK.
        -r: reinstall an exisiting app, keeping its data.
        -t: allow test .apks to be installed.
        -i: specify the installer package name.
        -s: install package on sdcard.
        -f: install package on internal flash.
        -d: allow version code downgrade.
    

提交回复
热议问题