0

I have a client application that should be installed on a couple of android emulators.

My server application requires these clients to introduce themselves with their unique ID upon connecting to the server.

So, Can I compile a single .apk file and when installing it on different emulators(using adb -s xxx install yyy.apk) give them an id using an argument?

I have something similar to this in mind: adb -s xxx install yyy.apk -iii id-of-this-client

I value your comments and suggestions.

rahman
  • 4,820
  • 16
  • 52
  • 86

1 Answers1

2

I don't remember there is any option like this.

Your apk should get or generate the ID by itself at run time.

And the official Android way to do this is to use the AndroidID of each device.

Please refer to the related post here Is there a unique Android device ID?

Community
  • 1
  • 1
Robin
  • 10,052
  • 6
  • 31
  • 52
  • I am not sure about this since it depends on which method you have chosen to generate your ID. And of course the phone related method won't work for the emulators. As you can see from the related thread, there are several approaches to generate the unique IDs. You can choose one that best suits your requirement. – Robin Sep 02 '13 at 10:40
  • I had a look. Do you think something like this is ok: `emulator -avd jbx86 -prop emu.uuid=5ec33f90-a471-11e2-9e96-0800200c9a66` – rahman Sep 02 '13 at 10:54
  • Uhh, that is a trick play. I haven't thought that way. But I think this should be OK as long as you can get this uuid information in your application. – Robin Sep 02 '13 at 11:03