New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Xcode10]Two Simulators are launching while deploying an iOS App with Xcode10-beta3 #4421

Closed
GouriKumari opened this Issue Jul 9, 2018 · 17 comments

Comments

Projects
None yet
7 participants
@GouriKumari
Contributor

GouriKumari commented Jul 9, 2018

Steps to Reproduce

  1. Install Xamarin.iOS 11.99.1.44, Xcode10-beta3 (10L201y)
  2. Create an iOS app
  3. Build and deploy it on simulator eg: iPhoneX iOS 12.0

Expected Behavior

App builds, deploys and launch on iPhoneX iOS 12.0

Actual Behavior

App builds, deploys and launch on iPhoneX iOS 12.0. But a second simulator also opens iPhone4S 9.3.5

Environment

https://gist.github.com/GouriKumari/eeff3d2252cc2a2baddccacaeb14a76a

Build Logs

Screenshot: https://screencast.com/t/aH3UvYDYzI1V

VS bug #669811, VS bug #680549, VS bug #713315

@mandel-macaque

This comment has been minimized.

Contributor

mandel-macaque commented Jul 10, 2018

I can confirm the above with a build from xcode10 c1ad3f7 and the following VS env:

=== Visual Studio Community 2017 for Mac ===

Version Preview - Internal Dogfood (7.4.3 build 8)
Installation UUID: 8d12e55e-3489-463f-ac52-8cb4573c5a81
Runtime:
Mono 5.10.1.57 (2017-12/ea8a24b1bbf) (64-bit)
GTK+ 2.24.23 (Raleigh theme)

Package version: 510010057

=== NuGet ===

Version: 4.3.1.4445

=== .NET Core ===

Runtime: /usr/local/share/dotnet/dotnet
Runtime Versions:
2.1.1
2.0.5
2.0.0
1.1.2
1.0.5
1.0.0
SDK: /usr/local/share/dotnet/sdk/2.1.301/Sdks
SDK Versions:
2.1.301
2.1.4
2.0.0
1.0.4
1.0.0-preview2-003121
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.10.1/lib/mono/msbuild/15.0/bin/Sdks

=== Xamarin.Profiler ===

Version: 1.6.2
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Xamarin.Android ===

Version: 8.3.3.2 (Visual Studio Community)
Android SDK: /Users/mandel/Library/Developer/Xamarin/android-sdk-macosx
Supported Android versions:
4.0.3 (API level 15)
4.3 (API level 18)
4.4 (API level 19)
5.0 (API level 21)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.4
SDK Build Tools Version: 25.0.1

Java SDK: /usr
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.101-b13, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Apple Developer Tools ===

Xcode 10.0 (14301.4)
Build 10L201y

=== Xamarin.Mac ===

Version: 4.99.1.134 (Visual Studio Community)

=== Xamarin.iOS ===

Version: 11.99.1.14 (Visual Studio Community)
Hash: c1ad3f7
Branch: xcode10
Build date: 2018-07-10 19:16:53+0200

=== Xamarin Inspector ===

Version: 1.4.0
Hash: b3f92f9
Branch: master
Build date: Fri, 19 Jan 2018 22:00:34 GMT
Client compatibility: 1

=== Build Information ===

Release ID: 704030008
Git revision: d2c212a04a47c3176572edcc85319459646f9e19
Build date: 2018-04-06 11:21:38-04
Xamarin addins: fadb82fb0fe2668cb7789f8b524aec6fb8568ee7
Build lane: monodevelop-lion-dogfood-vNext

=== Operating System ===

Mac OS X 10.13.5
Darwin 17.6.0 Darwin Kernel Version 17.6.0
Tue May 8 15:22:16 PDT 2018
root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64

=== Enabled user installed addins ===

WakaTime 3.0.3
Internet of Things (IoT) development (Preview) 7.5

@mandel-macaque mandel-macaque added the iOS label Jul 10, 2018

@mandel-macaque mandel-macaque added this to the Future milestone Jul 10, 2018

@VincentDondain VincentDondain added the bug label Jul 31, 2018

@VincentDondain VincentDondain modified the milestones: Future, xcode10 Jul 31, 2018

@VincentDondain

This comment has been minimized.

Contributor

VincentDondain commented Jul 31, 2018

I have the same issue and filed
#4531 (dupe).

Video of the issue: https://www.dropbox.com/s/s1azhk66c4r6r7e/DualSim.mov?dl=0

@GouriKumari GouriKumari changed the title from [XI]Two Simulators are launching while deploying an iOS App with Xcode10-beta3 to [Xcode10]Two Simulators are launching while deploying an iOS App with Xcode10-beta3 Jul 31, 2018

@rolfbjarne rolfbjarne self-assigned this Jul 31, 2018

@rolfbjarne

This comment has been minimized.

Member

rolfbjarne commented Aug 3, 2018

