Visual Studio unable to find the app in El Capitan VM - visual-studio-cordova

I'm using visual studio 2015 community edition. When i try to debug my cordova-ionic app with remotebuild on an El Capitan VM on virtualbox, the app gets successfully installed onto the iOS simulator. However, I receive the error "We were unable to find the app you’re trying to debug. Check that the device is connected, awake, and unlocked. Also, make sure it has Web Inspector enabled."
Things I've tried:
1. I've checked and web inspector is turned on on the iOS simulator (under settings>safari>advanced>web inspector in the simulator)
2. I've tried 'reset content and settings (under simulator>reset content and settings...)
3. I've tried turning windows firewall off
4. I've tried secure and unsecured remotebuild
Any suggestions on how i can fix this would be greatly appreciated!

However, I receive the error "We were unable to find the app you’re trying to debug.
It could be the result of timeout of remote build tool.Please try the following steps:
first run remotebuild saveconfig in mac os terminal
Open the RemoteBuild.config file in the Text Editor from the path of the previous step
Change value of appLaunchStepTimout to 60000 (1 min)
Change value of emulatorLaunchTimeout to 60000 (1 min)
Save the file
run remotebuild on terminal
Run the project from Visual studio again
If the above steps doesn't work, please try increasing the El Capitan VM memory.

Related

Is there support for appium on mac m2 machine

I am facing several issues while trying to launch my application from appium inspector on apple mac m2 machine . I tried for both simulator(using .app) and real device(using .ipa) . Hence wanted to check if there is any support for appium on mac m2 machine as the last release appears to be around the same time MacBook Air with M2 chip was launched.
I have installed all the pre-requisites. I have also checked the installations through appium doctor and there are no issues. Created a build. Started the appium server and entered the Desired capabilities through appium inspector and try to give Start session . But facing the below error :
Failed to create session. An unknown server-side error occurred while processing the command. Original error: Simulator architecture is unsupported by the '/Users/e5662282/fcb_mb.app' application. Make sure the correct deployment target has been selected for its compilation in Xcode.
Appium should support Mac M2.
The error that you see is because the app is not built for the simulator.
You will need to build the .app file from Xcode or from the command line and select the target as simulator. You can follow the steps from here:
https://help.perfecto.io/perfecto-help/content/perfecto/automation-testing/create_an_ios_simulator_build.htm
You can also refer this defect on Appium GitHub that has similar issue: https://github.com/appium/appium/issues/17649

Xamarin - A remote error occurred in the connected mac. ... Connection is finished

The connection had been working for a while and then suddenly I started getting a flurry of error messages that resulted with a final "... connection is finished" error.
After a few attempts, I was able to screen capture one of the preceding messages and came up with this:
A Remote error occurred in the connected Mac
XCode couldn't be found at /Library/Developer/CommandLineTools. Please specify the right location in Visual Studio under 'Tools > Options > Xamarin > iOS Settings' or ensure that uit is installed properly at the default location ('/Applications/Xcode.app')
I tried restarting visual studio on the PC, and Visual Studio and XCode on the mac, but no dice.
I solved this problem by going back and checking that XCode command line tools was setup properly. After a recent ios update, the Xcode command line tools had been "deconfigured". The fix was pretty simple. I just had to go back into Xcode > Preferences > Locations and reselect the command line tools from the dropdown. It wasn't an obvious or easy find, but it was a simple fix once you knew what to look for.

Can't make Siri Shortcuts work in macCatalyst app

I'm trying to port my iOS app to Mac using macCatalyst, and I'm having problem with Siri Shortcuts. The code complies and runs, but when I try to add shortcut using INUIAddVoiceShortcutViewController I'm seeing 'Shortcuts unavailable.'
Using
INVoiceShortcutCenter.shared.getAllVoiceShortcuts returns error [Intents] -[INVoiceShortcutCenter getAllVoiceShortcutsWithCompletion:]_block_invoke Error from -getVoiceShortcutsWithCompletion: Error Domain=NSCocoaErrorDomain Code=4099 "Couldn’t communicate with a helper application."
Any ideas what's I'm doing wrong? Same code works perfectly fine on iOS.
The Intents framework is unavailable at runtime on macOS except for WidgetKit support. The APIs are available at compile time in the Mac Catalyst environment to reduce the amount of changes required to compile for Mac Catalyst. Calling into the APIs as part of the shared code path between iOS and Mac Catalyst is fine, they will just return an error for Mac Catalyst, as you're seeing.
Posted 11 hours ago by edford 

