Quick tip: copy ip address to clipboard

My Mac runs Windows 10 in a virtual machine that is connected to the host using a network bridge. This way both host and client share the same network. Now you may be asking why I would need that. On Windows I use Visual Studio and Xamarin to create native iOS and Android apps. Using the Xamarin Mac agent I can both build and run the iOS app. But Android? The virtualized Windows can neither run Intel HAXM nor Hyper-V as VirtualBox does not support this type of nested virtualization. However, on the host (macOS) I can easily launch another VirtualBox client, for example Android x86. After adb connect ... I can use the simulated device to launch and debug apps. Here is a small shell function that copies the ip address to the clipboard:

function ipaddress {
    ipconfig getifaddr en0 | pbcopy

No comments:

Post a Comment