Android Emulator : cannot run commands from PuTTY - android

I'm new in Android development. I'm trying to connect via PuTTY to Android Emulator with telnet ( in order to emulate events - sms send , location change etc) After I created session on PuTTY and connected , any command I entered - seems no effect :
Android Console: type 'help' for a list of commands
OK
help
<no output after help>
I'm running emulator from IntelliJ IDEA 14.0.2. What are the settings on PuTTY connection to be set/checked ?
Any information will be helpful . Thanks in advance

I had the same issue, and the fix for me was in the Connection >> Telnet settings. When I had the Telnet negotiation mode set to Active I had the same problem you are seeing. Try setting the mode to Passive.
That is what fixed it for me.

Related

Android Studio telnet console missing "network" and "window" command?

I'm trying to play around with connecting to an Android emulator through telnet, following the guidance of this page: https://developer.android.com/studio/run/emulator-console.html
I successfully connected to localhost:5554, authenticated with the token found in /Users/me/.emulator_console_auth_token, and got a list of available commands:
$ telnet localhost 5554
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Android Console: Authentication required
Android Console: type 'auth <auth_token>' to authenticate
Android Console: you can find your <auth_token> in
'/Users/me/.emulator_console_auth_token'
OK
auth 123456789XYZ
Android Console: type 'help' for a list of commands
OK
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
However, I noticed that network, window and vm commands mentioned in that page are not in this list. How do I get to run those commands?
Thank you very much in advance!
Matt
this option is available while running the emulator in android studio 2.3.1

How to launch 'telnet' console in Android Studio device Emulator?

I was watching a video where the instructor is using a console to type in commands that lead straight to the Emulated Android device. I have the emulated device functioning and I am using Android Studio, but I cannot seem to figure out where he starts the console from. Any ideas?
NOTE: The video is not public so I cannot link it.
I found a solution to my problem. TelNet needs to be enabled in Windows, before you can use it. It is disabled by default I believe. This site has step-by-step instructions for enabling it (it works for all versions of Windows - Vista - 7 - 8 - 8.1). Once TelNet CLIENT is enabled:
Go to -- C:\Program Files (x86)\Android\android-sdk\tools
SHIFT + RIGHT CLICK on an empty space
Click 'Open Command Window Here'
Type in 'telnet localhost 5554' (port of emulated device)
Now you should be connected to the Emulated Android device through TelNet.
On Windows 10
In Ask me anything type Cmd
Then Right mouse button on Command Prompt and Run as Administrator
Execute this command dism /online /Enable-Feature /FeatureName:TelnetClient you should get following:
Then type in following cd C:\Program Files (x86)\Android\android-sdk\tools
Then type in telnet localhost 5554 You should get this:
If not I have failed you....
Hope this saves you some time.
There is another way to do this, which might be a little quicker:
Enable telnet client on your computer
On Android Studio, click the Terminal tab located at the bottom of android studio
Type: 'telnet localhost 5554' and you should be connected
If you are windows user follow this step
go to control panel
go to programs and features
click on "turn windows feature on or off" a prompt box will be appear()
mark the checkbox of Telnet Client
open command prompt and type "telnet localhost port_number" (see cmd image) after this connection will be establish
try out various command like send sms port_number hello, geo fix 14 5 etc

Debugging android device over the Internet

