Fixed
Status Update
Comments
vi...@google.com <vi...@google.com> #2
Thank you for your feedback. Team may reach out for more feedback in reproducing or triaging this issue.
ar...@google.com <ar...@google.com>
am...@grabtaxi.com <am...@grabtaxi.com> #3
Even after creating directory I get "Failed to connect port"
And this is not fixed until 3.6 canary 10. This is shameful.
And this is not fixed until 3.6 canary 10. This is shameful.
em...@google.com <em...@google.com> #4
The 3rd argument to lldb server command is not supposed to be the path of the APK, but a domain socket directory. The issue might be happening due to debugging with two applicationIds (com.my.package | com.my.package.test). (A wild guess would be that the debugger gets copied to one, but is being invoked from the other).
Could you please attach to this bug:
1. Your idea.log file (Help > Show log...)
2. A small project that we can use to reproduce this issue?
Could you please attach to this bug:
1. Your idea.log file (Help > Show log...)
2. A small project that we can use to reproduce this issue?
am...@grabtaxi.com <am...@grabtaxi.com> #5
2019-09-11 23:51:32,439 [ 595702] INFO - idea.run.AndroidProcessHandler - Adding device Nexus_5X_API_23 [emulator-5554] to monitor for launched app: com.grab.hydra.hydra_analytics
2019-09-11 23:51:32,439 [ 595702] INFO - run.AndroidLogcatOutputCapture - startCapture("Nexus_5X_API_23 [emulator-5554]")
2019-09-11 23:51:32,440 [ 595703] INFO - s.ndk.run.lldb.ConnectLLDBTask - ABIs supported by app: [x86]
2019-09-11 23:51:32,441 [ 595704] INFO - s.ndk.run.lldb.ConnectLLDBTask - Launching AndroidNativeAttachConfigurationType:Hybrid native debug session on device: manufacturer=unknown, model=Android SDK built for x86, API=23, codename=REL, ABIs=[x86]
2019-09-11 23:51:32,463 [ 595726] WARN - s.ndk.run.lldb.ConnectLLDBTask - Rooted device, using shell to start debug session
2019-09-11 23:51:32,464 [ 595727] INFO - s.ndk.run.lldb.ConnectLLDBTask - ABIs supported by app: [x86]
2019-09-11 23:51:32,464 [ 595727] WARN - n.AndroidNativeAppDebugProcess - Native library driversec-Debug-x86 is using compiler flags which may be debug incompatible:
2019-09-11 23:51:32,464 [ 595727] WARN - n.AndroidNativeAppDebugProcess - -Wl,--gc-sections: can remove unused functions, breaking expression evaluation
2019-09-11 23:51:32,465 [ 595728] INFO - s.ndk.run.lldb.ConnectLLDBTask - Found LLDB server: "/Applications/Android Studio 3.6 Preview.app/Contents/bin/lldb/android/x86/lldb-server"
2019-09-11 23:51:32,465 [ 595728] INFO - AndroidLLDBDriverConfiguration - LLDB framework file: /Applications/Android Studio 3.6 Preview.app/Contents/bin/lldb/lib/liblldb.7.0.0.dylib
2019-09-11 23:51:32,513 [ 595776] INFO - ls.ndk.run.lldb.SessionStarter - Pushing files to device
2019-09-11 23:51:32,530 [ 595793] INFO - ls.ndk.run.lldb.SessionStarter - Remote file /data/local/tmp/lldb-server is up-to-date.
2019-09-11 23:51:32,536 [ 595799] INFO - ls.ndk.run.lldb.SessionStarter - Remote file /data/local/tmp/start_lldb_server.sh is up-to-date.
2019-09-11 23:51:32,536 [ 595799] INFO - ndk.run.lldb.AndroidLLDBDriver - Loading driver
2019-09-11 23:51:32,550 [ 595813] INFO - ndk.run.lldb.AndroidLLDBDriver - Loading startup script: /Applications/Android Studio 3.6 Preview.app/Contents/bin/lldb/shared/stl_printers/load_script
2019-09-11 23:51:32,614 [ 595877] INFO - run.AndroidLogcatOutputCapture - stopCapture("Nexus_5X_API_23 [emulator-5554]")
2019-09-11 23:51:32,615 [ 595878] INFO - run.AndroidLogcatOutputCapture - stopCapture("Nexus_5X_API_23 [emulator-5554]")
2019-09-11 23:51:32,615 [ 595878] INFO - run.AndroidLogcatOutputCapture - stopAll()
2019-09-11 23:51:32,762 [ 596025] INFO - ndk.run.lldb.AndroidLLDBDriver - Loading startup script: /Applications/Android Studio 3.6 Preview.app/Contents/bin/lldb/shared/jobject_printers/jstring_reader.py
2019-09-11 23:51:32,765 [ 596028] INFO - ndk.run.lldb.AndroidLLDBDriver - Startup command: "settings set auto-confirm true"
2019-09-11 23:51:32,766 [ 596029] INFO - ndk.run.lldb.AndroidLLDBDriver - Startup command: "settings set plugin.symbol-file.dwarf.comp-dir-symlink-paths /proc/self/cwd"
2019-09-11 23:51:32,766 [ 596029] INFO - ndk.run.lldb.AndroidLLDBDriver - Startup command: "settings set plugin.jit-loader.gdb.enable-jit-breakpoint false"
2019-09-11 23:51:32,803 [ 596066] WARN - n.lldb.ShellSessionStarterImpl - mkdir: '/data/data/com.grab.hydra.hydra_analytics/lldb': File exists
mkdir: '/data/data/com.grab.hydra.hydra_analytics/lldb/bin': File exists
2019-09-11 23:51:32,803 [ 596066] INFO - n.lldb.ShellSessionStarterImpl - Copying to app folder: /data/local/tmp/lldb-server => /data/data/com.grab.hydra.hydra_analytics/lldb/bin/lldb-server
2019-09-11 23:51:32,803 [ 596066] INFO - n.lldb.ShellSessionStarterImpl - Command: cat /data/local/tmp/lldb-server | sh -c 'cat > /data/data/com.grab.hydra.hydra_analytics/lldb/bin/lldb-server && chmod 700 /data/data/com.grab.hydra.hydra_analytics/lldb/bin/lldb-server'
2019-09-11 23:51:32,928 [ 596191] INFO - n.lldb.ShellSessionStarterImpl - Copying to app folder: /data/local/tmp/start_lldb_server.sh => /data/data/com.grab.hydra.hydra_analytics/lldb/bin/start_lldb_server.sh
2019-09-11 23:51:32,928 [ 596191] INFO - n.lldb.ShellSessionStarterImpl - Command: cat /data/local/tmp/start_lldb_server.sh | sh -c 'cat > /data/data/com.grab.hydra.hydra_analytics/lldb/bin/start_lldb_server.sh && chmod 700 /data/data/com.grab.hydra.hydra_analytics/lldb/bin/start_lldb_server.sh'
2019-09-11 23:51:32,966 [ 596229] INFO - n.lldb.ShellSessionStarterImpl - Starting LLDB server : /data/data/com.grab.hydra.hydra_analytics/lldb/bin/start_lldb_server.sh /data/data/com.grab.hydra.hydra_analytics/lldb unix-abstract /com.grab.hydra.hydra_analytics-0 platform-1568217092465.sock "lldb process:gdb-remote packets"
2019-09-11 23:51:32,967 [ 596230] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:32,971 [ 596234] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 1 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:33,474 [ 596737] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:33,478 [ 596741] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 2 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:33,982 [ 597245] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:33,987 [ 597250] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 3 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:34,490 [ 597753] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:34,494 [ 597757] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 4 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:34,999 [ 598262] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:35,003 [ 598266] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 5 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:35,506 [ 598769] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:35,511 [ 598774] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 6 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:36,012 [ 599275] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:36,018 [ 599281] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 7 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:36,518 [ 599781] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:36,523 [ 599786] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 8 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:37,026 [ 600289] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:37,031 [ 600294] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 9 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:37,536 [ 600799] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:37,540 [ 600803] WARN - ndk.run.lldb.AndroidLLDBDriver - Giving up making LLDB connection after 10 attempts
2019-09-11 23:51:32,439 [ 595702] INFO - run.AndroidLogcatOutputCapture - startCapture("Nexus_5X_API_23 [emulator-5554]")
2019-09-11 23:51:32,440 [ 595703] INFO - s.ndk.run.lldb.ConnectLLDBTask - ABIs supported by app: [x86]
2019-09-11 23:51:32,441 [ 595704] INFO - s.ndk.run.lldb.ConnectLLDBTask - Launching AndroidNativeAttachConfigurationType:Hybrid native debug session on device: manufacturer=unknown, model=Android SDK built for x86, API=23, codename=REL, ABIs=[x86]
2019-09-11 23:51:32,463 [ 595726] WARN - s.ndk.run.lldb.ConnectLLDBTask - Rooted device, using shell to start debug session
2019-09-11 23:51:32,464 [ 595727] INFO - s.ndk.run.lldb.ConnectLLDBTask - ABIs supported by app: [x86]
2019-09-11 23:51:32,464 [ 595727] WARN - n.AndroidNativeAppDebugProcess - Native library driversec-Debug-x86 is using compiler flags which may be debug incompatible:
2019-09-11 23:51:32,464 [ 595727] WARN - n.AndroidNativeAppDebugProcess - -Wl,--gc-sections: can remove unused functions, breaking expression evaluation
2019-09-11 23:51:32,465 [ 595728] INFO - s.ndk.run.lldb.ConnectLLDBTask - Found LLDB server: "/Applications/Android Studio 3.6 Preview.app/Contents/bin/lldb/android/x86/lldb-server"
2019-09-11 23:51:32,465 [ 595728] INFO - AndroidLLDBDriverConfiguration - LLDB framework file: /Applications/Android Studio 3.6 Preview.app/Contents/bin/lldb/lib/liblldb.7.0.0.dylib
2019-09-11 23:51:32,513 [ 595776] INFO - ls.ndk.run.lldb.SessionStarter - Pushing files to device
2019-09-11 23:51:32,530 [ 595793] INFO - ls.ndk.run.lldb.SessionStarter - Remote file /data/local/tmp/lldb-server is up-to-date.
2019-09-11 23:51:32,536 [ 595799] INFO - ls.ndk.run.lldb.SessionStarter - Remote file /data/local/tmp/start_lldb_server.sh is up-to-date.
2019-09-11 23:51:32,536 [ 595799] INFO - ndk.run.lldb.AndroidLLDBDriver - Loading driver
2019-09-11 23:51:32,550 [ 595813] INFO - ndk.run.lldb.AndroidLLDBDriver - Loading startup script: /Applications/Android Studio 3.6 Preview.app/Contents/bin/lldb/shared/stl_printers/load_script
2019-09-11 23:51:32,614 [ 595877] INFO - run.AndroidLogcatOutputCapture - stopCapture("Nexus_5X_API_23 [emulator-5554]")
2019-09-11 23:51:32,615 [ 595878] INFO - run.AndroidLogcatOutputCapture - stopCapture("Nexus_5X_API_23 [emulator-5554]")
2019-09-11 23:51:32,615 [ 595878] INFO - run.AndroidLogcatOutputCapture - stopAll()
2019-09-11 23:51:32,762 [ 596025] INFO - ndk.run.lldb.AndroidLLDBDriver - Loading startup script: /Applications/Android Studio 3.6 Preview.app/Contents/bin/lldb/shared/jobject_printers/jstring_reader.py
2019-09-11 23:51:32,765 [ 596028] INFO - ndk.run.lldb.AndroidLLDBDriver - Startup command: "settings set auto-confirm true"
2019-09-11 23:51:32,766 [ 596029] INFO - ndk.run.lldb.AndroidLLDBDriver - Startup command: "settings set plugin.symbol-file.dwarf.comp-dir-symlink-paths /proc/self/cwd"
2019-09-11 23:51:32,766 [ 596029] INFO - ndk.run.lldb.AndroidLLDBDriver - Startup command: "settings set plugin.jit-loader.gdb.enable-jit-breakpoint false"
2019-09-11 23:51:32,803 [ 596066] WARN - n.lldb.ShellSessionStarterImpl - mkdir: '/data/data/com.grab.hydra.hydra_analytics/lldb': File exists
mkdir: '/data/data/com.grab.hydra.hydra_analytics/lldb/bin': File exists
2019-09-11 23:51:32,803 [ 596066] INFO - n.lldb.ShellSessionStarterImpl - Copying to app folder: /data/local/tmp/lldb-server => /data/data/com.grab.hydra.hydra_analytics/lldb/bin/lldb-server
2019-09-11 23:51:32,803 [ 596066] INFO - n.lldb.ShellSessionStarterImpl - Command: cat /data/local/tmp/lldb-server | sh -c 'cat > /data/data/com.grab.hydra.hydra_analytics/lldb/bin/lldb-server && chmod 700 /data/data/com.grab.hydra.hydra_analytics/lldb/bin/lldb-server'
2019-09-11 23:51:32,928 [ 596191] INFO - n.lldb.ShellSessionStarterImpl - Copying to app folder: /data/local/tmp/start_lldb_server.sh => /data/data/com.grab.hydra.hydra_analytics/lldb/bin/start_lldb_server.sh
2019-09-11 23:51:32,928 [ 596191] INFO - n.lldb.ShellSessionStarterImpl - Command: cat /data/local/tmp/start_lldb_server.sh | sh -c 'cat > /data/data/com.grab.hydra.hydra_analytics/lldb/bin/start_lldb_server.sh && chmod 700 /data/data/com.grab.hydra.hydra_analytics/lldb/bin/start_lldb_server.sh'
2019-09-11 23:51:32,966 [ 596229] INFO - n.lldb.ShellSessionStarterImpl - Starting LLDB server : /data/data/com.grab.hydra.hydra_analytics/lldb/bin/start_lldb_server.sh /data/data/com.grab.hydra.hydra_analytics/lldb unix-abstract /com.grab.hydra.hydra_analytics-0 platform-1568217092465.sock "lldb process:gdb-remote packets"
2019-09-11 23:51:32,967 [ 596230] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:32,971 [ 596234] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 1 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:33,474 [ 596737] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:33,478 [ 596741] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 2 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:33,982 [ 597245] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:33,987 [ 597250] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 3 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:34,490 [ 597753] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:34,494 [ 597757] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 4 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:34,999 [ 598262] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:35,003 [ 598266] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 5 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:35,506 [ 598769] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:35,511 [ 598774] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 6 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:36,012 [ 599275] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:36,018 [ 599281] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 7 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:36,518 [ 599781] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:36,523 [ 599786] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 8 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:37,026 [ 600289] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:37,031 [ 600294] WARN - ndk.run.lldb.AndroidLLDBDriver - Failed to connect platform (attempt 9 of 10) - retrying. Error was: Failed to connect port
2019-09-11 23:51:37,536 [ 600799] INFO - ndk.run.lldb.AndroidLLDBDriver - Connecting to LLDB server: unix-abstract-connect://[emulator-5554]/com.grab.hydra.hydra_analytics-0/platform-1568217092465.sock
2019-09-11 23:51:37,540 [ 600803] WARN - ndk.run.lldb.AndroidLLDBDriver - Giving up making LLDB connection after 10 attempts
em...@google.com <em...@google.com> #6
Thanks. Can you check the contents of /data/data/yourpackage/lldb/log/ and attach the platform.log and platform-stdout.log files in that directory to this bug?
- It's usually best to (1) delete those log files from the device, (2) run the debugger to trigger the failure, (3) then copy the newly created log files and attach to this bug.
It might give us more information on why/if lldb-server exited/crashed (you can use attach files to bugs, rather than posting their contents).
- It's usually best to (1) delete those log files from the device, (2) run the debugger to trigger the failure, (3) then copy the newly created log files and attach to this bug.
It might give us more information on why/if lldb-server exited/crashed (you can use attach files to bugs, rather than posting their contents).
ki...@gmail.com <ki...@gmail.com> #7
I also hit this issue on Android Studio 3.5 after upgrading my Android SDK Platform-Tools from 29.0.2 to the latest 29.0.3
After reverting back to SDK Platform-Tools 29.0.2 I am able to debug again.
After reverting back to SDK Platform-Tools 29.0.2 I am able to debug again.
em...@google.com <em...@google.com> #8
Thanks for the platform-tools information. I have a repro, and please use platform-tools 29.0.2 while we investigate the issue.
ra...@google.com <ra...@google.com> #9
Since this issue was reported before 29.0.3 released we should investigate what else could be causing this.
en...@google.com <en...@google.com> #10
emre: this bug was filed over a week _before_ we shipped 29.0.3, so i don't think this is actually a 29.0.3 issue...
en...@google.com <en...@google.com> #11
(i wouldn't assume that #7 is actually hitting the _same_ bug until that's proven. folks tend to just pile on any open bug.)
jo...@google.com <jo...@google.com> #12
I confirm that I can set a breakpoint and hit it with 29.0.2 but when I moved to 29.0.3 I get:
Giving up making LLDB connection after 10 attempts
In the idea log.
Giving up making LLDB connection after 10 attempts
In the idea log.
em...@google.com <em...@google.com> #13
I can +1 that upgrading from platform tools 29.0.2 to 29.0.3 results in LLDB being unable to connect to remote lldb-server:
1. Device:
bash$ adb shell
adb$ run-as com.example.myapplication
adb$ /data/data/com.example.myapplication/lldb/bin/start_lldb_server.sh \
/data/data/com.example.myapplication/lldb \
unix-abstract \
/com.example.myapplication-0 \
platform-156393867851.sock \
"lldb process:gdb-remote packets"
2. Host:
bash$ lldb
(lldb) platform select remote-android
(lldb) platform connect unix-abstract-connect://[emulator-5554]/com.example.myapplication-0/platform-156393867851.sock
error: Failed to connect port
The above sequence works with adb from Platform Tools 29.0.2.
1. Device:
bash$ adb shell
adb$ run-as com.example.myapplication
adb$ /data/data/com.example.myapplication/lldb/bin/start_lldb_server.sh \
/data/data/com.example.myapplication/lldb \
unix-abstract \
/com.example.myapplication-0 \
platform-156393867851.sock \
"lldb process:gdb-remote packets"
2. Host:
bash$ lldb
(lldb) platform select remote-android
(lldb) platform connect unix-abstract-connect://[emulator-5554]/com.example.myapplication-0/platform-156393867851.sock
error: Failed to connect port
The above sequence works with adb from Platform Tools 29.0.2.
zw...@gmail.com <zw...@gmail.com> #14
I encounter the same problem. lldb cannot start and leave 'error: Failed to connect port' in debug console.
After downgrading to Platform-tools 29.0.2 everything goes fine.
After downgrading to Platform-tools 29.0.2 everything goes fine.
ki...@gmail.com <ki...@gmail.com> #15
Same issue ("Failed to connect port"). Spent 8 hours trying to figure out whats happened. Thanks for everybody replies. It helped a lot. I reverted to Platform Tools 29.0.2 and it works again.
jm...@google.com <jm...@google.com>
ra...@google.com <ra...@google.com> #16
Released 29.0.4 with a fix.
ji...@gmail.com <ji...@gmail.com> #17
I have this error with 29.0.4.
fa...@google.com <fa...@google.com> #18
Same here, upgraded to 29.0.4, but I'm still unable to hit native breakpoints. See b/141095752 for idea log.
z....@gmail.com <z....@gmail.com> #19
A few people and I from the Visual Studio Developer Community have triaged the issue, and found that downgrading the Android Platform Tools back to version 28.0.x solves the issues being caused by version 29.0.x.
View the community thread here:
https://developercommunity.visualstudio.com/content/problem/733170/error-starting-application-failed-to-forward-ports.html?childToView=739773#comment-739773
Resolution:
1. Close Visual Studio
2. Delete the existing platform-tools from your android SDK
3. Download platform-tools version 28.0.2 from Google's repository here:https://dl-ssl.google.com/android/repository/platform-tools_r28.0.2-windows.zip
4. Un-zip and move the platform-tools (version 28.0.2) into to your Android SDK.
5. Delete the 'bin' and 'obj' folders from your project/solution
6. Clean project/solution
7. Rebuild project/solution
View the community thread here:
Resolution:
1. Close Visual Studio
2. Delete the existing platform-tools from your android SDK
3. Download platform-tools version 28.0.2 from Google's repository here:
4. Un-zip and move the platform-tools (version 28.0.2) into to your Android SDK.
5. Delete the 'bin' and 'obj' folders from your project/solution
6. Clean project/solution
7. Rebuild project/solution
Description
- Android Studio 3.5,
- Android SDK Build-tools, LLDB, Emulator, SDK Tools - all are up-to-date,
- Emulator AVD: Pixel 2 XL API 22 - x86 - Google API
Debug Native c++ library - session log:
09/03 02:10:03: Launching 'setMeasurement() (1)' on Pixel 2 XL API 22 - x86 - Google API (can be rooted).
Running tests
$ adb shell am instrument -w -r -e debug true -e \
class 'com.my.package.MyClassTest#setMeasurement' \
com.my.package.test/androidx.test.runner.AndroidJUnitRunner
Waiting for application to come online: com.my.package | com.my.package.test
...
Waiting for application to come online: com.my.package | com.my.package.test
Connecting to com.my.package.test
Now Launching Native Debug Session
$ adb shell cat /data/local/tmp/lldb-server \
| sh -c 'cat > /data/data/com.my.package/lldb/bin/lldb-server
\ && chmod 700 /data/data/com.my.package/lldb/bin/lldb-server'
$ adb shell cat /data/local/tmp/start_lldb_server.sh \
| sh -c 'cat > /data/data/com.my.package/lldb/bin/start_lldb_server.sh \
&& chmod 700 /data/data/com.my.package/lldb/bin/start_lldb_server.sh'
Starting LLDB server:
/data/data/com.my.package/lldb/bin/start_lldb_server.sh \
/data/data/com.my.package/lldb \
unix-abstract \
/com.my.package.test-0 \
platform-1567469412447.sock \
"lldb process:gdb-remote packets"
failed to get reply to handshake packet
Inspecting the phone file directories structure I found out:
- in adb command for setup ldb-server the target path is wrong, it is "/data/data/com.my.package" and APK is located in /data/app/com.my.package-2 (suffix -2 is probably dynamically created)
- folder .../lldb/bin/ does not exists too
- the adb command obviously failed since the folders and files were not copied/setup on the emulator. This brings the issue I just submitted: "Android Studio C++ Debugger startup silently ignores phone LLDB setup critical issues"
The workaround that worked for me was to create the (wrong?) target folder before the setup:
adb shell
mkdir -p /data/data/com.my.package/lldb/bin