Running android project on device from eclim - android

I want to use ECLIM plugin for VIM during android development.
The main problem : I can't run my project from eclim, so I can't see logs and errors.
I know such command :
:Ant debug install
This command compiles and updates my project to connected device. I have to run it manually.
I'm not lazy, and is not problem to run it.
But I wish to see runtime's Logs.:)

open a terminal,and input adb logcat,then you can see the log.
have a try :)

If you want to see it exclusively within vim then :!adb logcat will display the logs.

Use this in vim:
:!ant debug install && adb shell am start -n your.package.name/.YourActivityName
That will fire up the app in your device. For logging I just want to complement that if you log in your app use a tag and filter the log by a tag like so: adb logcat -s "tagname"

Related

"Wait for Debugger" Android Studio

I am using a guide to Decompile and Debug an APK but I can not pass the last step. Where when trying to Debug APK on my phone from Android Studio, an error appears: "Wait for Debugger". According to the guide I must execute the code:
adb forward tcp:5005 jdwp:$(timeout 0.5 adb jdwp | tail -n 1)
But since I do not have Linux (I have windows), I do not know what code I should execute. Thank you very much for your help!
Guide: https://malacupa.com/2018/11/11/debug-decompiled-smali-code-in-android-studio-3.2.html
First make sure you have adb in your path.
Then open a cmd.exe and run this command:
adb jdwp
and take note where application’s debug interface is listening. I'll call this value jdwp-port from now on.
Now execute the following command:
adb forward tcp:5005 jdwp:jdwp-port
and you should be fine. REMEMBER to change jdwp-port with the value you got from the first command.
Good luck.
But since I do not have Linus (I have windows)
It is actually called Linux anyway.
As a side note, you should check the official AOSP documentation on how to use GDB here: https://source.android.com/devices/tech/debug/gdb

React Native app: cannot connect to dev server, but the simulator is running - why?

The image describes my current situation properly. Please have a look at it first.
I am running my app on React Native. I have Android simulator on. I give the command to start the app. The app build finishes, but it says that virtual device not found, and in my simulator, if I open the app manually, it says that it cannot connect to Development server. It shows some issues.
Can anyone help?
Try run react-native run-android to connect your app to the emulator
Check USB Debugging is on(mostly running on virtual devices)
Check how you created project(react-native-cli or Expo) and run relevant app run command
Make sure your development server(node.js) is running when you run app. Sometimes it crashes then you have to again run command to run app
If all the step does not solve your issue try to uninstall app from device and run app again. Since react-native is still developing and its wired sometime these tricks works
I was having the same issue in Ubuntu 16.04. In my case the problem was that node packager wasn't running.
To check is packager is running easily you can open the browser and enter
http://localhost:8081/
You must see "React Native packager is running."
If you dont, then you can start packager from console running
react-native start
If you get an error like
" ERROR watch /your/project/path/android/app/build/intermediates/incremental/mergeDebugResources/merged.dir/values-ru ENOSPC"
Then run first
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p
Then run react-native start again and press the letter R twice in the emulator to reload.
Looking at the screenshot, seems like you don't have adb installed because there is a clear 'adb: not found error'.
Luckily Android studio ships with adb and is present in platform-tools under your Android SDK. (generally in /home/your-user-name/Android/Sdk/)
You only need to use it. Create a symbolic link in '/usr/bin/' or '/usr/local/bin/' depending how you'd like to use it.
Run the command:
sudo ln -s ~/Android/Sdk/platform-tools/adb /usr/local/bin/
After this run the app.

Android: The right way to debug an running application (runtime errors/log)

I am new to Android development. I have been going through the tutorials.
I would like to know which is the right way to debug / log an application during its execution. I am guessing I should be able to execute my application directly on my android device and be able to view a log or so to catch runtime errors and logs?
How could I accomplish this ?
I am using this to install the application on my phone
adb install <path to apk>
p.s. I am sure this question might seem like something I should already know. But I could not figure it out :) Hence I am here :)
You can build on the command line with ant. See this guide.
& install it by using adb on the command line.
adb install MyApp.apk
path of apk with file extension
update
for getting logcat or crash report
do this way:
adb logcat
note: make sure only one device is connected to adb bridge
for filtering:
check this & this.

ADB command-line options when debugging from Eclipse?

I am using Eclipse to debug an Android application on a device. I would like to keep the application data between debug sessions. I should be able to do this from the command line with something like this:
adb uninstall -k com.package.myprogram
adb install -r MyProgram.apk
But then, I have to debug on the command-line -- Eclipse is much nicer! Is there anyway to set these options for when I am debugging with Eclipse?? Or somehow set these options through an ADB shell, but then still use Eclipse for catching Breakpoints?
Eclipse does not do any black magic! for all matters ends up accessing adb.exe to talk to the device. by just typing adb on your command line, you will get host of options with which you can do a lot of things. Apart from adb, there are other tools too which can help debug. Research a bit on which suits you best.
Just create a launch configuration for your Android project in Eclipse (in the Run menu). If you modify your application code and run the launch configuration again, Eclipse will install the new version of your application on the device without touching any of its data. There is absolutely no need to uninstall the old version first.

How to run android application without eclipse plugin?

I m using console tools to build my android application. To do it, I use:
ant debug
adb install bin/MyApp.apk
and then I have to choose an aplication from menu in emulator. Is it possible to run already installed application in emulator with console command?
I think you can use the am option in adb. I will try and find it in the manual if I have time, but maybe this will be enough for you to start?
This looks like a good start with some examples on how to start stuff from the commandline:
http://www.anddev.org/using_the_am-tool_start_activities-intens_from_a_shell-t368.html
You can start a specific activity like this:
adb shell am start <INTENT>
To find out how to pass the intent, type adb shell am

Categories

Resources