I'm trying to make call for testing purposes in my bluestacks android emulator.
I tired
telnet localhost 5555
but my cmd goes blank after this.
Command prompt after telnet command
Why is it showing blank?
Is there any other way to call to an android emulator.
Edit:
I need to process incoming call in my android application, so I need to generate a fake call.
The application I'm trying to build also require root(Super User) access.
I tried using Android Studio AVD, it can make incoming calls using telnet or ddms but what I want to do requires root permission.
I tried genymotion but the free version doesn't allow calling feature.
So I'm stuck with Bluestacks, it rooted by default & I just need way to generate an actual incoming call just like
gsm call 123456789
Related
I launch an AVD, it doesn't seem to matter which one but I have tried Nexus 4 and with API 18 and 25, and then connect via telnet to send commands. It connects fine, auth is fine, but then a command like "network speed edge" or "network speed full" results in:
KO: unknown command, try 'help'
Ok, fine I can look at the help, but there is no network-related command in the list of available commands:
help
Android console command help:
help|h|? print a list of commands
crash crash the emulator instance
kill kill the emulator instance
quit|exit quit control session
redir manage port redirections
power power related commands
event simulate hardware events
avd control virtual device execution
finger manage emulator fingerprint
geo Geo-location commands
sms SMS related commands
cdma CDMA related commands
gsm GSM related commands
rotate rotate the screen by 90 degrees
Additionally, I'm running the newest Android Studio, completely updated, on Linux Mint 18.1. Other commands like "geo" and "power" work as expected.
The network command is not already neccesary because the android studio provides you a tool bar from where you can change the network type.
It was so easy for me to do it. this tool bar shows up next to the emulator screen.
I just bought a second hand phone and when I connected it to the computer it wasn't recognized (code 43). Since I really like the phone would it be possible for me to install apps I make on android studio another way than with an USB cable ? Like via wifi or something ?
Build your .apk
Download the .apk to the phone
Run the .apk
You can use an app like ES File Explorer, which allow you to access shared files on your network.
http://developer.android.com/tools/help/adb.html#wireless
You can connect to ADB over the network.
sure!, are 2 ways to this, using wifi like you say, 1 is with root and the other is without root.
1.- Root: need a app like "adb over wifi" LINK i use the adb over wifi widget, anyway, the app give you a ip, so, in your pc/lap go to the location of your adb something like "C:\Users\USER\AppData\Local\Android\sdk\platform-tools" using cmd and enter adb connect ipcellphone:port thats all
2.- Without root need a specific app called "ADB Wireless (no-root)" LINK and follow the instructions, BUT need to plug in your cellphone 1 time (first use) but just one time is better than using the cellphone everytime.
see ya!
Could anyone tell me is it possible to test an android application that connects two phones using wifi(or any network connection) with the help of two Emulator instances.
We would like to make an social networking app that uses location services in android.But since I don't have an android phone I would like to know whether we could test the application using two Emulator instances.
Of cause you can connect to devices as many as you have. First you can connect to your phones via USB and run "adb tcpip" to set all the device to restart ADBD on network interface. The you can do "adb connect IpAddressOfEveryDevice". To direct command to specific device, use adb -s IP:PORT command
Is there a way to fake calls for android devices that I have plugged in via usb? Some way to trigger a call using ADB? If so, how do I do it?
I feel like this might be a duplicate question but I can't find a SO question for it. This is the closest question, but it only relates to the emulator.
Here's some things I've tried. I would like to do the reverse of the following command:
adb shell am start -a android.intent.action.CALL tel:1112223333
Just like the other guy said in the question I linked to above. Except I would like to do this on a device, instead of in the emulator. For the work that I am doing the emulator is not sufficient for testing phone calls, I can only run my tests on actual devices. Our "solution" doesn't have emulator support.
So normally I would telnet into the local host using the emulator's port but I can't do that, so can I telnet into a plugged in device? Is there a way for me to fake an incoming call on a plugged in device?
To explain why I would want to do this, I am making modifications to AOSP at this time. At the moment we have not modified the emulator to work with our changes, but we are making modifications to telephony. Eventually getting the emulator to work will be important but at this time it would be ideal if we could test telephony with fake calls using the devices we have access to.
It is entirely possible that this is not even possible but if someone has experience with this I would love to know. I feel like there should be some tests somewhere for faking phone calls on devices before they release a device to the public.
Telnet to your Android device
Alternatively to adb you can also use telnet to connect to the device. This allows you to simulate certain things, e.g. incoming call, change the network connectivity, set your current geocodes, etc. Use "telnet localhost 5554" to connect to your simulated device. To exit the console session, use the quit or exit command.
For example
# connects to device
telnet localhost 5554
# set the power level
power status full
power status charging
# make a call to the device
gsm call 012041293123
# send a sms to the device
sms send 12345 Will be home soon
# set the geo location
geo fix 48 51
I'm trying to figure out how to launch an emulator with no data connection or airplane mode, either one will work. Im testing my application against data loss, however I need this to be atomized. Therefore I'm trying either to launch the emulator with no data via command line, or write bash script to launch emulator, turn data off, then run Unit Test.
RESOLVED - Per Recommendations
#! /usr/bin/expect
set timeout 10
spawn telnet localhost 5554
expect "OK"
send "gsm data off\n"
send "quit\n"
The quick and dirty way to do it could be to make an app that starts at boot and turns data off, then run the emulator and install the app. This does have potential for inconsistency however.
The other thing you can do to leave just the emulator without a network is to telnet into the emulator and turn data off. To automate it, I made a simple (and crude) example using a batch file and vbscript to feed telnet the commands since my work machine is running Windows.
The batch file:
#echo off
emulator -avd YOURAVDNAMEHERE
timeout /t 10
telnet_turn_data_off.vbs
telnet_turn_data_off.vbs:
set oShell=CreateObject("WScript.Shell")
oShell.Run "telnet localhost 5554", 9
WScript.sleep 500
oShell.Sendkeys "gsm data off{ENTER}"
WScript.sleep 500
oShell.Sendkeys "gsm voice off{ENTER}"
WScript.sleep 500
oShell.Sendkeys "quit{ENTER}"
WScript.sleep 500
oShell.Sendkeys "quit{ENTER}"
WScript.sleep 500
If running on Linux or Mac OS, expect should be able to script telnet (as seen by the edit to the question).
It is also worth noting that on older emulators (eg 2.2), turning data off might not do anything. My above example was tested with a 4.2 emulator and it appeared to cut off data properly.
I typically use physical hardware for testing instead of emulators, but if you can't find an option to enable airplane mode you could simply disconnect your computer from the internet before launching the emulator. No internet for your computer = no internet for your emulator.
Use This Following steps..
Go to Eclipse
Window->show view->other->android->Devices
now select your running emulator and Again
Go to,
Window->show view->other->android->Emulator Control
Now in that..set Data to Unregister from Home
From Device and Emulator
In Device or Emulator Go to,
Setting -> Wireless & networks -> Airplane Mode -> ok