Visual Studio Tools for Apache Cordova - iOS Debugging Fails

I'm no longer able to debug my Cordova app on the iOS simulator. I get the dreaded "We're unable to find the app ... you're trying to debug." error. I've tried all the troubleshooting steps, but nothing has worked so far.
I should note that this was working just fine. I was able to debug my app multiple times, with no issues, and then suddenly this error started, and nothing I've tried has fixed it.
Interestingly, the actual build logs in Visual Studio make it look like everything went fine:
Requesting debug on remote iOS device for buildNumber 6805 on server https://<redacted>:3000/cordova...
Debugging - Successfully Debugging on the device
{webDebugPort=9221}
Anyone have any ideas?
UPDATE 1
Tried this on my local OS X device, too, and got a similar result. Here are the actual build logs:
Unable to attach to debug. Check that http://Matts-Mac-mini:9221 is accessible.
We were unable to find the app you’re trying to debug. Check that the device is connected, awake, and unlocked. Also, make sure it has Web Inspector enabled.
------ Cordova tools 6.1.1 already installed.
Requesting emulate on iOS Simulator for buildNumber 522 on server http://Matts-Mac-mini:3000/cordova...
Emulated - Successfully sent to ios Simulator
------ Cordova tools 6.1.1 already installed.
Requesting debug on remote iOS device for buildNumber 522 on server http://Matts-Mac-mini:3000/cordova...
Debugging - Successfully Debugging on the device
{webDebugPort=9221}
It looks like things fail, but then the later messages (which appear right away) make it look like things worked. And the app is indeed running in the simulator on my Mac.
After the discussion in the comments, I believe that the issue here is using a shared machine for debugging. If there are multiple iOS simulators running on a machine at the same time (Typically because there are multiple users connected to the machine each running their own simulator) then remotebuild cannot guarantee that you connect to the correct simulator. This is because we use ios-webkit-debug-proxy which assumes that only a single iOS simulator exists, and doesn't expose a way to restrict which one it connects to.
If you are trying to debug an app in the simulator and there is another user with a different simulator, you may connect to the wrong simulator where your app will not be running, and that can cause the error that you see.

Can't start Cordova debugging to iOS simulator