I am looking for a way to debug a device remotely over the Internet.
I am getting a lot of bug reports from my users which I can't even reproduce. It would be easy to solve them if I could debug the device over the Internet as if it were connected to my PC.
Is this possible?
I heard about debugging over wifi in local network, maybe there is similar way to achieve it over the Internet?
It is possible to setup Android device for debugging over Internet, however it requires USB connection to enable it or root access on the device. In addition to that you will have to setup port forwarding to device to accept incoming ADB connections from the the Internet. It hardly can help unless users of your app are developers with great desire to cooperate.
You can find detailed instructions here:
http://www.cleansoft.lv/debugging-android-applications-remotely/
Steps to Follow:
First In Android Settings Application go to About Device option.
Click 9 times on Build Number option, so that you can unlock Developer Options setting.
Now In you Setting's Application, you will have Developer Options enabled, go and click on it.
set following options on : Stay Awake, USB Debugging and if you have Internet Adb option in menu set that also enabled if not then dont worry continue the steps.
Now open your Android Studio and the application you want to run on the android device.
In Android Studio, at bottom click on Terminal tab, Terminal window opens.
Now through your terminal go to the directory where your Android SDK is stored
In SDK directory go to platform-tools directory.
Now if you list the files in the platform-tools you will see adb there.
Running following Commands.
as an example.
adb connect <ip-address-of-your-device>:5555
as an example:
adb connect 10.10.0.21:5555
The terminal should show something like below
adb server is out of date. killing...
*daemon started successfully*
connected to 10.10.0.21:5555
Now run shell command
adb shell
you will get the prompt something like this, i my case i used android x86 device for debugging.
shell#x86_64:/$
Now if you go to the task bar in the android studio and click on Run options and then Run'app' you will be able to see the device as your Deployment Target.
Hope it helps !
You can use Crashlytics in your app.. It helps you to get the detailed crash logs. Whenever an app crashes, it will send you the detailed crash report, from which you can figure out what is happening at the client side.
Get more info about adding crashlytics to the app from here.
Send this new app to the client so can have workaround:
You can also use adb via tcp ip:
adb connect ip:port
Use a remote access (teamviewer or droid apk) to enable debugging in android developer tools.
In the router where the android is connected remember to create port forwards to the android ip.
In your machine with adb installed do:
adb connect public_ip:port
After being connected, you can do:
adb logcat
or
adb shell
Or any adb command you want to.
try Debugging Firefox for Android over Wifi it's working with me
https://developer.mozilla.org/en-US/docs/Tools/Remote_Debugging/Debugging_Firefox_for_Android_over_Wifi

How can I make eclipse connect to Android emulator manually?

There are lots of times Eclipse can't connect to emulator that I turned on from AVD Manager, and just starts a new emulator by itself,( two emulators are the same ):((. How can I make eclipse find the emulator ?
some times restarting adb solves your problem
adb kill-server
adb start-server
for working easier in command line in windows, add the path of adb.exe to that Windows' path. For example add ";C:\Program Files\Android\android-sdk\platform-tools" to System Properties-> Advanced-> Environment Variables-> System Variables-> Path
One of the reasons of problems in device connection is a long USB cable or a two-piece cables like keyboard USB. try to connect your device to PC directly by a short cable.
I guess that you might suffer from the issue that the manually started emulator got disconnected somehow, shown with a message like
Error: emulator-5554 disconnected
in the Eclipse console view. There are several related questions and answers on stackoverflow like Why do I get a emulator-5554 disconnected message,
but for me none of those answers helped.
Whenever I see the error message for disconnection occur, I just shutdown that emulator and start it again. Normally that already "fixes" the problem, it just works on the next attempt (for me).
I was just experiencing this issue also. I agree with breceivemail, the ADB reconnected to the emulated device after reset, but there is a shortcut using Eclipse:
In the DDMS view => Devices window => View Menu (the down triangle in the header) => reset adb
You can choose the target device manually by changing the run configurations.
Run -> Run configurations -> choose your App -> Target tab -> select "Always promt to pick device"
If your device isn't available you will at least don't start a new Emulator.
If the emulator is still active, you can use adb to connect to it via tcp. In this way you can connect a disconnected emulator to your development system's loopback one port higher, just like if you are using emulator-5554, you can connect to it by using a higher port.
adb connect localhost:5555
There was been an issue with this technique, where the emulator control becomes inactive, and the developer cannot send GPS coordinates or SMSs or calls to emulator.
There is a one click method to do this
Open notepad
Type the below code
#echo off
adb connect localhost:5555
Save the file as your_file_name.BAT
Copy the file to Android SDK/platform_tools
Create a shortcut, give it a custom icon, use it anywhere you like
Open the DDMS view from Eclipse, and simply click on the emulator name you want connect to in 'Emulator' tab.

I'm not able to connect to internet on Android Emulator, I'm using Tata Photon+(2g Mobile Broadband) device

I'm not able to connect to internet on Android Emulator, I'm using Tata Photon+ device.
I've disabled my all other connection like Lan and Wifi...
Removed all other settings like other mobile, and other device dial-up settings.
Please help me, how to connect to internet using android emulator.
My Emulator shows the 3g and signal icons correctly, there is no cross mark on it.
This might be because the emulator is not able to resolve the DNS
Either start the emulator from command prompt like this -
$:\Android\tools>emulator -avd -dns-server 8.8.8.8
You should see a message like this - DNS server name '8.8.8.8' resolved to 8.8.8.8:55
OR
In eclipse Run Configuration -> Select your application from LHS -> Targets tab on RHS -> Additional command line options textbox give -dns-server 8.8.8.8

Categories

Resources