Bug 18406 - Grey out the "No Devices Attached" drop-down menu when the startup project is not an iOS app project
Summary: Grey out the "No Devices Attached" drop-down menu when the startup project is...
Status: RESOLVED FIXED
Alias: None
Product: Visual Studio Extensions
Classification: Xamarin
Component: iOS ()
Version: 1.12.x
Hardware: PC Mac OS
: Normal minor
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2014-03-14 17:21 UTC by Brendan Zagaeski (Xamarin Team, assistant)
Modified: 2015-08-03 09:28 UTC (History)
5 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Test case (31.40 KB, application/zip)
2014-03-14 17:21 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Brendan Zagaeski (Xamarin Team, assistant) 2014-03-14 17:21:58 UTC
Created attachment 6318 [details]
Test case

XamarinVS.iOS does not inactivate the iOS devices list when the startup project is set to something other than a Xamarin.iOS app project. In contrast, XamarinVS.Android _does_ inactivate the Android devices list when the startup project is something other than a Xamarin.Android app project.


## Steps to reproduce

Open the attached test case in Visual Studio.


### Alternatively, create a new project

1. Create a new Xamarin.iOS application project.

2. Add a PCL project to the solution.

3. Set the PCL project as the startup project.

4. Quit Visual Studio and reopen the solution.


## Result

After opening the project, the drop-down menu for iOS devices is active, and says "No Devices Attached."


## Possible improvements

When the startup project is not a Xamarin.iOS app project:

- Grey-out and inactivate the device selection drop-down menu. This is what Xamarin.Android projects do.

- Maybe change the text in the drop-down menu to read "Set iOS app as startup project" (or similar). Xamarin.Android projects do not do this, so keeping the current "No Devices Attached." is fine too.


## Version information

Tested on XamarinVS.iOS 1.12.239.0



Thanks!
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2014-10-23 18:03:24 UTC
I'm going to expand this request slightly to include "unsupported" active platforms. If it would also be possible to disable the device list when an unsupported platform is selected, that would be lovely too. The Android device list does not currently demonstrate any better behavior than the iOS device list in this second scenario, but deploying with an "invalid" platform _works_ for Android.

Other more extensive redesigns of the Android and iOS device lists might make this whole bug irrelevant.

## Example steps to reproduce

1. Make sure you have installed the Window Phone 8 SDK (so the Xamarin.Forms template will create the Windows Phone project without error).

2. Create a new "Visual C# -> Mobile Apps -> Blank App (Xamarin.Forms Shared)" project.

3. Pair to the Mac Xamarin.iOS Build Host (if prompted).

4. Set the iOS app project as the startup project.

5. In "Build -> Configuration Manager", select the "iPhone" platform drop-down menu for the iOS project, and add a new "x86" platform.

6. Select "New platform: x86" and "Copy settings from: iPhoneSimulator", and un-check "Create new solution platforms". Then click OK.

7. Close the Configuration Manager.


## Result

The devices list will show "No Devices Attached." unless you attach a physical iOS device to the Mac. This is confusing because it suggests that this is a valid project configuration.

If you then attempt to build and deploy the app, it will fail:

> Failed to deploy application on the target device. Please try to
> rebuild the solution and try again. (Generic)
> OK
> 
> Build server returned an Error.
> 
> error MT1006: Could not install the application
> '/Users/macuser/Library/Caches/Xamarin/mtbs/builds/FormAppSharediOS/e7ceac73ec463a69890fc9db5bf16355/bin/x86/Debug/FormAppSharediOS.app'
> on the device Apple Developer’s iPhone:
> AMDeviceSecureInstallApplicationBundle returned: 0xe800801c.
> 
> writeDictToFile:1249 open failed for
> /Users/macuser/Library/Caches/Xamarin/mtbs/builds/FormAppSharediOS/e7ceac73ec463a69890fc9db5bf16355/obj/x86/Debug/mtouch-cache/install-shadow-directory/e6fa1cb228a1d00be1c4c846839db8bc/22370b3744bb0ac7defe0a4b8e617daebadaa1ee/ManifestCache.plist
> : No such file or directory
> MDMCacheDirectoryManifest:1323 writeDictToFile failed to write to
> /Users/macuser/Library/Caches/Xamarin/mtbs/builds/FormAppSharediOS/e7ceac73ec463a69890fc9db5bf16355/obj/x86/Debug/mtouch-cache/install-shadow-directory/e6fa1cb228a1d00be1c4c846839db8bc/22370b3744bb0ac7defe0a4b8e617daebadaa1ee/ManifestCache.plist
> : No such file or directory
> error MT1006: Could not install the application
> '/Users/macuser/Library/Caches/Xamarin/mtbs/builds/FormAppSharediOS/e7ceac73ec463a69890fc9db5bf16355/bin/x86/Debug/FormAppSharediOS.app'
> on the device Apple Developer’s iPhone:
> AMDeviceSecureInstallApplicationBundle returned: 0xe800801c.


## Expected result

If possible, it would be nice to disable the devices list in cases like this, where the iOS project is set to an invalid active platform. As an additional bit of polish, maybe an error message could be added before the deploy step to indicate that "the active platform for the FormAppSharediOS project is not set to a valid value. Please change this value to 'iPhone' or 'iPhoneSimulator' in the Configuration Manager."


## Version information

### Windows
Xamarin   3.7.230.0 (e78d10d6993f95fc3ebe791aeb4aacff165bf8bb)
Xamarin.iOS   8.4.0.0 (209abebbd8f1a292d042420edb45fa5fbd3f017b)

### Mac build host

Xamarin.iOS 8.4.0.16 (Business Edition)
Hash: 80e9ff7
Build date: 2014-10-22 15:09:12-0400

Mono 3.10.0 ((detached/e204655)
Xcode 6.0.1 (6528), Build 6A317
Mac OS X 10.9.5


Thanks!
Comment 2 Udham Singh 2015-08-03 09:28:57 UTC
I have checked this issue with the help of test steps given in bug description with latest stable builds but I am not able to reproduce this issue at my end. 

Please refer the screencast : http://www.screencast.com/t/ylk3c2cNC

For now I am marking this issue as Resolved-Fixed. If you are still getting this issue, please feel free to reopen this issue.

Environment Info : 

Microsoft Visual Studio Professional 2013
Version 12.0.31101.00 Update 4
Microsoft .NET Framework
Version 4.5.50938

Installed Version: Professional

Xamarin   3.11.666.0 (ebae43a)
Visual Studio extension to enable development for Xamarin.iOS and
Xamarin.Android.

Xamarin.Android   5.1.4.16 (5f55a9ef61c11b6ce0890bc91e4c71b1b92be214)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   8.10.2.0 (67b390d0d1bd741582cf7b7fd3ffea08583a3f83)
Visual Studio extension to enable development for Xamarin.iOS.