简体   繁体   中英

Visual Studio 2017 (Xamarin) not showing list of iPhone Simulators

I've got everything seemingly working properly with the connection between my VS 2017 and the Mac. All looks good as far as the connection, the build works fine with no errors but I can't actually debug/run it because it doesn't allow me to choose a simulator.

On the toolbar, I have selected: Debug | iPhoneSimulator | Simulator iPhoneSimulator is the ACTIVE platform.

On the Start > button when I drop down the menu options, it gives me:

Start Device Unsupported Devices > Change Deployment Target iPhone 5s iOS 10.2 iPhone 6 Plus 10.2 iPhone 6s Plus iOS 10.2 iPhone 6 iOS 10.2

See the screenshot of my menu options

and about 10 or so more but they are all in the "unsupported" category so whenever I try to click on one, nothing happens, and when I try to run my project, I get "Please select a valid device before running the application."

The PC is running Windows 10 x64 with Visual Studio 2017 Community Edition. The MAC is running El Capitan 10.11.6. (Can't update to Sierra (10.12+) because Apple doesn't support it on this MAC) Xcode running is 8.2 (have also tried 8.2.1) and can't update to 8.3+ because 8.3 and up requires Sierra (o/s 10.12+)

The latest versions of Xamarin are installed on both the PC and the MAC with all corresponding updates.

I've had to change the build option "Link Behavior" in VS to "Link Framework SDK Only" as the instructions state because of the fact that I can't install Xcode 8.3 on the MAC.

Any suggestions as to why everything would seem to work EXCEPT for VS 2017 no obtaining a list of simulators from the MAC? The MAC sees the simulators. Even running the command "xcrun instruments -s devices" on the MAC returns all of the simulators. I can make a sample program in Xcode, choose a simulator and run it. It just won't pass that information to my VS 2017 so that I can launch it from there. It will even let me launch the iOS simulator from VS 2017 without error.

I've tried uninstalling and re-installing Xamarin on both the PC and MAC and creating a new iOS project. Everything builds fine. Everything else works, just not the debugging/running and the reason it won't work is because I can't choose an actual emulator.

You will need to make sure your target version is lower than your Simulator version.

Open Info.plist and select a version lower or equal to 10.2. 在此输入图像描述

I ran into something similar while running VS2017 on Mac OS X. I was using multiple build configurations, and I had multiple Info.plist files. One of them (not even the one that should have been used for that build config) had two entries for CFBundleShortVersionString due to a bad git merge. I wouldn't have discovered that if I wasn't opening each of them to change the Deployment Target mentioned in @lowleetak's answer. After correcting that, I was able to debug to the simulator again.

So for other who run into this - check your Info.plist files.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM