Figure out how your app was installed. Testflight, App Store, or Simulator?
npm install expo-app-environmentA simple Expo module to detect how your app was installed - TestFlight, App Store, or Simulator.
``bash`
npx expo install expo-app-environment
`tsx
import { getEnvironment } from "expo-app-environment";
// Returns: "simulator" | "testflight" | "appstore"
const environment = getEnvironment();
`
tsx
import { getEnvironment } from 'expo-app-environment';
import { Text, View } from 'react-native';export default function App() {
return (
App was installed via: {getEnvironment()}
);
}
`
Return Values
$3
- iOS: Running in iOS Simulator
- Android: Running in Android Emulator
- Web: Running on localhost or 127.0.0.1`- ✅ iOS
- ✅ Android
- ✅ Web
MIT