r/iOSProgramming • u/hyzyla • Jun 02 '24
3rd Party Service I’ve made VSCode extension for iOS development
Hello 👋 I've created VSCode extension SweetPad that lets you build iOS applications right from VSCode. You can build and launch app on a simulator or attach a debugger to running app. Also extension provide integration with SwiftFormat, so you can enjoy the "Format on Save" feature. Any feedback is appreciated 🙏
22
u/AstraTrade Jun 02 '24
Wow this is awesome! Going to give it a try
1
u/hyzyla Jun 03 '24
Thanks 🤩
1
u/AstraTrade Jun 03 '24
Does this support workspaces? Do I open the workspace file or just the folder it's in?
2
u/hyzyla Jun 03 '24
I would say it have only basic support for workspaces. When you first run the extension, it will try to find a project or workspace by executing the `xcodebuild -list -json` command. Additionally, when you build the project for the first time, it will ask you to choose a workspace if there is more than one. If the extension fails to find a workspace or project, you can set the workspace manually in your .vscode/settings.json:
{ // Path to your Xcode workspace (.xcworkspace file) // The path can be absolute or relative to the folder in which VSCode is opened. "sweetpad.workspacePath": "/path/to/your/workspace" // Examples: // "sweetpad.workspacePath": "terminal23.xcodeproj/project.xcworkspace" // "sweetpad.workspacePath": "terminal23.xcworkspace" // "sweetpad.workspacePath": "/Users/username/Projects/terminal23.xcworkspace" }You can also set the Xcode workspace path by executing the command
> SweetPad: Select Xcode Workspacefrom the command palette. Here is the documentation with the same information: Set Xcode workspace pathSupport for workspaces is still an open issue for me, which I've tried to fix during previous weekends. You can subscribe to this issue Workspace support #10 if you have any ideas how to improve workspace support.
Answering you question, you can open vscode in root folder of your project and then select xcode workspace if needed
3
u/AstraTrade Jun 03 '24
Awesome, I’ll give this a shot. Keep it up! Also add a “buy me a coffee” button please. This is a really great initiative
7
3
Jun 03 '24
That’s awesome, especially after AppCode was discontinued
1
u/hyzyla Jun 03 '24
Thanks! It's too far to catch up with AppCode, but I was definetly impired by xcodebuild.nvim and presentation how AppCode works AppCode under the hood
2
45
1
u/Scarcity-Pretend Jun 03 '24
Does this run a project clean before building? :)
1
u/hyzyla Jun 03 '24
It removes bundle dir before each build [1], but xcodebuild tool have its own cache dir, so generally second build after first is faster for me
1
u/Armed_Muppet Jun 04 '24
I’m assuming this won’t work on windows and requires Xcode already?
1
u/hyzyla Jun 04 '24
No, unfortunately currently it doesn’t work, but I think in a future I can utilise Dev containers, VSCode feature, that allows to run VSCode environment in docker container. Forst hypothesis is to use combination with with project Docker-OSX [1], but main blocker for now is to stream video output from simulator directly into VSCode.
6
1
u/tochanenko Jun 03 '24
Great job! I got myself a MacBook just recently, so I will dig into iOS development in a near future. This might help a lot, considering that there are so many problems with XCode.
Чудова робота ;)
2
2
2
u/VenusFlytrapDeMilo Jun 03 '24
Ohhhhh shoot! I've been hoping something like this would pop up for ages - will try it out.
2
2
3
0
13
u/hyzyla Jun 03 '24
Thanks for the support! ❤️
To make it clear, this extension doesn’t replace Xcode, because it’s built on top of the xcodebuild tool and doesn’t have all the essential parts that Xcode has. But I hope this extension will become a ground base for more advanced future that Xcode have.
One idea that seems quite possible to build in the future is remote development environment, where a remote server will be macOS and a client can be any OS, like Linux or iPadOS
Here is open issue for that: https://github.com/sweetpad-dev/sweetpad/issues/9#issuecomment-2140819250