Search code examples
androidadbdual-sim

Making a call from a dual sim android device using adb


I am trying to make a call from a specific sim on a dual sim phone (SIM 0 and SIM 1) using adb and I can't figure out how to direct the call to that particular sim slot. So far, I have tried making a call using the following command:

adb shell am start -a android.intent.action.CALL -d tel:XXXXXXXXXX

This works fine, but it always calls using SIM 0.

I tried using radiooptions as:

adb shell radiooptions

but it turns out, radiooptions is not supported on this particular device.

/system/bin/sh: radiooptions: not found

I did try it on another device, which is not dual sim, and radiooptions seems to work on that. That was the whole reason I was trying out radiooptions in the first place because it has a very clear cut implementation for selecting specific sim cards.

Anyways, I found the following questions for dual sim android phones, but they are not adb based. they are all Java questions.

Make call using a specified SIM in a Dual SIM Device

Call from second sim

They seem to help and give some clues as to how it can be done,especially this one:

SO Answer for changing SIM

This is very close to what I need, but I don't know how to convert this into a command prompt friendly code.

The method "intent" used in the above links has a documentation here:

https://developer.android.com/reference/android/content/Intent.html

Multi sim android official documentation: https://developer.android.com/about/versions/android-5.1.html#multisim

Any help is greatly appreciated.


Solution

  • SIM Card is just a container. The name of the entity being used by the phone to register with the network and to make calls is SubscriberID. A single SIM Card may contain multiple SubscriberIDs.

    So instead of asking how to make a call from another SIM Card you should be asking how to make a call using SubscriberID other than the default one - whether this other SubscriberID is stored on the same or another SIM Card is mostly irrelevant.

    I do not know if there is a way to specify a different SubscriberID for a single call. But you should be fine with setting a new default SubscriberID before the call and then reverting it back afterwards.

    To find out the current ID value run:

    adb shell settings get global multi_sim_voice_call
    

    Then change the active Subscriber via UI and run the command again to get another ID.

    Use this command to switch to the appropriate ID before calling:

    adb shell settings put global multi_sim_voice_call <ID>
    

    To change data call settings - use multi_sim_data_call instead of multi_sim_voice_call.