Android Studio - Error Installing APK + Broken Pipe Error (on Mac) - macos

So I am running Android Studio 3.3 on my Mac that's running High Sierra v. 10.13.4. My code compiles fine and runs on the emulator, but when I try to plug in my 2 Samsung Tab A's that I'm working with, Android Studio throws this error during the build:
java.io.IOException: Broken pipe
Error while Installing APK
Device samsung-sm_t580-5203b3db5aa1b4cfdisconnected, monitoring stopped.`
I've looked around and other people have suggested killing all ADB processes and restarting which I did. I've also restarted my Android Studio and my computer and the tablet. And it seems that the Android studio can find the tablet as it pops up on the ADB device listing, but just can't connect to it. I also saw something about Eclipse and Android studio running concurrently and causing issues, but I don't have Eclipse running so it can't be that either. However, when I tried my roommate's Android phone (Pixel XL 2), that works fine and the code builds and runs on the phone.
So at this point I'm a little baffled at why I'm having this issue. Any thoughts or suggestions would be awesome!

Related

could not launch the emualator please file an issue an attempt was made to load an application with an incorect format

I get this error when trying to launch xamarin emulator from visual studio 2017 device manager. I have downloaded image file tried resetting but nothing seems to work.
I have encounted similar problems, and my solutin are:
1)check the Complile Android version,Minimum Android version,Target Android version and the OS for your divice(You can get this by opening ADM and editing the device). Please sure you have intalled the SDK for the compiling version, target version and the device OS by Android ADK Manager.
2) If you have correctly installed the needed ADK and still get the problem, you can install the app on your phone and run the project again.

react-native and Visual Studio Emulator for Android

is it possible to run react native app on Visual Studio Emulator for Android (standalone) and if yes what are the steps to set it up? I can successfully start emulator, that part works but cant figure out how to config react-native to use it instead of "adb devices".
My current attempts end with error:
Could not debug. Error while executing command 'adb devices': Command failed: adb devices
'adb' is not recognized as an internal or external command,
operable program or batch file.
I know about Android Studio and virtual devices that come with it but I would like to try that as the last option. My environment is: Windows 10 pro, VS Code (with React Native Tools Extension), react-native, yarn.
UPDATE
even though I did not get anywhere in my attempts to make it work
I just would like to share what knowledge I gained while struggling with this issue
because it is possible that my issues are specific to my environment but it might work on another PC.
Theoretically it requires very few steps to run react-native in Visual Studio Emulator for Android
in VS code without installing Android Studio or Visual Studio.
Install Visual Studio Emulator for Android, standalone
https://www.visualstudio.com/vs/msft-android-emulator/
download Android Debug Bridge (adb)
it is included with Android SDK Platform-Tools, download and read more here:
https://developer.android.com/studio/command-line/adb.html
it downloads as zip file, you unzip it and then add a path to adb.exe in PATH environment variable,
so you can execute adb command from any path. I am using yarn and it needs that to know where adb.exe is.
It is kind of a connector between your app and virtual or real android device
it has to be running before you start emulator and basic command are:
to stop - adb kill-server
to start - adb start-server
to see list of devices that adb recognized - adb devices
I also found a specific instruction on how to make Visual Studio Emulator for Android work with adb:
https://msdn.microsoft.com/en-us/library/mt228282.aspx
'Visual Studio Emulator for Android' devices are not listed in the Android Device Monitor
it is a registry edit for key
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Android SDK Tools
apparently Visual Studio Emulator for Android is using that and you can create it if it is not there
and just add/modify Path variable to be a path to adb.exe.
now you can start Visual Studio Emulator for Android and after that open integrated terminal in you react native VS code project
and type:
yarn run android
and if I get it right (and in the perfect world) your app should get installed and shown in Visual Studio Emulator for Android,
well, not for me, my emulator never shows up as a device when I type adb devices, all I see is a blank two lines.
So I think I spent enough time on this trying to make it work and in my case the answer to my own questions is:
theoretically you should be able to run Visual Studio Emulator for Android with react-native from VS code but in reality
it probably will not work, so seek something more reliable.
I did see a little light at the end of the tunnel when I tried connecting my phone with USB using expo app, adb picked it up right away,
"yarn run android" started doing something and expo even tried to load my app, I held my breath, my heart was racing, I was ready for a miracle... and .... boom... it just crashed, but this could be easier
for me to resolve though, it appears some networking config issues, my phone does not recognize IP address which was in the output after running yarn
and if this works,(big IF) then it is still good, I can run/debug react-native without using Android/Visual Studio.
Final update:
could not make it work, stopped all attempts and went for Android Studio instead, Android Studio emulators work with react native and expo without any issues. (well, not yet, sample app runs OK at least.)
The same symptoms occurred to me when trying to set both React-Native and VS Emulator for Android together, and the following steps solved them:
On the VS Emulator for Android, I checked my emulated phone's IP at the Tools/Network tab. Emulator Adapter #1 refers to the emulated phone.
Then, I headed to the terminal and ran adb connect <ip_address>:5555. That made the emulated phone available to Android Studio as well as to React-Native.
if you already install android studio
then add C:\Users\manu\AppData\Local\Android\Sdk\platform-tools path into environment path (replace your username instead of manu)
if you have not android studio then
need download adb from https://github.com/intel/haxm/releases/download/v7.0.0/haxm-windows_v7_0_0.zip
then install
intelhaxm-android.exe
.
open a new terminal and now adb commnad will work
it is haxm source website https://software.intel.com/en-us/articles/intel-hardware-accelerated-execution-manager-intel-haxm

Visual Studio 2017 / Xamarin fail to run app on iPhoneSimulator

** solved by trial and error, see comments **
Anyone who can help me troubleshoot the process of loading an iOS app into the XCode iPhoneSimulator?
Recently I set up the latest VS 2017 + Xamarin + XCode on my Mac Pro (MacOS 10.12.6 "Sierra"). I created a portable HelloWorld app with Xamarin, and it runs fine on the iPhoneSimulator, so everything is wired together correctly. I did also try a HelloWorld in XCode, it runs in the simulator too.
Today I loaded a sample app from GitHub, which is also a portable app supporting Android and iOS. After unloading the .Droid hive, I could successfully build it, no errors of any kind.
But if I try to run it in the iPhone simulator, the simulator starts, but then nothing happens any more, obvioulsly the app doesn't get executed, or an attempt to execute it is made, but fails silently. Other Xamarin apps appear on the iOS start screen, this one doesn't, it seems like it never reaches the simulator, or is rejected for some reason. System log shows nothing unusual. Usual steps to clean up the application and get an entirely new build (delete .obj and .bin and then rebuild all) have been tried, but no success.
Can anyone give me instructions ho I can do further troubleshooting? On Windows, I'd try to load the ready built apk into the simulator from a terminal window, sometimes this gives additional error infos, but on the Mac I have no idea how to accomplish this. What I can say though is that the build creates a ton of files in the debug directory (.exe, .dll, .pdb), but from ther I don't know how to proceed further.
The .Droid hive of the same application compiles and runs perfectly on my Windows host under the Android simulator.

Android Studio 3.0 (MacOS 10.13) AVD Crash Laptop

Every time I try to launch an AVD in Android Studio 3.0, it crashes my entire laptop. I'm on MacOS 10.13 (High Sierra), and the crash happens when qemu launches (it never gets close to actually emulating a device). I have deleted all existing AVD devices, uninstalled and reinstalled Android Studio, the emulator (and HAXM), and even used homebrew to install qemu separately (to see if there was a different version that would NOT crash).
I have no idea where else to look or what else to do... I can run my app successfully on my phone that is connected, but just can't use the emulators at all.
Anyone have any ideas?

iOS app flashing and closing on remote debug from Visual Studio

I'm a beginner in iOS development in Visual Studio 2013 through Xamarin.
I made a test app and tried to debug it on the MacBook Pro through LAN remote debugging.
As soon as I debug, the app starts shows launch screen and after 1 second it close, this happens several times and then the app stops.
I'm using xamarin 6.1.4.1 on both machines.
It shows the error : An error occurred while executing the mtouch.
What should I do now??
After going through every things, I re-installed Xamarin Studio by using Xamarin Installer rather than installing individual components. Seems like Xamarin Installer makes some more changes in system other than installing components.

Resources