Unable to forge run on iOS device

Hey guys, I’m unable to do a ‘forge run iOS’ on my iOS device as i get a permissions denied error. Similar works fine. Have i missed something? Here is my local config.json:

{
    "general": {},
    "ios": {
	    "profiles": {
		    "DEFAULT": {
			    "provisioning_profile": "xxxx",
			    "developer_certificate": "xxxx",
			    "developer_certificate_path": "xxxx"
		    }
	    },
	    "device": "MY DEVICE UDID"
    },
    "web": {
	    "profiles": {
		    "DEFAULT": {}
	    }
    }
}

And here is the error:

2020-10-13 23:00:46,800 [   INFO] 1 Provisioned Device(s):
2020-10-13 23:00:46,800 [   INFO] ['MY DEVICE UDID']
2020-10-13 23:00:46,800 [   INFO] Locating ios app for target: ios -> /Users/xxxx/Repo/xxxx%20iOS/development
2020-10-13 23:00:46,805 [  DEBUG] Running: '/usr/bin/codesign' '--force' '--identifier' 'xxxx' '--entitlements' '/var/folders/rg/y512jj3s56qcztp5y59tpx0w0000gn/T/tmpFgcMd_' '--sign' 'xxxx' '/Users/xxxx/Repo/xxxx%20iOS/development/ios/device-ios.app'
2020-10-13 23:00:46,876 [  DEBUG] /Users/xxxx/Repo/xxxx%20iOS/development/ios/device-ios.app: replacing existing signature
2020-10-13 23:00:47,049 [  DEBUG] File: ios-deploy, already downloaded and correct.
2020-10-13 23:00:47,049 [   INFO] Installing app on device MY DEVICE UDID: is it connected?
2020-10-13 23:00:47,049 [  DEBUG] Running: '/Users/xxxx/Repo/xxxx%20iOS/.lib/ios-deploy' '-d' '-u' '-t' '60' '-I' '-b' '/Users/xxxx/Repo/xxxx%20iOS/development/ios/device-ios.app' '-i' 'MY DEVICE UDID'
2020-10-13 23:00:47,330 [  DEBUG] https://trigger.io:443 "POST /api/v1/track/ HTTP/1.1" 200 None
2020-10-13 23:00:48,085 [  DEBUG] Failed to run: /Users/xxxx/Repo/xxxx%20iOS/.lib/ios-deploy -d -u -t 60 -I -b /Users/xxxx/Repo/xxxx%20iOS/development/ios/device-ios.app -i MY DEVICE UDID
2020-10-13 23:00:48,085 [  ERROR] Something went wrong that we didn't expect:
2020-10-13 23:00:48,085 [  ERROR] [Errno 13] Permission denied
2020-10-13 23:00:48,085 [  DEBUG] Traceback (most recent call last):
  File "/Users/xxxx/Library/Trigger Toolkit/build-tools/forge/async.py", line 106, in run
    result = self._target(*self._args, **self._kwargs)
  File "/Users/xxxx/Library/Trigger Toolkit/build-tools/forge/main.py", line 483, in run
    build_to_run=build_to_run,
  File "/Users/xxxx/Repo/xxxx%20iOS/.template/generate_dynamic/customer_goals.py", line 148, in run_app
    build_to_run.run()
  File "/Users/xxxx/Repo/xxxx%20iOS/.template/generate_dynamic/build.py", line 347, in run
    self._call_with_params(task_method, task_args)
  File "/Users/xxxx/Repo/xxxx%20iOS/.template/generate_dynamic/build.py", line 306, in _call_with_params
    return method(self, *params)
  File "/Users/xxxx/Repo/xxxx%20iOS/.template/generate_dynamic/ios_tasks.py", line 770, in run_ios
    certificate_password=certificate_password,
  File "/Users/xxxx/Repo/xxxx%20iOS/.template/generate_dynamic/ios_tasks.py", line 681, in run_iphone_device
    run_shell(*ios_deploy, fail_silently=True, command_log_level=logging.INFO, filter=filter_and_combine, check_for_interrupt=True, env=env)
  File "/Users/xxxx/Repo/xxxx%20iOS/.template/generate_dynamic/module_dynamic/utils.py", line 357, in run_shell
    raise state.error
OSError: [Errno 13] Permission denied

That’s definitely a weird one, it looks like the ios-deploy binary hasn’t got execute permissions on your machine.

It might be because you copied your directory over from another directory or machine in a way that did not preserve file permissions?

What you can try is to delete the following directories and then try rebuilding and running your app again:

/path/to/your/app/.lib
/path/to/your/app/.trigger

Otherwise, if that didn’t do the trick, a few questions:

  • Which version of macOS are you running?
  • Which version of iOS are you running?
  • What’s the platform_version key in your app’s src/config.json set to?

Can you please also post the output of running the following from the command line:

First:

cd /path/to/your/app
.lib/ios-deploy

…and then also:

cd /path/to/your/app
.lib/ios-deploy -d -u -t 60 -I -b /path/to/your/app/development/ios/device-ios.app

just to chime in, how are you running the command? I have found that if I run just ‘forge’ on IOS this will happen because Node does not have permission to run.

This is why you need to use the npx command for it would be like npx forge run ios as described here

Thanks for the quick reply.

Yes this is a cloned repo so that might explain it.
Deleting those folders broke even trying to build haha. I did not actually have the ‘.trigger’ one FYI.
When running those commands I get the same error: ‘Permission denied’
.
I created a new app from scratch to test the first theory and that seems to be working fine