0

IntelliJ is my android development IDE. And it help me to generate the apk.

One situation is: The apk runs well when I debug with real phone. But if I use run model ,it does not work.

Another situation is that: The apk runs well the first time ,but if I press the home key long time and kill the app. Then I go to the app icons board to click my app icon, it will stay on the screen "Waiting for debugger".

fcbflying
  • 693
  • 1
  • 7
  • 23

1 Answers1

0

The "Waiting for debugger" message is because you have built the app for immediate debug. You pressed the debug button right? The app expects to be able to connect to the debugger immediately on launch. This is really useful if you want to debug something that happens immediately on launch.

If you don't need to debug immediately you can hit the "Play"/"Run" button in Android Studio. The app will still be built in debug mode so you can still start debugging later by pressing the "Attach Debugger" button. Pressing the debug button is like pressing the play button and immediately pressing the "Attach debugger" button.

If you want to test the app in Release mode, you can select "Build Variants" and choose release, you don't normally need this.

Here's an image showing the build variants menu and the run, debug and attach to debugger buttons:

enter image description here

But if I use run model ,it does not work.

I presume you mean with the emulator. The emulator can be tricky to get working, so I'll need more information about what isn't working to help

Sam
  • 3,453
  • 1
  • 33
  • 57