Running multiple Android emulators with different phone numbers

first time here.

I am working on a client server Android application and trying to understand how to uniquely identify different phones / users on the server. My first attempt was to use the phone number on the SIM card. Although now, when I think about it, how common these days is to change your phone number when you, for example. change carrier? I think it depends on the country and country.

In any case, I tried to understand, since I do not have real Android phones, how to change the phone number of the emulator phone to simulate different users. Is it possible, or should I just think of alternative identification methods?

+6
android emulation
source share
3 answers

android_id should uniquely identify the device, however, it was noted that the identifier can be changed if you know how Spoofing android_id

 import android.provider.Settings.System; String android_id = System.getString(this.getContentResolver(), System.ANDROID_ID); 

In the emulator, android_id does not matter, so you will need to put a debugging procedure to assign the value yourself.

However, if you want to identify the user and allow the user to access your service from different devices with the same user ID, you better assign them a user ID and authenticate them for your service using this user ID as their credentials. This will allow them use your identifier on different devices, if you did not use it in combination with android_id (and android_id not tampered with), then you can limit them to one device.

+5
source share

You must use the number present in the emulator. For example. usually the first emulator that works is 5554, the second is 5555, etc.

You can use these numbers to make calls, send text messages from the emulator to the emulator. This, I think, simulates different numbers / users for your purposes.

+3
source share

The SIM card information is hard-coded into the binary files of the emulator and the x86 emulator. Changing your phone number (MSISDN) is detailed at the end of this blog post: new link , web archive

A SIM card stores a phone number with each two-digit change. So (first 7 phone numbers) 1555521 becomes 515525%d1 in binary format. Although a little tedious, fixing it for each test is not the end of the world. You can also use sed:

 cd path/to/android-sdk-linux/tools/ cp emulator-arm emulator-arm.backup sed -i 's/515525%d1/816745%d3/g' emulator-arm 

This will change the number to 1-876-543- [PORT NUMBER]. Details on why in a related blog post.

+1
source share

All Articles