Coder Social home page Coder Social logo

Comments (10)

amberdixon avatar amberdixon commented on August 28, 2024 1

Will take a look, thank you

from rules_ios.

amberdixon avatar amberdixon commented on August 28, 2024 1

Hi all! This is working for me, if I do the following:

  1. bazelisk run tests/ios/xcodeproj:Test-With-Host-App --@build_bazel_rules_ios//rules:local_debug_options_enabled
  2. open tests/ios/xcodeproj/TestWithHostApp.xcodeproj
  3. Set a break point on line 5 of empty.swift where the EmptySwiftTests class is defined.
  4. Select the ExplicitHosted scheme
  5. Run Cmd+U.
    My breakpoint gets hit.

Note that I do not need to disable sandbox mode anymore. I think there have been some changes to this repo since October that may have fixed the issue. I'm using Xcode 11.6 on BigSur (Mac OS v11.0.1).

I'm also able to hit breakpoints in main.m when I run the iOS-9.3-AppHost scheme. Perhaps #127 made a difference here? In any case, this issue is not happening anymore.

from rules_ios.

amberdixon avatar amberdixon commented on August 28, 2024 1

Hi all. It looks like there is an issue with sandboxing is not enabled. Thanks for reporting the issue, apologies for closing it too early.

Furthermore, when you change the sandbox flag (i.e. turn it on or off), you must then close Xcode, run bazelisk clean && bazelisk run tests/ios/xcodeproj:Test-With-Host-App and then reopen the project again. So it seems like there is some lingering state!

In order to get breakpoints to work, you should:

  1. Close Xcode
  2. Comment out these lines in .bazelrc:
# build --genrule_strategy=standalone
# build --spawn_strategy=standalone
  1. Call bazelisk clean
  2. Call bazelisk run tests/ios/xcodeproj:Test-With-Host-App
  3. Reopen xcode.
  4. Set a break point on line 5 of empty.swift where the EmptySwiftTests class is defined
  5. Select the ExplicitHosted scheme
  6. Run Cmd+U

from rules_ios.

acecilia avatar acecilia commented on August 28, 2024

Hey, I am trying to get breakpoints working on Xcode while using the xcodeproj rule. What I did:

  • I pulled rules_ios to the most updated commit, containing #119
  • I added the following to my bazel.rc file:
build --genrule_strategy=standalone
build --spawn_strategy=standalone
build --compilation_mode=dbg

But I cant get it to work. Are there any other steps required? 🤔

EDIT:
I tried also with the examples of this repo:

  • Cloned the latest commit from this repo
  • Removed the comments for the following lines in the .bazelrc file:
build --genrule_strategy=standalone
build --spawn_strategy=standalone
  • Opened tests/ios/xcodeproj/TestWithHostApp.xcodeproj
  • Added a breakpoint in line 5 of EmptySwiftTests.swift
  • Run the tests: do CMD+U in the ExplicitHosted scheme of the project

Result: breakpoint did not stop the execution

from rules_ios.

wileykestner avatar wileykestner commented on August 28, 2024

@amberdixon We tried the same setup steps as @acecilia and also reproduced the same result: we did not hit a local breakpoint when set in Xcode 11. Were you able to reproduce @acecilia's issue?

We would be happy to help investigate / fix if possible, but don't want to duplicate any investigative work that you have already done on this issue.

from rules_ios.

acecilia avatar acecilia commented on August 28, 2024

@amberdixon could you give an update on this? 🙏
What is the status of breakpoints? Are they supposed to work and I have some faulty configuration, or are they not working?

from rules_ios.

FranzBusch avatar FranzBusch commented on August 28, 2024

@amberdixon I just followed your steps but on Xcode 12.3 and 12.2 and can't make breakpoints work. Then I was wondering is it anywhere stated here that these rules only work with Xcode 11.x ? cc @segiddins

from rules_ios.

segiddins avatar segiddins commented on August 28, 2024

They should work equally well on 11 and 12

from rules_ios.

FranzBusch avatar FranzBusch commented on August 28, 2024

@segiddins I was following exactly the steps as above and I can't seem to get breakpoints working. Do you have any advice how to debug this? I would be happy to investigate it.

from rules_ios.

acecilia avatar acecilia commented on August 28, 2024

Same here, cant get the breakpoint to work 😢 . Followed these steps:

  1. rm -rf tests/ios/xcodeproj/TestWithHostApp.xcodeproj
  2. bazelisk run tests/ios/xcodeproj:Test-With-Host-App --@build_bazel_rules_ios//rules:local_debug_options_enabled
  3. Check that git is clean: it is
  4. open tests/ios/xcodeproj/TestWithHostApp.xcodeproj
  5. Set a break point on line 5 of empty.swift where the EmptySwiftTests class is defined
  6. Select the ExplicitHosted scheme
  7. Run Cmd+U

The breakpoint does not stop execution of the test.

Running on:

  • Catalina 10.15.7
  • Xcode Version 12.3 (12C33)
  • Latest commit from this repository: 20d809d07f3c9db4887049efedd6a47a749400dd
  • Simulator: iPhone 8 iOS 14.3

I also run on code 11.6 with same results. I am bit puzzled at this point, only difference I see with @amberdixon is Catalina VS bigSur

from rules_ios.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.