Unable to start gdbserver on port '64311'

Anybody else getting this?
What can be done about it?

"Error
---------------------------
Unable to start gdbserver on port '64311'. Port is already in use."

It happens when I try to run (debug) an app on my Android device.
The dialog "launching" does not close by itself. When I press Cancel, I 
get the above error message.
(the app is launched while the dialog 'launching' is visible)

Thanks,
Reinier
0
Reinier
9/13/2013 6:09:35 PM
embarcadero.delphi.firemonkey 4901 articles. 4 followers. Follow

6 Replies
7431 Views

Similar Articles

[PageSpeed] 39

same problem here to solve need reboot smartphone (galaxy s4) but if break debugging problem happen again.

bb
Manuel


> {quote:title=Reinier Sterkenburg wrote:}{quote}
> Anybody else getting this?
> What can be done about it?
> 
> "Error
> ---------------------------
> Unable to start gdbserver on port '64311'. Port is already in use."
> 
> It happens when I try to run (debug) an app on my Android device.
> The dialog "launching" does not close by itself. When I press Cancel, I 
> get the above error message.
> (the app is launched while the dialog 'launching' is visible)
> 
> Thanks,
> Reinier
0
Manuel
9/13/2013 9:51:49 PM
On 13-Sep-13 23:51, Manuel Di Maio wrote:
> same problem here to solve need reboot smartphone (galaxy s4) but if break debugging problem happen again.
>
> bb
> Manuel
>

Thanks, rebooting the phone helped!
Not sure though what you mean by 'if break debugging'.
I can have the debugger stop on breakpoints without causing the problem 
to appear again.

Reinier

>
>> {quote:title=Reinier Sterkenburg wrote:}{quote}
>> Anybody else getting this?
>> What can be done about it?
>>
>> "Error
>> ---------------------------
>> Unable to start gdbserver on port '64311'. Port is already in use."
>>
>> It happens when I try to run (debug) an app on my Android device.
>> The dialog "launching" does not close by itself. When I press Cancel, I
>> get the above error message.
>> (the app is launched while the dialog 'launching' is visible)
>>
>> Thanks,
>> Reinier
0
Reinier
9/14/2013 7:12:45 AM
Sorry for my bad english, if i debug application and happen a error in application code or stop it unplug usb cable gdbserver hang un phone and need reboot it because i think it try to wait compiler to continue somethink.

Ty
Manuel


> {quote:title=Reinier Sterkenburg wrote:}{quote}
> On 13-Sep-13 23:51, Manuel Di Maio wrote:
> > same problem here to solve need reboot smartphone (galaxy s4) but if break debugging problem happen again.
> >
> > bb
> > Manuel
> >
> 
> Thanks, rebooting the phone helped!
> Not sure though what you mean by 'if break debugging'.
> I can have the debugger stop on breakpoints without causing the problem 
> to appear again.
> 
> Reinier
> 
> >
> >> {quote:title=Reinier Sterkenburg wrote:}{quote}
> >> Anybody else getting this?
> >> What can be done about it?
> >>
> >> "Error
> >> ---------------------------
> >> Unable to start gdbserver on port '64311'. Port is already in use."
> >>
> >> It happens when I try to run (debug) an app on my Android device.
> >> The dialog "launching" does not close by itself. When I press Cancel, I
> >> get the above error message.
> >> (the app is launched while the dialog 'launching' is visible)
> >>
> >> Thanks,
> >> Reinier
0
Manuel
9/14/2013 7:32:38 AM
Restarting the device doesn't help me, but I finally found the solution, so let me explain where Embarcadero did the mistake. I started digging logs from adb logcat and found that gdbserver executable has no executable attribute. The gdbserver file is in the /libs folder of the installed app, mine got installed into the /data/data/com.embarcadero... (it's folder is mounted as /mnt/asec/com.embarcadero...~1, list of mounts can be seen via cat /proc/mounts). The point is that you should avoid executing anyt
hing from /libs in android. But if FMX devs still want to keep it that way I would recommend to search for the gdbserver which is already in the system if included one fails to run.
There are few ways of fixing this I could figure out:
- There is no source for this but still it's possible to change FMXNativeActivity.class in the debug classes.dex to use some other gdbserver with proper attributes located anywhere in your phone instead of " getFilesDir().getParent() + "/lib/gdbserver" ".
- Write your own adb.exe which will redirect all calls to the original renamed adb.exe, so when the command is to launch an app you should remount your app's libs folder via adb shell and change gdbserver attributes. Currently I'm using this way.
0
Ramirez
9/15/2013 2:41:53 AM
> {quote:title=Ramirez Z wrote:}{quote}
> - Write your own adb.exe which will redirect all calls to the original renamed adb.exe, so when the command is to launch an app you should remount your app's libs folder via adb shell and change gdbserver attributes. Currently I'm using this way.
Ramirez,

could you be so kind to post the source for the adb.exe wrapper?
0
Oliver
9/15/2013 5:56:57 PM
I have exactly same problem. I can start app on Android device, but I can't use debugger. Changing debug port number should solve this problem (http://www.embarcadero.com/starthere/xe5/mobdevsetup/android/en/runandroidtargetfailedhelppage.html), but delphi only shows error message with different port number. I'm using HTC One X with Android 4.2.2. Restart of the device or IDE doesn't help.
0
Utf
10/31/2013 6:39:02 PM
Reply:

Web resources about - Unable to start gdbserver on port '64311' - embarcadero.delphi.firemonkey

Resources last updated: 1/22/2016 4:51:26 AM