Skip to content

Commit 7099f17

Browse files
committed
chore: run on device
1 parent da5072b commit 7099f17

File tree

5 files changed

+286
-956
lines changed

5 files changed

+286
-956
lines changed

App.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import { noise } from '@chainsafe/libp2p-noise'
1010
import { yamux } from '@chainsafe/libp2p-yamux'
1111
import { identify } from '@libp2p/identify'
1212
import { circuitRelayTransport } from '@libp2p/circuit-relay-v2'
13+
//import { tcp } from '@libp2p/tcp'
1314
import * as filters from '@libp2p/websockets/filters'
1415
import debug from 'debug'
1516

@@ -29,7 +30,8 @@ export default function App () {
2930
}),
3031
webSockets({
3132
filter: filters.all
32-
})
33+
}),
34+
//tcp()
3335
],
3436
connectionEncryption: [
3537
noise()

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,11 +106,13 @@ Follow the instructions - press `i` to start iOS or `a` for Android.
106106
See the [expo docs](https://docs.expo.dev/guides/local-app-development/)
107107

108108
```console
109-
$ npx expo run:android
109+
$ npx expo run:android --device
110110
```
111111

112+
For iOS you will need to provision a device certificate as normal.
113+
112114
```console
113-
$ npx expo run:ios
115+
$ npx expo run:ios --device
114116
```
115117

116118
## Notes

ios/Podfile

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,31 @@ target 'jslibp2preactnative' do
8888
end
8989
end
9090

91+
92+
# This provides a post_install workaround for build issues related Xcode 12.5 and Apple Silicon (M1) machines.
93+
# Call this in the app's main Podfile's post_install hook.
94+
# See https://github.com/facebook/react-native/issues/31480#issuecomment-902912841 for more context.
95+
# Actual fix was authored by https://github.com/mikehardy.
96+
# New app template will call this for now until the underlying issue is resolved.
9197
def __apply_Xcode_12_5_M1_post_install_workaround(installer)
98+
# Flipper podspecs are still targeting an older iOS deployment target, and may cause an error like:
99+
# "error: thread-local storage is not supported for the current target"
100+
# The most reliable known workaround is to bump iOS deployment target to match react-native (iOS 11 now).
92101
installer.pods_project.targets.each do |target|
93102
target.build_configurations.each do |config|
94-
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '17.0'
103+
# ensure IPHONEOS_DEPLOYMENT_TARGET is at least 11.0
104+
deployment_target = config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'].to_f
105+
should_upgrade = deployment_target < 11.0 && deployment_target != 0.0
106+
if should_upgrade
107+
config.build_settings['IPHONEOS_DEPLOYMENT_TARGET'] = '11.0'
108+
end
95109
end
96110
end
97111

98-
`sed -i -e $'s/__IPHONE_10_0/__IPHONE_14_0/' Pods/RCT-Folly/folly/portability/Time.h`
112+
# But... doing so caused another issue in Flipper:
113+
# "Time.h:52:17: error: typedef redefinition with different types"
114+
# We need to make a patch to RCT-Folly - remove the `__IPHONE_OS_VERSION_MIN_REQUIRED` check.
115+
# See https://github.com/facebook/flipper/issues/834 for more details.
116+
time_header = "#{Pod::Config.instance.installation_root.to_s}/Pods/RCT-Folly/folly/portability/Time.h"
117+
`sed -i -e $'s/ && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_10_0)//' '#{time_header}'`
99118
end

0 commit comments

Comments
 (0)