npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-native-app-control-lite

v0.1.5

Published

Lightweight restart/reload/exit helpers for React Native apps (Android restart, iOS reload).

Readme

react-native-app-control-lite

경량 리스타트/리로드 네이티브 모듈입니다.
react-native-restart의 완벽한 대체로, 릴리즈 빌드에서도 안전하게 동작합니다.

  • Android
    • restart() : 런처 액티비티 재기동 + 프로세스 종료
    • recreate() : 현재 액티비티만 재생성
    • exitApp() : 앱 즉시 종료
  • iOS
    • reload() : JS 브리지 리로드 (정책상 완전 재시작 불가)
  • JS
    • safeRestart() : 플랫폼별 최선의 방식으로 재시작
    • appExit() : 앱 종료
    • isModuleReady() : 모듈 로딩 확인

📦 설치 방법

1️⃣ 로컬 설치 (zip 혹은 소스 직접 포함)

  1. react-native-app-control-lite 폴더를 프로젝트에 복사하거나 zip 파일을 풀어서 넣습니다.
    예시 구조:

    your-project/
      packages/
        react-native-app-control-lite/
  2. 로컬 경로로 패키지를 추가합니다.

    # yarn
    yarn add ./packages/react-native-app-control-lite
    
    # 또는 npm
    npm install ./packages/react-native-app-control-lite
  3. iOS 빌드 준비:

    cd ios && pod install && cd ..

2️⃣ npm 패키지로 직접 설치 (공개 배포 시)

  1. 모듈을 npm에 배포하려면:

    npm login
    npm publish --access public
  2. 앱 프로젝트에서 아래처럼 바로 설치할 수 있습니다.

    # yarn
    yarn add react-native-app-control-lite
    
    # npm
    npm install react-native-app-control-lite
  3. iOS 설정:

    cd ios && pod install && cd ..

3️⃣ Android Proguard 설정 (필수)

릴리즈 빌드 시 모듈이 삭제되지 않도록
android/app/proguard-rules.pro 파일에 아래를 추가하세요:

-keep class com.appcontrollite.** { *; }

🧩 사용 예시

import { safeRestart, appExit, isModuleReady } from 'react-native-app-control-lite';

// 안전한 앱 재시작 (Android: restart → recreate → exitApp 순으로 폴백)
await safeRestart();

// Android 앱 종료
await appExit();

// 모듈 정상 로딩 확인
const ok = await isModuleReady();
console.log('Module ready:', ok);

기존 react-native-restart 교체 예시:

- import RNRestart from 'react-native-restart';
+ import { safeRestart } from 'react-native-app-control-lite';

- RNRestart.Restart();
+ safeRestart();

⚙️ API 요약

| 플랫폼 | 메서드 | 설명 | |---------|--------|------| | 공통 | safeRestart() | 플랫폼별 최적의 재시작 수행 | | 공통 | isModuleReady() | 네이티브 모듈 로드 여부 | | Android | restart() | 런처 액티비티 재시작 + 프로세스 종료 | | Android | recreate() | 현재 액티비티 재생성 | | Android | exitApp() | 프로세스 종료 | | iOS | reload() | JS 브리지 리로드 (전체 앱 재시작은 불가) |


🧠 트러블슈팅

🔹 모듈이 undefined로 나오는 경우

  • npx react-native config | grep appcontrollite 로 autolink 인식 여부 확인
  • pod install 실행 여부 점검
  • Android는 Proguard 규칙 추가 확인

🔹 릴리즈 빌드에서만 작동하지 않을 때

  • Proguard 규칙 누락 여부 확인
  • multiDexEnabled true 설정 여부 확인 (defaultConfig 내부)

🔹 Hermes 사용

문제 없습니다. 소스맵 업로드로 스택 매핑을 하면 릴리즈 로그도 정상적으로 매핑됩니다.


🧑‍💻 라이선스

MIT
Copyright © 2025