I've followed the instructions at the link below to "Build and simulate a Cordova iOS app in the cloud". https://taco.visualstudio.com/en-us/docs/build_ios_cloud/
After completing the instructions I'm able to build and get the iOS simulator working, however, I'm unable to attach a debugger.
The message displayed in remotebuild is:
GET /cordova/build/5655/debug 500 10.865 ms - 28
In Visual Studio I see the following in the Debug window:
Starting launch process C:\Program Files (x86)\nodejs\node.exe "(redacted)\node_modules\vs-tac\emulator.js" --platform ios --action launch --path "(redacted)\buildInfo.json" --serverUrl https://(redacted):3000/cordova --certificateName (redacted) --language en-US --loglevel info --cliVersion 5.4.1 --npmInstallDir "(redacted)" --deployTarget "iPhone 5"
Timed out connecting debugger to remote Apache Cordova app. See Output window for JavaScript console output.
------ Cordova tools 5.4.1 already installed.
Requesting emulate on iOS Simulator for buildNumber 5655 on server https://(redacted):3000/cordova...
Emulated - Successfully sent to ios Simulator
------ Cordova tools 5.4.1 already installed.
Requesting debug on remote iOS device for buildNumber 5655 on server https://(redacted):3000/cordova...
Failed to Debug iOS remote for build (redacted)\buildInfo.json to https://(redacted):3000/cordova :
iPhone 5
My local development machine is using Visual Studio 2015 and Cordova 5.4.1. I have Node v0.12.2 installed locally and v0.12.9 installed on the MacInCloud. Following the instructions in the link above, I am NOT an admin on the Mac machine.
I've also already tried the instructions suggested in this SO answer: Visual Studio Debugger failing to connect to remote Apache Cordova app in iOS simulator
All the suggestions and the links provided by others were helpful but ultimately my assessment of the problem was not being admin/root on the Mac. The Visual Studio Cordova docs linked in my original question would suggest that you can do all that you need on a Mac without having admin/root access but in my experience that is just not the case.
To the credit of the MacInCloud group, they were very helpful in making changes that I requested to permissions and for reinstalling packages such as brew, ios-webkit-debug-proxy, remotebuild, etc... but after a while that back-and-forth kind of approach to fixing the issue proved painful. When I switched from a Managed MacInCloud server to a Dedicated one, everything worked almost immediately.
Looking back I think the initial execution of remotebuild, which executes brew -- without being admin on the box -- caused the whole process to go south. I was warned when I ran remotebuild for the first time that it would install some brew components that might need root access. That should have been a warning sign to me that not being admin on the box was going to be an issue...
Even though I was able to get a Dedicated MacInCloud server working, the lesson I learned about having control over the Mac prompted me to just buy a Mac Mini. That was a little more difficult to setup because I was now doing everything myself, but ultimately I think it will pay off in the end.
For anyone else struggling with similar issues here is a brain dump of some things I learned along the way:
You don't necessarily need to get Visual Studio talking to the Mac to debug Cordova applications. You can use Safari Web Inspector from the Mac. https://blog.nraboy.com/2015/10/debugging-your-apache-cordova-ios-app-with-safari/. Even though I finally got VS working, I actually prefer this because it is more like Chrome's debugger which I prefer to Visual Studio's.
The ios-webkit-debug-proxy NPM package mentioned in other comments and links is basically a proxy which Visual Studio uses to debug the simulator in exactly the same way Safari does as mentioned above. For this proxy to work you must also be allowed to connect to the Mac over ports 9221-9322. https://github.com/google/ios-webkit-debug-proxy. Prior to learning that I thought I only needed port 3000 open for the remotebuild proxy...
The package necessary for launching the iOS simulator from remotebuild is ios-sim and it will occasionally timeout when launching the simulator and cause the debugger not to attach. This is a known limitation. https://github.com/phonegap/ios-sim and https://blogs.msdn.microsoft.com/visualstudio/2014/11/13/tools-for-apache-cordova-update-ios-debugging-windows-8-1-support/ (see comments).
If you should feel the need to install/uninstall brew it is very easy to do. Just run the install script and if already installed it will give you instructions on how to uninstall. http://brew.sh/ and https://github.com/Homebrew/homebrew/blob/master/share/doc/homebrew/Troubleshooting.md#troubleshooting. To uninstall or reinstall a NPM package is equally easy and Google is your friend.
Read and re-read both of these links for setting up a Mac: https://taco.visualstudio.com/en-us/docs/ios-guide/ and https://taco.visualstudio.com/en-us/docs/build_ios_cloud/. Getting the RemoteBuild.config right is crucial for getting secure connections to work -- especially if you want to access your Mac Mini at home from across the internet.
If you are remoting to a Mac I highly recommend iRAPP or some other VNC alternative. My experience has been that VNC is painfully slow and having a bad connection when you're troubleshooting issues just leads to more aggravation. http://www.coderebel.com/products/irapp/
As mentioned above, the MacInCloud guys were great when I asked for support, but if you do need root access for more than six months the cost of a Mac Mini is less than a Dedicated server plan.
Cheers
Since it is the call to /cordova/[...]/debug that is failing it looks like you might not have ios_webkit_debug_proxy installed. You could try making sure that homebrew is installed (from http://brew.sh) and running brew install ios-webkit-debug-proxy. Afterwards you should be able to run ios_webkit_debug_proxy without an error.
If that runs successfully then you should be able to quit out of ios_webkit_debug_proxy and debugging should work via remotebuild.

Resources