Installing an apk on android emulator on Mac OS
Asked Answered
H

9

30

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:

My-MacBook-Pro:tools myName$ ./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?

Homogenesis answered 31/7, 2012 at 2:56 Comment(0)
R
30
  1. Open Terminal
  2. go to android-sdk-mac\platform-tools
  3. type ./adb install myApp.apk
Richart answered 15/5, 2013 at 12:25 Comment(0)
C
30

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.
Columella answered 10/3, 2018 at 19:7 Comment(3)
This is the best answer.Appleby
This answer should be at the topAffiant
Of course, it was drag and drop, it's a mac... Silly me...Salerno
T
20

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
Trollop answered 15/6, 2013 at 2:49 Comment(1)
Yes - rather surprising that no one made these points earlier.Ignace
F
5

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
Fibrosis answered 24/6, 2013 at 6:55 Comment(0)
P
0

adb can be run from a seperate terminal once this emulator boots up.

Pigweed answered 31/7, 2012 at 2:59 Comment(2)
When I do this ("./adb install BarcodeScanner4.2.apk") I get "-bash: ./adb: No such file or directory". Any ideas?Homogenesis
Did you cd to the location of adb? That message means that bash can't find "./adb"Pigweed
A
0

May Be, Useful to all the command in MAC OS Terminal

Alit answered 31/7, 2012 at 5:8 Comment(0)
P
0

Am I the only one whose apps install in the emulator when I run them as Android Application from eclipse?

I mean - why go though the trouble of adb when you could just use eclipse? (unless you have something against eclipse!)

Photoreceptor answered 5/3, 2014 at 21:47 Comment(0)
S
0

Try this app. It will install the apk by just double clicking on it after you create an association to .apk files. It's all explained in the github source.

Seanseana answered 13/4, 2015 at 23:38 Comment(2)
This link is no longer available.Applicable
Now it's fixed @ApplicableSeanseana
D
0

Alternatively You can use 'adb install' command as follows. "adbinstall/filename.apk" ex. adb install /Users/manojclinberg/Downloads/ad3e0e46-d716-4fa9-b603-b8db3accf260.apk

Damick answered 19/9, 2022 at 20:37 Comment(0)

© 2022 - 2025 — McMap. All rights reserved.