Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Hotshot10101 · Apr 18, 2019 at 03:52 PM · iosdebugging

iOS Script Debugging not working

I have Visual Studio 2019 for Mac. I have an iPhone Max XS with the latest iOS. I am using Unity 2018.3.11f.

I created a brand new project and just have a single script with very little in it.

I am trying to debug on iOS. I checked Development Build, Script debugging and wait for manage debugger. I also selected run xcode as Debug, but also tried as Release and both did the same thing.

I tried the Build and Run button. After opening xcode and building the console output says the buld was complete, but then after several seconds it gives the following:

Socket: connect failed, error: Operation now in progress(36) connect failed Failed to connect to player ip: 10.48.21.111, port: 55000

That is the IP address of my iPhone on the wifi.

I also tried running the app from xcode in debug. It runs and shows a dialog saying that I can connect the managed debugger.

I have Visual Studio open so I select Run / Attach to process. The iPhone process shows up with an ip address of 192.0.0.1, 56000. Not sure where that is coming from, but if I don't have the app running on the iPhone it doesn't show up at all, so I suspect it is the right thing.

If I select to attach to it the dialog goes away, but after several seconds I get a dialog in VS saying:

Debugger operation failed.

Operation is not valid due to the current state of the object.

I have tried all kinds of gymnastics in trying to start things at certain times and waiting here and there and connecting faster or slower and nothing changes.

I have also tried all of this with both the iPhone connected via USB and wifi. I have turned off and turned on wifi debugging in xcode for this device.

I have tried just running the app on the iPhone and not by using xcode and it does show up in the VS attach to process dialog, but still fails with the above message.

If I do run it in the debugger over USB I get the following output:

 PlayerConnection initialized from /var/containers/Bundle/Application/359CFD90-51F6-4BBA-B2B6-347C1A1F4B5F/evaluation2d.app/Data (debug = 0)
 PlayerConnection initialized network socket : 0.0.0.0 55000
 Multi-casting "[IP] 192.0.0.1 [Port] 55000 [Flags] 3 [Guid] 1916711904 [EditorId] 1338261848 [Version] 1048832 [Id] iPhonePlayer(Tonys-iPhone):56000 [Debug] 1 [PackageName] iPhonePlayer" to [225.0.0.222:54997]...
 Waiting for connection from host on [0.0.0.0:55000]...
 PlayerConnection accepted from [10.48.21.31] handle:0x6
 Started listening to [0.0.0.0:55000]
 PlayerConnection already initialized - listening to [0.0.0.0:55000]
 2019-04-18 09:43:19.140200-0600 evaluation2d[1824:557382] Metal GPU Frame Capture Enabled
 2019-04-18 09:43:19.140779-0600 evaluation2d[1824:557382] Metal API Validation Disabled
 2019-04-18 09:43:19.364326-0600 evaluation2d[1824:557382] [Warning] Trying to set delaysTouchesBegan to NO on a system gate gesture recognizer - this is unsupported and will have undesired side effects
 -> applicationDidBecomeActive()
 GfxDevice: creating device client; threaded=1
 Initializing Metal device caps: Apple A12 GPU
 Initialize engine version: 2018.3.11f1 (5063218e4ab8)

If I disconnect USB and just debug in xcode over wifi I get the following output:

 PlayerConnection initialized from /var/containers/Bundle/Application/B1C0D8B3-4EA6-4F91-AB0D-D228CFD277C7/evaluation2d.app/Data (debug = 0)
 PlayerConnection initialized network socket : 0.0.0.0 55000
 Multi-casting "[IP] 192.0.0.1 [Port] 55000 [Flags] 3 [Guid] 3570588543 [EditorId] 1338261848 [Version] 1048832 [Id] iPhonePlayer(Tonys-iPhone):56000 [Debug] 1 [PackageName] iPhonePlayer" to [225.0.0.222:54997]...
 Waiting for connection from host on [0.0.0.0:55000]...
 PlayerConnection accepted from [10.48.21.31] handle:0x6
 Started listening to [0.0.0.0:55000]
 PlayerConnection already initialized - listening to [0.0.0.0:55000]
 2019-04-18 09:48:54.066179-0600 evaluation2d[1838:559292] Metal GPU Frame Capture Enabled
 2019-04-18 09:48:54.066749-0600 evaluation2d[1838:559292] Metal API Validation Disabled
 2019-04-18 09:48:55.006351-0600 evaluation2d[1838:559292] [Warning] Trying to set delaysTouchesBegan to NO on a system gate gesture recognizer - this is unsupported and will have undesired side effects
 -> applicationDidBecomeActive()
 GfxDevice: creating device client; threaded=1
 Initializing Metal device caps: Apple A12 GPU
 Initialize engine version: 2018.3.11f1 (5063218e4ab8)
 

You can see how in that one it waits for a connection and gets it from xcode because I haven't done the attach yet from VS. Also notice how the port is 55000 and not 56000 like VS is using.

All I want to do is be able to do managed script debugging on iOS. Can someone tell me how to get this to work?

Comment
Add comment
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

3 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by ThinhHB · Jul 11, 2019 at 06:17 AM

I faced the same error "Debugger operation failed. Operation is not valid due to the current state of the object." Try this:

  • Go to Unity/Preferences/External tools

  • Check the "Editor Attaching"

Then restart both Unity and Visual Studio, hope it will help

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image makaka-org · Aug 30, 2021 at 07:52 PM 0
Share

There is no "Editor Attaching" option in Unity 2021.1

avatar image
1

Answer by kwikdev · Jun 30, 2020 at 06:28 PM

I am seeing this in Unity 2019.4.f1 today just trying to attach Unity Editor for debugging in the Mac environment.

The 'Editor Attaching' is checked, I have reinstalled both Unity and VS, multiple Mac restarts.

Stuck! What else can fix this?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
1

Answer by faveris_dt · Mar 04, 2021 at 10:11 AM

I fixed error "Socket: connect failed, error: Operation now in progress(36)" with turning cellular data off on my iPhone.

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image wesleypw · May 06, 2021 at 08:24 PM 0
Share

Had to restart the app after turning off cellular data.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

144 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can't debug an iOS game. 1 Answer

How do I debug a crash in mscorlib.dll.s with Strip-assemblies turned on? 1 Answer

unity 5- IOS works only in development build 0 Answers

ios script debugging using Visual Studio 0 Answers

IOS Script Debugging gives XCode Error: Unable to insert branch island 2 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges