2019-02-28 06:57:11 +00:00
|
|
|
# Testing Your Changes in the App
|
2018-09-09 15:02:03 +00:00
|
|
|
|
|
|
|
You should develop and test your changes with the JUnit environment that is
|
2019-02-28 06:57:11 +00:00
|
|
|
provided by the NewPipe Extractor and IDEA. If you want to try it with
|
2022-02-11 21:01:00 +00:00
|
|
|
the actual frontend, you need to follow these steps.
|
2018-09-09 15:02:03 +00:00
|
|
|
|
|
|
|
### Setup Android Studio
|
|
|
|
|
2019-02-28 06:57:11 +00:00
|
|
|
First, you'll want to set up a working Android Studio environment. To do this,
|
2018-09-09 15:02:03 +00:00
|
|
|
download Studio from [developer.android.com](https://developer.android.com/studio/),
|
2019-02-28 06:57:11 +00:00
|
|
|
and follow the [instructions](https://developer.android.com/studio/install) on how to set it up.
|
2018-09-09 15:02:03 +00:00
|
|
|
|
2019-02-28 06:57:11 +00:00
|
|
|
### Get the NewPipe Code and Run it.
|
2018-09-09 15:02:03 +00:00
|
|
|
|
2019-02-28 06:57:11 +00:00
|
|
|
In order to get it, you simply clone or download it from the current `dev` branch
|
2018-09-09 15:02:03 +00:00
|
|
|
[github.com/TeamNewPipe/NewPipe.git](https://github.com/TeamNewPipe/NewPipe/archive/dev.zip).
|
|
|
|
You can then build and run it following [these instructions](https://developer.android.com/studio/run/).
|
2019-02-28 06:57:11 +00:00
|
|
|
Also, make sure you are comfortable with [adb](https://en.droidwiki.org/wiki/Android_Debug_Bridge) since
|
|
|
|
you might experience some trouble running your compiled app on a real device, especially under Linux, where you
|
2018-09-09 15:02:03 +00:00
|
|
|
sometimes have to adjust the udev rules in order to
|
2019-02-28 06:57:11 +00:00
|
|
|
[make your device accessible](https://www.janosgyerik.com/adding-udev-rules-for-usb-debugging-android-devices/).
|
2018-09-09 15:02:03 +00:00
|
|
|
|
2019-02-28 06:57:11 +00:00
|
|
|
### Run Your Changes on the Extractor
|
2018-09-09 15:02:03 +00:00
|
|
|
|
2020-04-19 14:19:48 +00:00
|
|
|
There are several ways to test your extractor version in NewPipe. We will show you the most convenient ones:
|
|
|
|
|
|
|
|
#### Using local folder
|
|
|
|
|
|
|
|
In NewPipe app root folder, edit [settings.gradle](https://github.com/TeamNewPipe/NewPipe/blob/dev/settings.gradle) file and add this:
|
|
|
|
```
|
|
|
|
includeBuild('../NewPipeExtractor') {
|
|
|
|
dependencySubstitution {
|
|
|
|
substitute module('com.github.TeamNewPipe:NewPipeExtractor') with project(':extractor')
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
2020-04-19 21:30:53 +00:00
|
|
|
`includeBuild` should have the relative path as argument. `../NewPipeExtractor` means one folder up in hierarchy,
|
2020-04-19 18:47:51 +00:00
|
|
|
and the folder is exactly named `NewPipeExtractor`. If that's not the case, edit this part.
|
2020-04-19 14:19:48 +00:00
|
|
|
|
|
|
|
#### Using JitPack
|
|
|
|
|
|
|
|
Another way is to use [JitPack](https://jitpack.io). This is a build service that can build
|
2019-02-28 06:57:11 +00:00
|
|
|
maven *.jar packages for Android and Java based on GitHub or GitLab repositories.
|
2018-09-09 15:02:03 +00:00
|
|
|
|
2020-02-19 11:14:18 +00:00
|
|
|
To use the extractor through JitPack, you need to push it to your online repository of
|
2019-02-28 06:57:11 +00:00
|
|
|
your copy that you host either on [GitHub](https://github.com) or [GitLab](https://gitlab.com). It's important to host
|
2020-02-19 11:14:18 +00:00
|
|
|
it on one of both. To copy your repository URL in HTTP format, go to [JitPack](https://jitpack.io/) and paste it there.
|
2019-02-28 06:57:11 +00:00
|
|
|
From here, you can grab the latest commit via `GET IT` button.
|
2020-02-19 11:14:18 +00:00
|
|
|
I recommend not to use a SNAPSHOT, since I am not sure when snapshot is built. An "implementation" string will be generated
|
2018-09-09 15:02:03 +00:00
|
|
|
for you. Copy this string and replace the `implementation 'com.github.TeamNewPipe:NewPipeExtractor:<commit>'` line in
|
|
|
|
the file [/app/build.gradle](https://github.com/TeamNewPipe/NewPipe/blob/dev/app/build.gradle#L58) with it.
|
|
|
|
|
|
|
|
<video width="600" controls>
|
2018-09-09 15:08:37 +00:00
|
|
|
<source src="../media/how_to_jitpack.mp4" type="video/mp4">
|
2018-09-09 15:02:03 +00:00
|
|
|
Your browser does not support the video tag.
|
|
|
|
</video>
|
|
|
|
|
2019-02-28 06:57:11 +00:00
|
|
|
If everything synced well, then you should only see a screen with OK signs. Now you can compile and run NewPipe
|
2018-09-09 15:02:03 +00:00
|
|
|
with the new extractor.
|
2018-11-16 18:23:01 +00:00
|
|
|
|
|
|
|
![image_sync_ok](img/sync_ok.png)
|
2018-09-09 15:02:03 +00:00
|
|
|
|
2018-12-12 02:14:05 +00:00
|
|
|
### Troubleshooting
|
2018-09-09 15:02:03 +00:00
|
|
|
|
2020-02-19 11:14:18 +00:00
|
|
|
If something went wrong on JitPack site, you can check their build log, by selecting the commit you tried to build and
|
2019-02-28 06:57:11 +00:00
|
|
|
click on that little paper symbol next to the `GET IT` button. If it's red, it means that the build failed.
|
2018-11-16 18:23:01 +00:00
|
|
|
![jitpack failed to build](img/jitpack_fail.png)
|