Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use npm and some documentation for troubleshooting iOS development problems #218

Merged
merged 3 commits into from
Feb 2, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 29 additions & 9 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ The pixelfed mobile app is written in [react native](https://reactnative.dev) an
## Requirements

- [`git-lfs`](https://git-lfs.com)
- [`yarn` package manager](https://yarnpkg.com)
- [watchman](https://facebook.github.io/watchman/docs/install)
- Building for android:
- [android studio](https://developer.android.com/studio) and java
Expand All @@ -17,44 +16,48 @@ https://docs.expo.dev/get-started/set-up-your-environment/ helps you to install
## First time setup

```sh
corepack enable # prerequisite to install yarn automatically on next step
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We still need to enable corepack on first run, it is not enabled by default

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why? Is npm not installed by default anymore?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm should be installed with every node installation, but corepack still needs to be enabled, as far as I know

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's the first time I hear that in my years of javascript development. This instance was the first time I ever used corepack.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have also never used corepack before, but since it's here already, let's just keep it

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I See no reason to include it unless we use an alternative package manager like yarn or pnpm. But If you want to keep it we can also do that, I don't have strong opinions about this and would like to get the pr merged soon.

yarn # install dependencies
npm i # install dependencies
```

Also follow steps in https://docs.expo.dev/get-started/set-up-your-environment/

## Build the project

```sh
yarn start
npm run start
```

### Web

```sh
yarn web
npm run web
```

### Android

```sh
yarn android
npm run android
```

### iOS

```sh
yarn ios
npm run ios
```

#### Select your real device to test on
```sh
npm run ios -- --device
```

### check for ts errors and lint problems
```sh
yarn check
npm run check
```

### fix formatting & linting
```sh
yarn lint
npm run lint
```

## Troubleshooting
Expand All @@ -76,3 +79,20 @@ cd ios
pod install
```


### IOS: "Building workspace pixelfed with scheme pixelfed and configuration Debug"

When you are not part of the pixelfed apple developer team, then you need to make the following changes to get it to build:

- open `ios/pixelfed.xcworkspace` in xcode
- then in file explorer open "Pixelfed"
- go to target pixelfed
- go to Signing & capabilities
- Change the team to your own
- change bundle identifier by preprending your own domain in reverse notation
- disable/remove app group
- delete push notification capability

### IOS: "CommandError: ApplicationVerificationFailed"

Build it with xcode. It shows the full error.
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"web": "expo start --web",
"test": "jest --watchAll",
"lint": "biome check --write ./src",
"check": "yarn check:ts && yarn check:lint",
"check": "npm run check:ts && npm run check:lint",
"check:ts": "tsc",
"check:lint": "biome check ./src",
"postinstall": "patch-package"
Expand Down Expand Up @@ -81,6 +81,5 @@
"@types/react": "~18.2.45",
"babel-plugin-module-resolver": "^5.0.0"
},
"private": true,
"packageManager": "[email protected]"
"private": true
}