1

When trying to run my program on an emulator I get this error:

Device connected: emulator-5554

Device is online: emulator-5554

Target device: avd1 [emulator-5554]
Uploading file

local path: C:\Users\peter\AndroidStudioProjects\MyApplicationProject\MyApplication\build\apk\MyApplication-debug-unaligned.apk

remote path: /data/local/tmp/com.bat.myapplication
Installing com.bat.myapplication

DEVICE SHELL COMMAND: pm install -r "/data/local/tmp/com.bat.myapplication"


Error: Could not access the Package Manager.  Is the system running?

any ideas? my paths, javahome etc, seem right....

Michael Yaworski
  • 13,410
  • 19
  • 69
  • 97
  • 1
    thx for response, link - hadn't found it. –  Dec 21 '13 at 18:16
  • possible duplicate of [could not access the package manager. is the system running while installing android application](http://stackoverflow.com/questions/15524185/could-not-access-the-package-manager-is-the-system-running-while-installing-and) – Jim G. Dec 26 '13 at 06:59

3 Answers3

3

Just wait until emulator be loaded completely, once it finished then you could simply run your application.

Owen
  • 31
  • 2
1

I had the same issue once. First run only the emulator (it takes several minutes), and once it's loaded (the UI will change), then you run your program.

elixenide
  • 44,308
  • 16
  • 74
  • 100
Franco Aguilera
  • 617
  • 1
  • 8
  • 25
0

As other have said, this error occurs because the emulator is still in the process of launching. An attempt to access the package manager, for the device, at this time causes an error.

It's just a simple timing issue. Here are the steps to avoid this error:

  1. Wait until the emulator 'lock screen' is showing.
  2. Run the 'app' again (^R in most IDE's).
  3. Choose the running device (Should be the same emulator).

App should install without error.

Saeed Gatson
  • 517
  • 5
  • 18