Can't execute "swift test" in non-XCode Swift project - swift

I'm beginning in Swift development (server side, no iOS). I have created the minimal package with swift package init and then swift build.
So far, so good. Now, when I run swift test, I get this error:
cannot load underlying module for 'XCTest'
I'm not using XCode, but just Visual Studio Code. How can I solve it? I have seen some solutions using XCode but I didn't found anything for "standalone" projects

Even if you're not using Xcode's editor, you still need the tools that come with it. Make sure you keep everything up-to-date, as the language is still evolving.

Related

How to get a Swift Package to be build with the Release Build Configuration of the current Scheme in Xcode?

I have moved some of my code from my main application to a Swift Package. But I noticed a slow down.
I have set the Build Configuration to Release in the scheme configuration, but it does not seem to be used when building the package.
So the same code in the main application will run much faster than in the package because it's optimised.
What could I be doing wrong? What configuration should I check?
I am using the Xcode 14.0.1 and I put a very small example project in github

Xcode - Umbrella framework - missing modules

I built an umbrella framework using Xcode 10.1, it works fine as long as computer the framework is built and the project it goes in are the same computer. As soon as I hand the framework off to someone else, on a different computer, it errors saying that the main framework can’t find the sub-frameworks "Missing required modules:".
I’ve tried changing the import paths and framework search paths in the project, but nothing seems to work. Same error.
This is the tutorial I followed, https://medium.com/#bittudavis/how-to-create-an-umbrella-framework-in-swift-ca964d0a2345, and if you search for "Missing required" it seems someone is having the same issue on his example project.
Thanks for any input.

New Xcode8 extension development process

Recently I'm running the Xcode plugin migration to Xcode8 built in version.
But I can't find enough documentation since it's new and the resource is very rare.
Does anybody know how to publish / install / update /remove process of the new extensions?
I've try many solution but many of the users say it doesn't work.
Here is my project call Swimat - to format your swift code.
https://github.com/Jintin/Swimat/tree/extension
Thanks for any kind of information.
Are you asking how your users can install/update/remove your extension?
If so, they just need to launch your container app. Once they do, they'll see the extension in System Preferences (where they can also disable it if necessary), and it'll show up when they launch Xcode.
Distribution of your source editor extension works just like other types of App Extensions. See: App Extension Programming Guide
If your users are having trouble running any source editor extensions, it's possible they'll need to follow a workaround from the Xcode 8 release notes:
To use the Editor's Comment/Uncomment Selection and Add Documentation
commands—as well as other installed Xcode Extensions—on OS X version 10.11,
launch Xcode and install additional system components, then restart your
Mac. (26106213)"

No transports available

I recently was trying to upgrade my react-native app to use react-native 0.5.0 and firebase. According to this article the react-native sockets are working and the full firebase sdk should be available.
I was previously using firebase-debug and #badfortrains react-native fork with success following the example project https://github.com/badfortrains/wsExample.
Since upgrading to I now am getting this error
When looking at the issues on the react-native repo I came across this https://github.com/sjmueller/firebase-react-native/issues/1
#stephenplusplus says he pushed a bunch of buttons and activated magic. Any idea what he is referencing??
There is also this other SO question Error creating user: { [Error: There are no login transports available for the requested method.] code: 'TRANSPORT_UNAVAILABLE' }
Any help on understanding the issue between using badfortrains with firebase-debug and the newest version of react-native with firebase would be appreciated.
I don't know if I am implementing something incorrectly or if the article mentioned above is a bit overzealous.
Thoughts???
Thanks.
Oddly enough starting a new project from scratch using the react-native-cli generator I was able to copy and paste all of my components over to the new project and have everything work perfectly.
I am not sure where the problem is but I will assume for now that there is an issue with the xcode project settings when trying to upgrade. Despite cleaning the project, resetting xcode to default settings, removing all derived data, restarting the package bundler, nothing worked until I created a new project.
This should prove there is nothing wrong with the JavaScript frameworks but rather it is some obscure xcode project setting. I will continue to look for a solution other than spinning a new project but for now it works.

How to debug into Cordova.framework in xcode

I'm having a problem where cordova is failing to start the camera app on iOS. A simple case works fine, but in my app, not so much.
So I'd like to debug into the Cordova.framework to see what the problem is.
But I can't figure out how to do it. I've built the Cordova project that's sitting next to the installed framework, and I've replaced my framework reference in my project to point at it. That seems to be fine. But I can't step in or set breakpoints.
With the cordova project, i"m building UniversalFramework and it looks like it's set to debug in the scheme config, even though it always builds to release (this seems to be in the script), I see --DDEBUG in the clang output, so I think it's debug. I'm fairly new to xcode so I don't know if it's building a symbol file or how to verify it's a debug framework, etc.
Latest Cordova (2.0.0) has it like a seperate project and linked as static library.
Use that version, you can put breakpoints in the library code.