How to install React native app in one iPhone without an Apple Developer Account

#React native, #IOS, #Expo

ยท

2 min read

Problem

When creating one app, we want to install the application on our physical device such as an iPhone or iPad to test it on a real device, however, without an Apple Developer Account, the test flight service can't be used therefore we can't test it.

It will work for simple applications, if your app is using notifications, you may need an Apple Developer account

Solution

There is one option the build the app using XCode and install it on the iOs device

Steps

  1. Have a react-native app created, perhaps using Expo

  2. Connect the iOs device to the laptop using a cable

  3. build the app using the command expo run:ios . It will create the ios folder

  4. Open the project_name.xcworkspace using XCode e.g trackwallet.xcworkspace

  5. Once the project is opened using XCode, Click on Product > Archive

    it will start building the project

    Once finished, it will display one window with the built file

  1. Right-click on the built file, and click on Show in the finder, it will display one folder with the .xcarchive file as below

  2. Right-click and select the option Show package content as below

    It will display one folder as below

    Rename the folder Application to Payload
    so, it will look like as below

  3. Compress the Payload folder

  4. Replace the name of the compressed file from Payload.zip to Payload.ipa
    as below

  5. The next step is to install the app on the device, go to XCode > Window > Devices and Simulators
    and drag the Payload.ipa file to the Installed app zone or you can click in + icon and import the Payload.ipa

    Once done the prev step, it will display the top banner which says the it is preparing the install the app

    Once it is completed, you can see the app on the installed app list as below

  6. Now, you can see the app installed on your phone, when opening the app on the phone, you may see one alert as below

    To fix it, you must go to Settings > General > VPN & Device Management, click in the Developer App option , and click on Trust Apple Development

Once done with the previous step, you can open the app on your iOS device.

Happy Coding ๐ŸŽ‰๐ŸŽ‰๐ŸŽ‰

ย