One simulator (the wrong one) launches before mlaunch is called (which can easily be demonstrated by adding a sleep 20 in /Library/Frameworks/Xamarin.iOS.framework/Versions/Current/bin/mlaunch like this: https://gist.github.com/rolfbjarne/2577d73d53c41b34d8dd7bcdb690e4a0#file-mlaunch-L8-L10 - if the simulator launches before the mlaunch script stops sleeping, this can't be a bug in XI).

@rolfbjarne rolfbjarne removed their assignment Aug 3, 2018

@VincentDondain VincentDondain self-assigned this Aug 20, 2018

@VincentDondain

This comment has been minimized.

Contributor

VincentDondain commented Aug 20, 2018

Yea so the MakeSimulatorGrabFocus was causing this is called before / at the same time as mlaunch. There are other calls to MakeSimulatorGrabFocus later on in the deployment process that are fine.

@VincentDondain

This comment has been minimized.

Contributor

VincentDondain commented Aug 21, 2018

@VincentDondain

This comment has been minimized.

Contributor

VincentDondain commented Aug 22, 2018

Backported in xamarin/md-addins#3492.

Also it can happen on VSMac stable and when using stable Xcode if you installed a Xcode beta.

At this point you’d have the Simulator (beta) installed as well as the non beta Simulator application. The AppleScript we’re using to grab focus then calls “Simulator” but that can result in the beta simulator app being called and brought forward.

Therefore my fix, which removes that early call to the simulator app (and only brings to front the currently running simulator app) solves this.

cc @slluis and @Aguilex to back port this into the next SR. I don't know which branch to use.

@spouliot

This comment has been minimized.

Contributor

spouliot commented Aug 23, 2018

removing vs-sync since it's not an iOS nor a macOS bug
and external-visual-studio-mac does it's own sync (in the right area path)
@VincentDondain you'll likely need to update the description manually to re-establish the sync

@GouriKumari

This comment has been minimized.

Contributor

GouriKumari commented Aug 24, 2018

Verified with VSFMac 7.6.1.7 and the issue is resolved.

Screenshot: https://screencast.com/t/067SEo7uU

Test Env:
https://gist.github.com/GouriKumari/6c601db46d57c223f82caef0ba3db996

@LeGiangAnh

This comment has been minimized.

LeGiangAnh commented Aug 28, 2018

@GouriKumari I'd like to contact you. Could you please email me anh.legiang (at) gmail.com or https://twitter.com/LeGiangAnh?

@awattar

This comment has been minimized.

awattar commented Oct 18, 2018

It's still present in stable channel when using latest VS and XCode

Visual Studio Enterprise 2017 for Mac
Version 7.6.9 (build 22)

Apple Developer Tools
Xcode 10.0 (14320.25)
Build 10A255

Xamarin.iOS
Version: 12.0.0.15 (Visual Studio Enterprise)
Hash: 84552a4
Branch: xcode10
Build date: 2018-09-17 21:54:33-0400

@VincentDondain

This comment has been minimized.

Contributor

VincentDondain commented Oct 18, 2018

Hi @awattar,

With the environment you have, the double simulator issue should be fixed.

Could you upload a screencast while reproducing the issue so I can see what's happening?

Please note that you will still be able to have multiple simulators at the same time with that fix. The issue was that if you ran on a given simulator (iPhone X), closed the simulator app and launched an other simulator (iPhone Xs), because of the grab focus code in the IDE we'd grab focus on the simulator app too early preventing its reset, therefore showing you 2 simulator.

If you close the simulator app now, and launch on any simulator, with VSMac 7.6.9 (build 22) you should only have 1 simulator that opens. If the simulator app is still open we'll start additional simulators.

@awattar

This comment has been minimized.

awattar commented Oct 19, 2018

Hi @VincentDondain
Thanks for the detailed explanation.

This is my scenario:

  1. Launch VS.
  2. Run app on simulator A.
  3. Close simulator app.
  4. Switch configuration - for example from Debug to Release.
  5. Run app on simulator B.

It launches two simulators A and then B. Is this behaviour that you’ve described or something new?

@awattar

This comment has been minimized.

awattar commented Oct 19, 2018

Now I'm even able to reproduce it without changing anything - starting from cold start on XF project from template.

https://streamable.com/b1lzw

@VincentDondain

This comment has been minimized.

Contributor

VincentDondain commented Oct 19, 2018

Ah... I can reproduce now. This has to do with the release configuration (only). We might need to remove another GrabFocus here. Thanks for the report, this has not been reported before I believe. We'll fix it.

@awattar

This comment has been minimized.

awattar commented Oct 19, 2018

No problem. Glad I was able to help.

@VincentDondain

This comment has been minimized.

Contributor

VincentDondain commented Oct 23, 2018

Alright I fixed it for the release mode too now (:

I'll make sure it's included in the next release, thanks @awattar for the feedback.

@VincentDondain

This comment has been minimized.

Contributor

VincentDondain commented Oct 25, 2018

VSMac PR has been merged, it will be included in the next major release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment