Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Client build for iOS simulator #1252

Closed
3 of 4 tasks
fortuna opened this issue Apr 13, 2022 · 6 comments · Fixed by #1257
Closed
3 of 4 tasks

Enable Client build for iOS simulator #1252

fortuna opened this issue Apr 13, 2022 · 6 comments · Fixed by #1257
Assignees
Labels

Comments

@fortuna
Copy link
Collaborator

fortuna commented Apr 13, 2022

Currently our client doesn't run on the simulator because our dependencies are built for the device architecture.
We should migrate the dependencies to xcframeworks. Both Carthage and go-mobile already support that.
We will probably need to edit the xcode project.

Those dependencies are specified in the plugin.xml. We will need to update that file to refer to the xcframework files

We may need to also edit the xcode project because I think we disable some architectures.

We may be able to migrate the Carthage dependencies to cocoapods, at least on ios, since Cordova seems to support it (see spec). Though it may be better to have a more unified architecture with macos and just use a xcframework (or migrate macOS to Cocoa pods somehow)

/cc @daniellacosse

@fortuna
Copy link
Collaborator Author

fortuna commented Apr 14, 2022

FYI, here is an attempt to generate the tun2socks xcframework: Jigsaw-Code/outline-go-tun2socks#85

To be validated.

@alalamav
Copy link
Contributor

Note that the iOS simulator does not support the NetworkExtension framework used to establish the VPN. A simulator build may be useful to test UI, but you may need to mock out the NE VPN functionality.

@fortuna
Copy link
Collaborator Author

fortuna commented Apr 18, 2022

It turns out Sentry 4 only supports arm64 for iOS:
image

Sentry needs to be upgraded to version 5+.
Here is the migration info: https://docs.sentry.io/platforms/apple/migration/#upgrading-from-4x-to-5x

@fortuna
Copy link
Collaborator Author

fortuna commented Apr 21, 2022

After updating Sentry and Tun2Socks, I was able to run on the simulator. However, I can't connect:

image

On the logs, I see:

2022-04-21 18:49:38.337288-0400 Outline[80153:11611325] Failed to start VPN
2022-04-21 18:49:38.340605-0400 Outline[80153:11607025] ERROR: could not connect to server XXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXX: VpnPermissionNotGranted

@fortuna
Copy link
Collaborator Author

fortuna commented Apr 21, 2022

@alalamav any idea how I can grant the VPN permission to the app?

@fortuna
Copy link
Collaborator Author

fortuna commented Apr 27, 2022

This is done. We can now build for the simulator, even though the VPN doesn't work.
As far as I can tell, we can also build for Apple Silicon.

These commands now work after you created and prepared the ios platform with npm run action gulp build ios:

npx cordova compile ios --simulator
npx cordova compile ios --device

cordova run doesn't work because it calls prepare, which is broken without the rsync call.

@daniellacosse I believe we will need to tweak the build scripts to allow for building for the simulator. With the cordova CLI we could call cordova build --simulator ios

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants