I need to find out how we can debug in xamarin using remote desktop.
I have xamarin installed in my remote machine and my scenario is, I will be using physical device in my local windows machine.
So if I connect the android device in my local machine, it should get detected in my remote desktop and I can also able to debug. How we can achieve this?
Thanks,
How to debug android devices in remote desktop in xamarin?
I am afraid that you cannot get what you want for Visual Studio 2015.
For VS2015, remote debugger cannot debug Xamarin projects.
However, if you have VS2017 or VS2019, you can use RevDeBug VS extension to debug your xamarin project remotely.
You can refer to this tutorial.
Related
my system which I develop MAUI on is not enough for running android emulator, so I decided to run android emulator on another Computer and debug my project remotely on it, I use this help to make a connection between computers, then when I build my project to debug it, visual studio recognize the emulator, install the app on it, and shows the splash screen, but after some minute, it shows this error and debuger agent can not connect:
[monodroid-debug] Trying to initialize the debugger with options:
--debugger-agent=transport=dt_socket,loglevel=0,address=10.0.2.2:36845,embedding=1
[mono] debugger-agent: Unable to connect to 10.0.2.2:36845
I should notice that the port is random
in this documentation of developer.android it shows that
10.0.2.2 is Special alias to your host loopback interface (127.0.0.1 on your development machine)
how should I fix it to can debug remotely in my development machine?
I'm working on an Ionic/Cordova cross-platform application and I'm struggling a little bit with the debugging.
Debug can of course be done directly from the browser by running ionic serve and then using the browser developer tools, but some behaviors happen only on real devices.
Adding a detailed guide to do this..
Make sure your android device has Developer mode on, and USB debugging is enabled in the developer settings on your device. You can google to activate this.
Device connected via USB, both system and mobile device connected to same wifi network..Use command
ionic cordova run android -l --external
After app has installed and started up on device, open this link in your chrome browser
chrome://inspect/#devices
If all was done correctly, you will see your device name and app name there with an option to inspect. This will open the chrome developer console exactly similar to the web one.
Now you can debug the app right on the device. Add breakpoints, edit html and see the logs as well.
Reference
Yes, you can use Chrome and Safari DevTools to connect to your device and debug the HTML/JS/CSS, as long as you don't build a release version (cordova build android ---release). It does take some initial setup since it's disabled by default.
Or you can use Android Studio or XCode to debug the plugins etc.
Note that you can only debug iOS apps with a Mac (or using Google's iOS WebKit Debug Proxy). Android apps can be debugged from any OS with Chrome (for HTML/JS/CSS) or Android Studio installed.
Official Cordova debugging guide
A simple way could be using logcat, take a look to this answer Debugging a WebView (Ionic) app on Android via logcat.
I'm starting a new big project in Cordova Phonegap and I have some doubts with using plugins.
Using my computer with Windows to build android's app and simulating it I'm hundred percent sure that it's working, but how can I know if the plugins in the iOS platform will work as well?
I've readed about PhoneGap Build™, but I'm not sure if it will bring versatility to the debugging process due to the need to 'deploy' the project to cloud whenever I want to debug a native apk version.
There's a tool that I can debug the development progress for both platforms (iOS and Android) in Windows, or whenever I want to test iOS platform I'll need to build an app in MacOS?
Thanks in advance
It depends what aspects of the iOS plugins you want to test: native or hybrid (JS)?
I.e. do you want to debug the Javascript running in the hybrid WebView - that of your own application and/or the Javascript layer of the plugins?
Or do you want to debug the native layer of the plugins (Android => Java, iOS => Objective-C/Swift)?
Bear in mind that any sort of deployment to an iOS device requires membership of Apple's iOS Developer program in order to be able to sign the app with valid credentials.
With regard to Phonegap Build, while it's possible to build an iOS app with Phonegap Build and receive the compiled .ipa (iOS equivalent to .apk), it's not easy to then directly connect an iOS device to a Windows 10 PC and connect a remote debugger to attach to the iOS Webview that your Cordova app is running in. I read that jsconsole offers one such free solution, but I've not tried it (there's a blog post about it, though).
One solution I have used is not free: Telerik Appbuilder is a paid product. It's Windows classic IDE allows you to build, deploy and debug the hybrid Webview of Cordova apps on an iOS device from a Window 10 PC using their cloud build service.
However, if you want to debug the native elements of iOS plugins, at this point your are going to need XCode (Apple's official IDE for developing iOS/OSX apps) and therefore the OSX operating system. But before you go out and buy a $1000 Macbook Pro, I would suggest one alternative that I use to develop both native and hybrid iOS apps on a Windows 10 PC: although it's not officially sanctioned by Apple, it's possible to run OSX inside a virtual machine using virtualisation software such as VMWare Workstation or Virtual Box - also known as a "Hackintosh". This allows you to use a Windows 10 host machine to run the OSX operating system and gain access to all of its features. By connecting an iOS device to a Windows 10 PC running an OSX, you can connect XCode to the device and use it's interactive debugger to debug the native elements of Cordova plugins. Also, you can use the Safari Browser's dev tools to connect to the iOS Webview and debug the JS layer.
I have used this method to develop and deploy both native and hybrid iOS apps to the App Store using a Windows 10 PC. However, bear in mind that a virtualised OS runs slower than a native one: I would recommend running the OSX image off an SSD with a high-performance PC: i7/32+Gb RAM/high-end GPU.
chrome.debugger API can be used to communicate between chrome dev tools and chrome debug target. I wonder if there is a equivalent for android app of chrome.debugger, If there is, then I can use it to debug android webviews without physically connect my android device with my development machine.
Thanks.
I configured my app to use Stetho. When I run the app and chrome://inspect, I can see the device. However, there is no button for any Android device to inspect the network, sqlite, etc.
I am developing on Ubuntu 15.10. Does Android Studio, ADB or Ubuntu need any further configuration?
This was my fault. After rebooting Ubuntu, it now works.