kkharji / xbase

Develop Apple software products within your favorite editor.
MIT License
537 stars 17 forks source link

Not showing the correct simulator list after upgrading to Xcode 15 #238

Open sainttttt opened 1 year ago

sainttttt commented 1 year ago

Editor/Client you used

Neovim

Installation and Dependences checklist

Description

I upgraded my Xcode from Xcode 14 to Xcode 15 and it doesn't seem to be giving the correct simulator list anymore. It only shows iPhone 14, and not iPhone 15, which I believe is the only simulator I have installed now.

Expected behavior

Expect for the correct list of simulators to show up

Reproduce

1. Install Xcode 15 with iOS 17 + iPhone 15 Simulator
2. Try and run through xbase

Actual behavior

The error I get is `Failed to run target/scheme: Unable to lookup in current state Shutdown`

Operating system and version

13.6.1

xbase version / branch / rev

head

Neovim version

0.9.1

Vscode version (if the editor you used is vscode)

No response

Installed XCode Developer Tools

Developer:

    Developer Tools:

      Version: 15.0.1 (15A507)
      Location: /Applications/Xcode.app
      Applications:
          Xcode: 15.0.1 (22266)
          Instruments: 15.0.1 (64561.170)
      SDKs:
          DriverKit:
              23.0: 
          iOS:
              17.0: (21A326)
          iOS Simulator:
              17.0: (21A326)
          macOS:
              14.0: (23A334)
          tvOS:
              17.0: (21J351)
          tvOS Simulator:
              17.0: (21J351)
          watchOS:
              10.0: (21R354)
          watchOS Simulator:
              10.0: (21R354)

XBase Logs

 INFO Runtime{name="Katherine"}: [Initializing] ------------------------
 INFO Broadcaster{name="Katherine"}: Created
 INFO Runtime{name="Katherine"}: targets: {"katherine": TargetInfo { platform: "iOS", configurations: ["Debug", "Release"] }}
 INFO Broadcaster{name="Katherine"}: Connected [90704]
 INFO Runtime{name="katherine"}: Connected [90704]
 INFO Runtime{name="katherine"}: [Initialized] -------------------------
 INFO FSWatcher{name="katherine"}: Watching
 INFO FSWatcher{name="katherine"}: Running katherine
ERROR FSWatcher{name="katherine"}: [katherine] failed to start runner Failed to run target/scheme: Unable to lookup in current state Shutdown
 INFO FSWatcher{name="katherine"}: Ran katherine

XBase Build Server Logs

DEBUG xbase_sourcekit_helper: [ContentView.swift] Querying compile_db
 INFO xbase_sourcekit_helper: 
 INFO xbase_sourcekit_helper: Started
 INFO xbase_sourcekit_helper: Initialized
DEBUG xbase_sourcekit_helper: [ContentView.swift] Querying compile_db
 INFO xbase_sourcekit_helper: 
 INFO xbase_sourcekit_helper: Started
 INFO xbase_sourcekit_helper: Initialized
DEBUG xbase_sourcekit_helper: [ContentView.swift] Querying compile_db
 INFO xbase_sourcekit_helper: 
sainttttt commented 1 year ago

Not totally sure but I feel like there could be an issue with https://github.com/xbase-lab/simctl. When I try to run the tests I get this:


running 19 tests
test list::tests::test_list ... ok
test get_app_container::tests::test_get_app_container ... FAILED
test install::tests::test_install ... FAILED
test launch::tests::test_launch ... FAILED
test io::tests::test_screenshot ... FAILED
test privacy::tests::test_privacy_grant ... FAILED
test keychain::tests::test_keychain_reset ... FAILED
test privacy::tests::test_privacy_reset_all ... FAILED
test getenv::tests::test_getenv ... FAILED
test boot::tests::test_boot ... FAILED
test privacy::tests::test_privacy_reset ... FAILED
test open_url::tests::test_open_url ... FAILED
test privacy::tests::test_privacy_revoke ... FAILED
test push::tests::test_push ... FAILED
test shutdown::tests::test_shutdown ... FAILED
test status_bar::tests::test_status_bar ... FAILED
test terminate::tests::test_terminate ... FAILED
test ui::tests::test_appearance ... FAILED
test uninstall::tests::test_uninstall ... FAILED

failures:

