banner



How To Install An App Using Adb

This article will tell you how to use ADB ( Android Debug Bridge) to install or uninstall apk file on android devices. You can read the article How To Use Android Debug Span (ADB) to learn more if yous do not know well-nigh android ADB.

1. Apply ADB To Install Android Apps Apk File.

1.1 Push app apk file to android device.

//Push to organisation app folder adb push instance.apk /arrangement/app.  //Button to user app folder adb push case.apk /data/app.

This method has beneath disadvantages.

  1. Maybe overwrite the original app, so you had better apply below command to backup the original app before operation.
    // Pull android apk from device to local binder. adb pull /system/app/instance.apk    /user/app_bak
  2. Usually, y'all tin encounter below error letters.
    failed to copy '/user/example.apk' to '/system/app/instance.apk': Read-only file system.              

    This is bacause /system/app binder is read-but, you can not push files into this folder.

    To resolve this problem, you demand to use adb install command with -r option to forcefulness install the apk files, we will introduce it below.

    // -r ways force install. adb install -r /user/case.apk              

    Above adb install apk file command volition install the apk file into /data/local/tmp/ directory.

1.2 Use adb install command.

  1. Startup android emulator.
  2. Run adb install apk file command every bit below to push android app into emulator /data/app directory.
    adb install C:/work/example.apk              
  3. Click the android app icon to run it on the android emulator screen.

2. Use ADB To Uninstall Android Apps Apk File.

2.1 Use ADB Uninstall App Apk File Command.

You tin find the android app package name use android device monitor. The package name is located in /information/information folder.
You can refer article Android Device Monitor Cannot Open up Data Binder Resolve Method to learn how to use android device monitor.

// Below command will return all the android app packages installed on the connected android device.   adb shell pm listing packages -f -3  // uninstall android app past app parcel name. adb uninstall <app package proper noun>          
> adb uninstall com.dev2qa.instance Success

2.2 Utilise ADB Shell Command.

> adb shell  generic_x86:/ # cd /data/app generic_x86:/data/app # rm com.dev2qa.example.apk          

three. Uninstall Android App In Emulator.

You tin besides use android emulator to uninstall installed android apps.

  1. Click Settings —> Apps.
    uninstall-android-app-click-settings-apps
  2. Click the android app that you lot want to uninstall in app listing.
    android-app-list
  3. Click uninstall button in app info panel.
    click-uninstall-button-in-app-info-panel

4. How To Uninstall Android Apps Automatically Earlier Run / Debug Android App In Android Studio.

  1. Click Run / Debug —> Edit Configurations ( for Windows ) menu item at android studio pinnacle menu bar to open the Edit Configurations window.
  2. If you run android studio on macOS, click Run —> Run / Debug card item, then it will popup a dialog, click Edit Configurations card item in the popup dialog to open up the Edit Configurations window.
    open edit configurations window in android studio macos version
  3. Select the android app in the popup window left side Android Awarding section.
  4. Go to the Before launch area on right-bottom of the popup window, click the + button then select Run External Tool from the dropdown list.
    android studio - edit run configuration - select android app - general tab - before launch - run external tool
  5. Above action volition popup another External Tools management dialog, click the + push at bottom of the popup dialog to add an external tool.
    android studio - run configuration - before launch - list external tools dialog
  6. In the adjacent popup window, input related data to run the external tool. For example, Name : Uninstall App Before Launch, Group : External Tools, Description :  It will uninstall android app before launch android app, Program : adb ( or the adb control absolute path if you do non fix the path in arrangement environment variable ), Arguments : uninstall app_package_name, etc.
    android studio - run configuration - before launch - edit external tool
  7. Click OK button to salvage above configuration, and check the External Tool ( Uninstall App Before Launch ) in the External Tools list dialog.
    android studio - run configuration - before launch - list external tools dialog
  8. At present the adb uninstall command will be executed every time yous start to run the app in android studio.

Source: https://www.dev2qa.com/android-adb-install-uninstall-app-examples/

Posted by: thaxtonationvin.blogspot.com

0 Response to "How To Install An App Using Adb"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel