IBM Worklight - “Permission denied” when building

2019-02-23 02:12发布

I created and built a Worklight project following the official guide on developerWorks. I deployed the app on Android device and it worked fine. But when I built the generated native project with Xcode, I got the following error:

Running a custom build phase script: buildtime.sh /Users/gengsm/Documents/workspace/MobileClientMobileBankIphone-apsfwvobsizahnbjzlwhgbsbwusj/Build/Intermediates/MobileClientMobileBankIphone.build/Debug-iphonesimulator/MobileClientMobileBankIphone.build/Script-427B829D1393724500F223DC.sh: line 7: /Users/gengsm/Documents/workspace/BTT_Mobile/MobileClient/apps/MobileBank/iphone/native/buildtime.sh: Permission denied DONE with script: buildtime.sh (exitStatus=126)\n\n

1条回答
你好瞎i
2楼-- · 2019-02-23 02:57

This is probably a Worklight project that was created in Windows and then the generated Xcode project was moved to Mac to be built in Xcode...

The problem here is that the buildtime.sh file lost its Execute permission.
This defect is fixed and will be available in Worklight 6.1.0, available in the coming weeks.

Solutions:

  • Assuming you have brought the generated Xcode project from Windows to Mac:

    1. Extract the zipped project
    2. find in it the buildtime.sh file
    3. Right-click it > Get Info
    4. At the bottom change the Owner permission to Read & Write

  • If that doesn't work, you can also change the permission using CHMOD:

    1. Copy the path to the folder holding the buildtime.sh file
    2. Open the Terminal app
    3. Run the following command (but use your own path from 1 above): chmod 755 /Users/idan/Documents/Worklight/workspace-6001/TestProject/apps/TestApp/iphone/native/buildtime.sh

  • If you have the entire Worklight project in Mac, then in Eclipse:

    1. Right-click the iphone\native\buildtime.sh file > properties
    2. Add the Execute permission for Owner
    3. Re-build to generate an updated Xcode project
    4. Open in Xcode > Run

You can also:

  • Create the Worklight project to begin with, in Eclipse in Mac.
    This project should not exhibit this issue then.
查看更多
登录 后发表回答