Installing an apk on android emulator on Mac OS

57,797

Solution 1

  1. Open Terminal
  2. go to android-sdk-mac\platform-tools
  3. type ./adb install myApp.apk

Solution 2

You can work around by:

  1. You have a *.apk file with you if you don't have, download it.
  2. Open Android Studio and Run the emulator.
  3. Open the finder and go to the location which contains your *.apk file.
  4. Drag that *.apk and drop into the emulator and it will ask for confirmation after your confirmation it will install the *.apk in the emulator.
  5. You can find it in application menu once installation succeeds.

Solution 3

First of all, you SHOULD NOT copy APKs to the tools or any other SDK directory. Do not cd to the SDK directories, just add them to the PATH environment var or use their absolute path in command lines. Then, if you want to run the emulator and then execute command from the same terminal, send the process to background (&):

$ export PATH=$PATH:/path/to/sdk/tools:path/to/sdk/platform-tools
$ emulator -avd myEmulator &
$ adb install /path/to/my.apk

Solution 4

You can work around by:

  1. Upload yourapp.apk to internet. I.e: yourhost.com/yourapp.apk
  2. Run emulator
  3. Open internet browser on your emulator, visit link yourhost.com/yourapp.apk
  4. Download and install
Share:
57,797

Related videos on Youtube

TruthOf42
Author by

TruthOf42

Updated on May 05, 2021

Comments

  • TruthOf42
    TruthOf42 about 3 years

    I tried following these steps(from here):

    go to sdk folder, then go to tools.
    copy your apk file inside the tool directory
    ./emulator -avd myEmulator
    to run the emulator on mac 
    ./adb install myApp.apk
    to install app on the emulator
    

    But when I run "./emulator -avd phoneEmulator" (phoneEmulator is the name of my emulator) it just displays:

    Phil-Knights-MacBook-Pro:tools philiplknight$ ./emulator -avd phoneEmulator
    2012-07-30 22:44:33.377 emulator-arm[2859:80b] Warning once: This application, or a
    library it uses, is using NSQuickDrawView, which has been deprecated. 
    Apps should cease use of QuickDraw and move to Quartz.
    

    It's as if that command is never returning.

    If I can't input the 2nd command ./adb install myApp.apk in that window, where do I call it?

  • TruthOf42
    TruthOf42 almost 12 years
    When I do this ("./adb install BarcodeScanner4.2.apk") I get "-bash: ./adb: No such file or directory". Any ideas?
  • TheSteve
    TheSteve almost 12 years
    Did you cd to the location of adb? That message means that bash can't find "./adb"
  • Chris Stratton
    Chris Stratton almost 11 years
    Yes - rather surprising that no one made these points earlier.
  • Petroff
    Petroff over 7 years
    This link is no longer available.
  • Vito Valov
    Vito Valov over 7 years
    Now it's fixed @Petroff
  • devluv
    devluv over 4 years
    This is the best answer.
  • Vikrant Bhat
    Vikrant Bhat about 2 years
    This answer should be at the top