---- get_app_container::tests::test_get_app_container stdout ----
thread 'get_app_container::tests::test_get_app_container' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- install::tests::test_install stdout ----
thread 'install::tests::test_install' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- launch::tests::test_launch stdout ----
thread 'launch::tests::test_launch' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- io::tests::test_screenshot stdout ----
thread 'io::tests::test_screenshot' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- privacy::tests::test_privacy_grant stdout ----
thread 'privacy::tests::test_privacy_grant' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- keychain::tests::test_keychain_reset stdout ----
thread 'keychain::tests::test_keychain_reset' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- privacy::tests::test_privacy_reset_all stdout ----
thread 'privacy::tests::test_privacy_reset_all' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- getenv::tests::test_getenv stdout ----
thread 'getenv::tests::test_getenv' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- boot::tests::test_boot stdout ----
thread 'boot::tests::test_boot' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- privacy::tests::test_privacy_reset stdout ----
thread 'privacy::tests::test_privacy_reset' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- open_url::tests::test_open_url stdout ----
thread 'open_url::tests::test_open_url' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- privacy::tests::test_privacy_revoke stdout ----
thread 'privacy::tests::test_privacy_revoke' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- push::tests::test_push stdout ----
thread 'push::tests::test_push' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- shutdown::tests::test_shutdown stdout ----
thread 'shutdown::tests::test_shutdown' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- status_bar::tests::test_status_bar stdout ----
thread 'status_bar::tests::test_status_bar' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- terminate::tests::test_terminate stdout ----
thread 'terminate::tests::test_terminate' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- ui::tests::test_appearance stdout ----
thread 'ui::tests::test_appearance' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

---- uninstall::tests::test_uninstall stdout ----
thread 'uninstall::tests::test_uninstall' panicked at 'called `Option::unwrap()` on a `None` value', src/mock.rs:11:10

failures:
    boot::tests::test_boot
    get_app_container::tests::test_get_app_container
    getenv::tests::test_getenv
    install::tests::test_install
    io::tests::test_screenshot
    keychain::tests::test_keychain_reset
    launch::tests::test_launch
    open_url::tests::test_open_url
    privacy::tests::test_privacy_grant
    privacy::tests::test_privacy_reset
    privacy::tests::test_privacy_reset_all
    privacy::tests::test_privacy_revoke
    push::tests::test_push
    shutdown::tests::test_shutdown
    status_bar::tests::test_status_bar
    terminate::tests::test_terminate
    ui::tests::test_appearance
    uninstall::tests::test_uninstall

test result: FAILED. 1 passed; 18 failed; 0 ignored; 0 measured; 0 filtered out; finished in 2.37s
kkharji commented 1 year ago

Not totally sure but I feel like there could be an issue with https://github.com/xbase-lab/simctl. When I try to run the tests I get this:

@sainttttt hmm either due to hard code device id or lib broke with recent version of xcode

sainttttt commented 1 year ago

@kkharji I haven't hardcoded any device ids, so I think it's an issue with lib and xcode possibly. Do you think you can fix it? Sort of breaking my workflow right now. Thanks!

sainttttt commented 1 year ago

@kkharji So I downgraded back to XCode 14 and now while it builds I keep getting this error

Failed to run target/scheme: Unable to lookup in current state Shutdown

Even though the simulator is open and can run (and can run with xcode). Any idea as to what is going on?

sainttttt commented 1 year ago

@kkharji So turns out that I got it to work again with xcode 14 at least. For some reason my lazy.nvim was set to pull from xbase-lab/xbase - not sure if that was causing the issue or not. However I'm pretty sure the same issue with xcode 15 happens so it would be cool if that could be fixed before we are forced to upgrade

duggthangs commented 11 months ago

@sainttttt Are you still having this issue? I am running it alongside XCode 15.1 with Run/Watch/Build working with iPhone 15

duggthangs commented 11 months ago

@sainttttt Maybe this might make a difference, but try specifying the opts.simctl.iOS as I have here:

{
'xbase-lab/xbase',
dependencies = {
    'neovim/nvim-lspconfig',
},
build = "make install",
config = function()
    require 'xbase'.setup {
        log_level = vim.log.levels.DEBUG,
        simctl = {
            iOS = {
                "iPhone 15 Pro"
            }
        },
        mappings = {
            build_picker = 0,
            run_picker = 0,
            watch_picker = 0,
            all_picker = 0,
            toggle_split_log_buffer = 0,
            toggle_vsplit_log_buffer = 0
        }
    }

end
},

and I have sourcekit-lsp called with xcrun to use XCode's symlink.