I can run my app but cannot debug it via android studio - java

In my test project, I can run my application but cannot debug it, when I run my app the apply changes and restart activity button and apply code changes are disabled and report app not detected.
And in the application window it shows a dialog with below message
application .... is waiting for the debugger to attach.
I tried following:
select app to be debugged
android:debuggable="true" in manifest
In build
debug
{
debuggable true
}
tried adb kill server and restart it
Issue snapshot

You can use
Attach Debugger to Android Process

Related

Opening app on macOS 11 Big Sur from JavaFX application randomly fails with kLSNoExecutableErr

We have a desktop JavaFX application (well, TornadoFX) that downloads an archive, extracts another app from it and launches this app with macOS open command.
Simplified kotlin code looks like:
ProcessBuilder(listOf("open", "/path/to/app.app", "arg")).start()
This has worked for years on older versions of macOS (10.15 and earlier) but now with macOS 11 Big Sur launching the app sometimes succeeds and sometimes fails.
In the mac Console.app following error can be seen:
OSStatus _LSCopyApplicationNodeFromOpenState(LSOpenState *): Returning kLSNoExecutableErr because node is a directory but we failed to register with error -10814
We extended the logic to check if all the files are really there before launching the app, and the files existed.
There is an assumption that maybe Launch Services database is not updated fast enough.
Following ways of trying to log what might be happening, didn't reveal any errors:
lsappinfo listen +all forever
log stream --debug --predicate 'subsystem == "com.apple.coreservices.launchservices"'
Does anybody have a clue if there is a way to avoid this behavior and to be always able to launch the app?
After a lot of research and debugging, what seem to have worked for us, was to force Launch Services to register the app in its database by executing command like:
/System/Library/Frameworks/CoreServices.framework/Frameworks/LaunchServices.framework/Support/lsregister -f /path/to/app.app
and afterwards we could launch the app.
The idea for such solution was found in this answer.

Catch external jar stop event for Spring-boot application with Intellij Idea

to launch my Spring Boot application in production environment my company has a system that executes "java -jar" and I'm trying to simultate it in my Intellij idea and jar starts correctly and I can debug with proyect source too.
In run and debug mode, when I click in stop button the jar is stopped suddenly with the message:
Disconnected from the target VM, address: '127.0.0.1:58575', transport: 'socket'
Process finished with exit code -1
And I canĀ“t catch the close event to close my DB connections. I've tryed other stackoverflow solutions like PortalServiceLifeCycle, #PreDestroy and setRegisterShutdownHook(false) in SpringApplication run in main.
Jar is created by Maven with clean and package goals and we haven't xml spring configurations, only annotations.
What I need to catch shutdown service to close connections?
Edit: Add my Intellij buttons:
Thank you.
Please check this answer.
This feature is not available in Debug mode yet.
This feature is also not available for JAR run configuration, but is available for Application run configuration.
You can use remote debug and Ctrl+C in the external console to debug the code in the shutdown hooks until IDEA-171093 is implemented.

no show UI content for android after launching inspector in appium

I use the eclipse mars2 and appium 1.5.3 in mac 10.12 .
I have already configured in appium (android settings,iOS setting,general setting,developer setting).
I have configured app path,waith fo package,package,launch activity,platform nam,device name,platform version,automation name in adroid setting.
I have already changed server address(127.0.0.1) and port 4723 in general setting.
I have already checked enabled and custom server flag and enter input : --native-instuments-lib.
I use the emulator (CPU/ABI) ARM(armeabi-v7a).
I use the device Nexus5.
For my app,that emulator ARM can be run.
I have also configured in eclipse (install sdk,add ADT plugin,create emulator).
I use the android API Level 23 and android 6.0.
I can launch the inspector in appium.
But when I launch the inspector,application can run in emulator but not show UI in appium.
Try to update your appium version.
In some cases, the outdated version of appium could be the problem.

Eclipse - Android - Cannot debug

I don't have any problems with running my application, but when I want to debug it's not starting Acticity and I'm not in debug mode.
Uploading TatryAR.apk onto device 'emulator-5554'
Installing TatryAR.apk...
Success!
Starting activity com.TatryAR.main.MainActivity on device emulator-5554
and that's all - nothing starts.
I can click apk and it works, but not in debug mode.
I've cleaned projects - Project > Clean
I've change debug configuration - Launching default activity to particular activity, always prompt to pick devices and automatically pick.
I've clicked and unclicked Skip breakpoint
Also restarted Eclipse and Windows also
You can attach the debugger to an existing process in Eclipse by choosing the process from the device window and clicking on the attach debugger button.
See this post for further details:
How to attach back the Android emulator to ADB?

Running applicatiom from eclipse causing phone restart

im using eclipse to develop android app.
Im debugging my app on real device, htc desire hd.
When i start my app from eclipse its allways restart my phone.
This behavior wasnt allways like this and suddenly happaned.
I tried 3 different ROMs all 4.2.2 and its happing in all of them.
In my log cat i dont see any errors except this in my console:
[2013-09-05 21:25:33 - WorkoutLog2] Failed to install WorkoutLog2.apk on device 'HT0BRRX047774!
[2013-09-05 21:25:33 - WorkoutLog2] (null)
[2013-09-05 21:25:33 - WorkoutLog2] Launch failed on device: HT0BRRX047774
Why this is happening?

Categories