Detect Detached Expo App

Expo CLI 3.4.1 environment info:
System:
OS: macOS 10.15.2
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.16.3 - /usr/local/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.9.0 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
IDEs:
Android Studio: 3.5 AI-191.8026.42.35.5977832
Xcode: 11.1/11A1027 - /usr/bin/xcodebuild
npmPackages:
expo: ^35.0.0 => 35.0.0
react: 16.8.3 => 16.8.3
react-native: https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz => 0.59.8
react-navigation: ^3.12.0 => 3.13.0
npmGlobalPackages:
expo-cli: 3.4.1

I have ejected Expo and it become detached project.

 "isDetached": true,
    "detach": {
      "iosExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/ios-v2.13.0-sdk35.0.0-a30ebc9b-3db4-42f4-b677-daf.tar.gz",
      "androidExpoViewUrl": "https://s3.amazonaws.com/exp-exponent-view-code/android-v2.13.0-sdk35.0.0-b816b7af-88da-4ca9-87a5-adfs.tar.gz"
    }

I publish to Expo like this.
expo publish --release-channel dev

For UI development, I usually uneject and development on Expo app since it is much faster.
Problem is that I delete isDetached in App.json and I put it back for building APK, IPA. Sometimes, I forgot to put back and build wrong APK, IPA.

Is there a way expo can detect whether it is detached app or not? Like if I run ‘expo isDetached’ and if it can return true or false, I can fully automate the process. If it is true, I will proceed to build IPA, APK and if it is false, I won’t proceed. Is it possible ? or is there a way to do?

Hi

You could perhaps script this with jq.

If isDetached is false or null:

$ jq -e '.expo.isDetached' <app.json 
null
$ echo $?
1

If isDetached is true:

$ jq -e '.expo.isDetached' <app.json 
true
$ echo $?
0

But also have a look at the following which might be a better way to go:
https://docs.expo.io/versions/v35.0.0/bare/using-expo-client/

oh …this solves my issue. Thanks a lot for idea. You are the best.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.